CSI Volume Clone Support
Creating a new volume as a duplicate of an existing volume
Longhorn supports CSI volume cloning. Suppose that you have the following source-pvc:
apiVersion: v1kind: PersistentVolumeClaimmetadata:name: source-pvcspec:storageClassName: longhornaccessModes:- ReadWriteOnceresources:requests:storage: 10Gi
You can create a new PVC that has the exact same content as the source-pvc by applying the following yaml file:
apiVersion: v1kind: PersistentVolumeClaimmetadata:name: cloned-pvcspec:storageClassName: longhorndataSource:name: source-pvckind: PersistentVolumeClaimaccessModes:- ReadWriteOnceresources:requests:storage: 10Gi
Note: In addition to the requirements listed at CSI volume cloning, the
cloned-pvcmust have the sameresources.requests.storageas thesource-pvc.
History
Available since v1.2.0