Creating a Volume from a Snapshot

You can restore a volume from a volume snapshot by configuring a PersistentVolumeClaim that specifies the volume snapshot as the data source.

In the following example, the snapshot named testcsi-secure-snapshot serves as the data source for creating a new volume named testcsi-secure-pvc-restore:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: testcsi-secure-pvc-restore
  namespace: test-csi
spec:
  storageClassName: testcsi-secure-sc
  accessModes:
    - ReadWriteOnce
 resources:
   requests:
     storage: 10G
 dataSource:
   kind: VolumeSnapshot
   apiGroup: snapshot.storage.k8s.io
   name: testcsi-secure-snapshot

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

For more information, see Persistent Volumes.