Create a Volume with a Backing Image
- Click Setting > Backing Image in the Longhorn UI.
- Click Create Backing Image to create a backing image with a unique name and a valid URL.
- During the volume creation, specify the backing image from the backing image list.
- Longhorn starts to download the backing image to disks for the replicas when a volume using the backing image is attached to a node.
Restore a Volume with a Backing Image
- Click and pick up a backup volume for the restore.
- As long as the backing image is already set for the backup volume, Longhorn will automatically choose the backing image during the restore.
- Longhorn allows you to re-specify/override the backing image during the restore.
- Set the fields
backingImage
and in a Longhorn StorageClass. - Longhorn starts to download the backing images to disks for the replicas when a volume using the backing image is attached to a node.
- The backing image file in a disk will be shared among the replicas when these replicas in the same disk are using the same backing image.
- Please be careful of the escape character
\
when you input a URL in a StorageClass. - Users need to make sure the backing image existence when they use UI to create or restore a volume with a backing image specified.
- Longhorn automatically cleans up the backing images in the disk based on the setting Backing Image Cleanup Wait Interval.
- The unused backing images can be cleaned up manually via the Longhorn UI: Click Setting > Backing Image > CleanupBackingImage of one backing image. Then choose disks.
- There is one pod with the naming schema handling the actual file for each backing image in each disk. Hence, whether a replica in a disk has access to a backing image totally depends on if the related pod is available or not.
- When the node is down, Kubernetes evicts the pods on the node, and the backing image download state of the disks on the node will become
failed
.
- Available since v1.1.1