Example: Volume Cloning for Dynamic Provisioning

About this task

You can clone a volume from an existing volume by configuring a PersistentVolumeClaim that specifies the volume PVC as the data source. In the following example, the PVC named testcsi-secure-pvc serves as the data source for creating a new volume named testcsi-secure-pvc-clone:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
 name: testcsi-secure-pvc-clone
 namespace: test-csi
spec:
 storageClassName: testcsi-secure-sc
 accessModes:
    - ReadWriteOnce
 resources:
 requests:
 storage: 10G
 dataSource:
 kind: PersistentVolumeClaim
 name: testcsi-secure-pvc

When cloning extra large volumes (volumes measuring hundreds of GB), you might experience timeouts or a failure to clone the volume. To prevent timeouts with extra large volumes, increase the retry timeout setting for the csi-provisioner sidecar container. See the --timeout argument in the latest csi-maprkdf-<version>.yaml.

For more information, see CSI Volume Cloning.