Set Backing Image for Longhorn Volumes
Longhorn natively supports backing images since v1.1.1.
A QCOW2 or RAW image can be set as the backing/base image of a Longhorn volume, which allows Longhorn to be integrated with a VM like Harvester.
Backupand pick up a backup volume for the restore.
backingImageURLin a Longhorn StorageClass.
A StorageClass example:
apiVersion: v1 kind: ConfigMap metadata: name: longhorn-storageclass namespace: longhorn-system data: storageclass.yaml: | kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: longhorn provisioner: driver.longhorn.io allowVolumeExpansion: true reclaimPolicy: Delete volumeBindingMode: Immediate parameters: numberOfReplicas: "3" staleReplicaTimeout: "2880" fromBackup: "" backingImage: "bi-test" backingImageURL: "https://backing-image-example.s3-region.amazonaws.com/test-backing-image"
\when you input a URL in a StorageClass.
Backing Image Cleanup Wait Interval.
<Backing image name>-<first 8 characters of the disk UUID>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.
runninguntil the pod becomes
In brief, Longhorn will automatically recover the backing images after the node is back, users don’t need to worry about it.
The URL of the backing image should be public. We will improve this part in the further.
© 2019-2023 Longhorn Authors | Documentation Distributed under CC-BY-4.0
© 2023 The Linux Foundation. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.