Snapshot of FlashArray PVC
PX-CSI supports snapshot and restore functionality for FlashArray Direct Access volumes. This page describes how to create on-demand snapshots, restore volumes from those snapshots, and delete snapshots when they are no longer needed. Snapshots are useful for point-in-time rollback.
FlashArray file services do not support snapshots.
Take a Snapshot
Snapshots enable you to quickly restore data to a specific point in time, reducing downtime and preventing data loss.
-
Create a VolumeSnapshotClass:
Define aVolumeSnapshotClass
with thedriver
field set topxd.portworx.com
. This class specifies the storage provider for managing snapshots. For example:kind: VolumeSnapshotClass
apiVersion: snapshot.storage.k8s.io/v1
metadata:
name: px-fa-direct-access-snapshotclass
annotations:
snapshot.storage.kubernetes.io: "true"
driver: pxd.portworx.com
deletionPolicy: Delete -
Create a VolumeSnapshot:
Define aVolumeSnapshot
that links to theVolumeSnapshotClass
and the source PVC. This configuration captures the current state of the PVC. For example:kind: VolumeSnapshot
apiVersion: snapshot.storage.k8s.io/v1
metadata:
name: volumesnapshot-of-pure-claim-block
spec:
volumeSnapshotClassName: px-fa-direct-access-snapshotclass
source:
persistentVolumeClaimName: pure-claim-block -
Confirm the snapshot:
Apply the snapshot configuration and verify its creation using the following command:kubectl get volumesnapshot
Alternatively, check the array UI under Volume Snapshots, where snapshots are managed like other Pure snapshots.
note- If the snapshot does not appear with the
kubectl get volumesnapshot
command, retrieve the full CRD path using:Then run the command with the full path, for example:kubectl get crd
kubectl get volumesnapshots.snapshot.storage.k8s.io
- Snapshots of unattached volumes will be empty and unattachable. To create an attachable snapshot with a filesystem, attach and detach the volume before taking the snapshot.
- If the snapshot does not appear with the
Restore a Snapshot
Restoring a snapshot allows you to create a new PVC from a snapshot, which can be useful for recovering data or creating test environments.
-
Define a new PersistentVolumeClaim:
Create aPersistentVolumeClaim
specification that setsdataSource.kind
toVolumeSnapshot
anddataSource.name
to the snapshot name. This ensures the new PVC is restored from the specified snapshot. For example:kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc-restore
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi # Must match the original PVC size
storageClassName: sc-portworx-fa-direct-access
dataSource:
kind: VolumeSnapshot
name: volumesnapshot-of-pure-claim-block
apiGroup: snapshot.storage.k8s.io -
Confirm the restored PVC:
Apply thePersistentVolumeClaim
configuration and verify its creation using the following command:kubectl get pvc <pvc-name> -n <pvc-namespace>
Alternatively, check the FlashArray UI under volume Details, where the source of the new volume will be listed as the snapshot’s original PVC.