Deckhouse Virtualization Platform (DVP) supports volume snapshot creation for CSI drivers in a Kubernetes cluster.

Snapshots capture the state of a volume at a specific point in time and can be used for data recovery or volume cloning. The ability to create snapshots depends on the capabilities of the CSI driver in use.

Supported CSI drivers

The following CSI drivers support snapshot creation:

Creating snapshots

Before creating snapshots, make sure that VolumeSnapshotClass resources are configured in the cluster. You can list available classes with the following command:

d8 k get volumesnapshotclasses.snapshot.storage.k8s.io

To create a snapshot for a volume, specify the required VolumeSnapshotClass in the manifest:

apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
  name: example-snapshot
spec:
  volumeSnapshotClassName: <class-name>
  source:
    persistentVolumeClaimName: <pvc-name>

Restoring from a snapshot

To restore data from a snapshot, create a PVC that references the existing VolumeSnapshot:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: restored-pvc
spec:
  dataSource:
    name: example-snapshot
    kind: VolumeSnapshot
    apiGroup: snapshot.storage.k8s.io
  storageClassName: <storage-class-name>
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi

Not all CSI drivers support restoring volumes from snapshots. Ensure that your driver provides the required capabilities.