--- title: "Protect Volumes with VAST Snapshots and Clones" slug: "protect-volumes-with-vast-snapshots-and-clones-2-7" updated: 2026-10-28T02:14:43Z published: 2026-10-28T02:14:43Z canonical: "docs.vastdata.com/protect-volumes-with-vast-snapshots-and-clones-2-7" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.vastdata.com/llms.txt > Use this file to discover all available pages before exploring further. # Protect Volumes with VAST Snapshots and Clones ## Overview of VAST Snapshots and Clones You can protect Kubernetes volumes using VAST cluster snapshots. A snapshot is a reference point that preserves the exact folder structure and data content of a data path at a point in time. Snapshots serve as a virtual copy of the data you had at previous points in time and enable you to restore files or directories after deletion or modification. > **Note:** For more information about VAST snapshots, see the *VAST Cluster Administrator's Guide*. You can [create](/develop/docs/protect-volumes-with-vast-snapshots-and-clones-2-7#create-volume-snapshot) snapshots for your Persistent Volume Claims (PVCs) to be able to [restore](/develop/docs/protect-volumes-with-vast-snapshots-and-clones-2-7#restore-volume-from-snapshot) the data based on an existing snapshot. VAST CSI Driver lets you create an instantly writeable [clone](/develop/docs/protect-volumes-with-vast-snapshots-and-clones-2-7#clone-volume-or-snapshot) of a Kubernetes volume. VAST CSI Driver also supports provisioning for read-only PVCs based on Kubernetes-created snapshots. ## Create Volume Snapshot To create a snapshot of a Kubernetes volume using a Kubernetes YAML configuration file: 1. Create a YAML configuration file that adds a volume snapshot. In the file (see the example below for correct indentation and line breaks when specifying the keywords): For example: ``` apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshot metadata: name: snapshot-pvc-1 spec: volumeSnapshotClassName: vastdata-snapshot source: persistentVolumeClaimName: csi-pvc ``` - In `medadata`: - `name` is the Persistent Volume Claim (PVC) name to store the snapshot. - In `spec`: - `volumeSnapshotClassName`: the name of the snapshot class. - In `source`: - `persistentVolumeClaimName` is the PVC name for the volume being protected. 2. Apply the YAML configuration file: ``` kubectl apply -f vast-csi-deployment.yaml ``` 3. Verify that the PVC snapshot has been created with the following command: ``` kubectl get vs ``` The output is similar to the following: ``` NAME READYTOUSE SOURCEPVC SOURCESNAPSHOTCONTENT RESTORESIZE SNAPSHOTCLASS SNAPSHOTCONTENT CREATIONTIME AGE snapshot-pvc-1 true vast-pvc-1 0 vastdata-snapshot snapcontent-8b1627cc-d50a-4bdb-a1b4-67931d36eb85 50m 49m ``` ## Restore Volume from Snapshot To restore a PVC from an existing snapshot, attach the snapshot to another PVC. You can choose to provide read-only or read/write access to the restored volume using `accessModes` options in the YAML configuration file: - If attached in read-only mode (`ReadOnlyMany`), the restored volume is mounted to the snapshot's source folder (`<snapshot path>/.snapshot/<snapshot name>`). It does not have a view or a quota on the VAST cluster, not can it be expanded through Kubernetes volume expansion. - If attached in read/write mode (`ReadWriteMany`), a view and a quota is created automatically for it on the VAST cluster, and the restored volume is mounted to the view's directory. The restored volume can be expanded like any other regular volume. To restore a volume: 1. Create a YAML configuration file to attach the snapshot to a PVC. In the file (see the example below for correct indentation and line breaks when specifying the keywords): For example: ``` apiVersion: v1 kind: PersistentVolumeClaim metadata: name: pvc-restore spec: storageClassName: vastdata-filesystem dataSource: name: snapshot-pvc-1 kind: VolumeSnapshot apiGroup: snapshot.storage.k8s.io accessModes: - ReadWriteMany resources: requests: storage: 1Gi ``` - In `metadata`: - `name` is the Persistent Volume Claim (PVC) name for the volume that will contain the restored data. - In `spec`: - `storageClassName` is the name of the storage class used for the PVC. - In `dataSource`: - `name` is the PVC name of the volume that stores the snapshot. - In `accessModes`, specify the access mode for the restored volume: - `ReadWriteMany` for read/write - `ReadOnlyMany` for read-only 2. Deploy the YAML configuration file: ``` kubectl apply -f vast-csi-deployment.yaml ``` The output is similar to the following: ``` persistentvolumeclaim/pvc-restore created ``` 3. Verify that the restored PVC can be displayed: ``` kubectl get pvc ``` The output is similar to the following: ``` NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE pvc-restore Bound pvc-c212dc9e-1b72-49da-8a58-8c1ceb97b9e3 1Gi RO vastdata-filesystem 7s ``` ## Clone Volume or Snapshot With VAST CSI Driver, you can create an instantly writable clone of either a Kubernetes snapshot or another Kubernetes volume. When cloning a volume, a temporary snapshot is created behind the scenes. This transient snapshot is invisible to Kubernetes, and is eventually deleted by VAST CSI Driver once the clone operation is complete. As with regular volumes, VAST CSI Driver automatically creates a view and a quota for the resulting clone volume on the VAST cluster. The clone is mounted to the underlying directory of the view and can be used for read and write operations. It can also be expanded through Kubernetes volume expansion. > **Note:** Cloning is done using *Global Snapshot Clones*, a feature of VAST Cluster 4.6.0 and later. Cloning is not available when using VAST CSI Driver with VAST Cluster 4.5 or earlier. Requirements and limitations include: - VAST Cluster 4.6.0 or later is required. - Cloning cannot be used if VAST Catalog is enabled on the VAST cluster. - Cloning to another VAST cluster is not supported. To clone a volume from its snapshot: 1. Create a YAML configuration file for cloning and specify the following required parameters (see the example below for correct indentation and line breaks when specifying the keywords): For example: ``` apiVersion: v1 kind: PersistentVolumeClaim metadata: name: pvc-clone spec: storageClassName: vastdata-filesystem dataSource: name: snapshot-pvc-1 kind: VolumeSnapshot apiGroup: snapshot.storage.k8s.io accessModes: - ReadWriteMany resources: requests: storage: 1Gi ``` - In `metadata`: - `name` is the Persistent Volume Claim (PVC) name for the clone. - In `spec`: - `storageClassName` is the name of the storage class used for the PVC. - In `dataSource`: - `name` is the PVC name of the volume that stores the snapshot from which cloning is done. 2. Deploy the YAML configuration file: ``` kubectl apply -f vast-csi-deployment.yaml ``` The output is similar to the following: ``` persistentvolumeclaim/pvc-clone created ``` 3. Verify that the clone can be displayed: ``` kubectl get pvc ``` The output is similar to the following: ``` NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE pvc-clone Bound pvc-c212dc9e-1b72-49da-8a58-8c1ceb97b9e3 1Gi RWX vastdata-filesystem 7s ```