Home > Storage > Data Storage Essentials > Storage Automation Software > Persistent Storage for Containerized Applications on Kubernetes with PowerMax SAN Storage > Volume Snapshot and Volume Snapshot Content
There is a direct analogy with the PersistentVolume resources and a Volume Snapshot in Kubernetes. The VolumeSnapshot is like a PVC. It is a request for a PVC mapped to the Snapshot on the array. The VolumeSnapshotContent is similar to the PV, which means it maps to the physical snapshot on the array side.
Here is an example of a request for snapshot creation:
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
name: pvol0-snap1
spec:
volumeSnapshotClassName: powermax-snapclass
source:
persistentVolumeClaimName: pvol0
Here is created snapshot output from kubectl get volumesnapshot:
Name: snapcontent-3646c777-4c45-4d33-8848-c376fc4f6542
Namespace:
Labels: <none>
Annotations: <none>
API Version: snapshot.storage.k8s.io/v1
Kind: VolumeSnapshotContent
Metadata:
Creation Timestamp: 2022-06-07T14:06:34Z
Finalizers:
snapshot.storage.kubernetes.io/volumesnapshotcontent-bound-protection
Generation: 1
Resource Version: 33980575
UID: 90c51e85-3459-46ec-984a-a3354906b11c
Spec:
Deletion Policy: Delete
Driver: csi-powermax.dellemc.com
Source:
Volume Handle: csi-rke-rke-281d46f7fa-default-000297600448-00B8B
Volume Snapshot Class Name: powermax-snapclass
Volume Snapshot Ref:
API Version: snapshot.storage.k8s.io/v1
Kind: VolumeSnapshot
Name: pvolx0-snap1
Namespace: default
Resource Version: 33980542
UID: 3646c777-4c45-4d33-8848-c376fc4f6542
Status:
Creation Time: 1654610798003964597
Ready To Use: true
Restore Size: 0
Snapshot Handle: csi-rke-rke-3646c7774c-000297600448-00B8B
In Dell Unisphere for PowerMax, the storage group view is the best place to see a volume and its snapshots. Note that the prefix of the VolumeSnapshotContent is the suffix of the snapshot name in Unisphere. You can also get the same name from status.snapshotHandle.
This example shows how to create a PVC from a snapshot:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: restorepvc
spec:
storageClassName: powermax
dataSource:
name: pvol0-snap1
kind: VolumeSnapshot
apiGroup: snapshot.storage.k8s.io
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
VolumeSnapshot is a namespace resource, so it cannot be restored in another namespace. You can restore a snapshot in a different namespace, if required, by using a tool such as PowerProtect Data Manager.
Note: Kubernetes Snapshots provide a snapshot copy of a volume only and not the memory of the running container. When you need to restore your data, you must restore the snapshot to a new PVC and reattach your workload (StatefulSet or else) to the newly created PV and restart the workload. You cannot overwrite the original PV with the snapshot.
Note: When you delete a PV that still has snapshots; the LUN is not removed from the array but renamed with the postfix -DS. After the related snapshots are deleted, the CSI driver deletes the LUN permanently.