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: v1
kind: PersistentVolumeClaim
metadata:
  name: source-pvc
spec:
  storageClassName: longhorn
  accessModes:
    - ReadWriteOnce
  resources:
    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: v1
kind: PersistentVolumeClaim
metadata:
  name: cloned-pvc
spec:
  storageClassName: longhorn
  dataSource:
    name: source-pvc
    kind: PersistentVolumeClaim
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi

Note: In addition to the requirements listed at CSI volume cloning, the cloned-pvc must have the same resources.requests.storage as the source-pvc.

History

Available since v1.2.0


© 2019-2026 Longhorn a Series of LF Projects, LLC. Documentation Distributed under CC-BY-4.0.


For website terms of use, trademark policy and other project policies please see lfprojects.org/policies.