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.
- On FlashArray, deleting a volume also deletes its associated snapshots by default. This applies whether the volume is deleted directly on the array or by deleting a PersistentVolumeClaim (PVC) in Kubernetes with the reclaim policy set to
delete. - Starting in PX-CSI version 25.8.1, you can prevent this behavior by setting the
parameters.typefield toclonein theVolumeSnapshotClass. Whentypeis set toclone, each snapshot is preserved as a new volume on FlashArray, preventing its deletion when the original PVC is removed.
Take a Snapshot
PX-CSI supports two types of snapshots for PVCs on FlashArray:
- Single PVC snapshot: Captures the state of one PVC at a specific point in time. Use this snapshot type for individual volume backups or to create test environments from a specific volume.
- Group snapshot: Creates a crash-consistent snapshot of multiple PVCs in a single operation, backed by a FlashArray protection group snapshot. Use this snapshot type for applications that span multiple PVCs, such as a database with separate data and log volumes, when you require consistency across all volumes at the same point in time.
Single PVC snapshot
-
Create a VolumeSnapshotClass:
Define aVolumeSnapshotClasswith thedriverfield set topxd.portworx.com. This class specifies the storage provider for managing snapshots. For example:kind: VolumeSnapshotClassapiVersion: snapshot.storage.k8s.io/v1metadata:name: px-fa-direct-access-snapshotclassannotations:snapshot.storage.kubernetes.io: "true"driver: pxd.portworx.comdeletionPolicy: Deleteparameters:# type: "clone" # Set this parameter to "clone" to preserve each snapshot as a new volume on FlashArray. This prevents snapshots from being deleted when the source volume is deleted. -
Create a VolumeSnapshot:
Define aVolumeSnapshotthat links to theVolumeSnapshotClassand the source PVC. This configuration captures the current state of the PVC. For example:kind: VolumeSnapshotapiVersion: snapshot.storage.k8s.io/v1metadata:name: volumesnapshot-of-pure-claim-blockspec:volumeSnapshotClassName: px-fa-direct-access-snapshotclasssource:persistentVolumeClaimName: pure-claim-block -
Confirm the snapshot:
Apply the snapshot configuration and verify its creation using the following command:kubectl get volumesnapshotAlternatively, 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 volumesnapshotcommand, retrieve the full CRD path using:Then run the command with the full path, for example:kubectl get crdkubectl 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
Group snapshot
VolumeGroupSnapshot support requires:
- PX-CSI version 26.2.0 or later
- Kubernetes version 1.34 or later
- Purity version 6.4.10 or later
- All PVCs in the group to be provisioned on the same FlashArray.
-
Add labels to the PVCs that you want to include in the group. All PVCs must use the same label. For example:
kubectl label pvc <pvc-name-1> app=<my-app> -n <namespace>kubectl label pvc <pvc-name-2> app=<my-app> -n <namespace> -
Create a
VolumeGroupSnapshotClassthat uses thepxd.portworx.comdriver:apiVersion: groupsnapshot.storage.k8s.io/v1beta2kind: VolumeGroupSnapshotClassmetadata:name: pure-vgs-classdriver: pxd.portworx.comdeletionPolicy: Delete -
Create a
VolumeGroupSnapshotthat selects PVCs by label:apiVersion: groupsnapshot.storage.k8s.io/v1beta2kind: VolumeGroupSnapshotmetadata:name: my-app-group-snapnamespace: <namespace>spec:volumeGroupSnapshotClassName: pure-vgs-classsource:selector:matchLabels:app: <my-app> -
Verify the group snapshot and the individual member snapshots:
kubectl get volumegroupsnapshot -n <namespace>kubectl get volumesnapshot -n <namespace>On the FlashArray, PX-CSI creates or reuses a protection group for the member volumes and creates a protection group snapshot. Kubernetes also creates an individual
VolumeSnapshotobject for each PVC in the group, which you can restore by using the standard restore workflow.
Cross-array snapshot
A cross-array snapshot transfers a FlashArray block volume snapshot asynchronously to a different FlashArray in the same PX-CSI fleet. Use this type to create off-array copies of volumes for disaster recovery or data mobility across arrays.
Cross-array snapshots require:
- Portworx Operator 26.4.0 or later and PX-CSI 26.3.0 or later.
- Both source and target FlashArrays registered in the same PX-CSI cluster configuration.
- Purity 6.6.1 or later running on both source and destination FlashArrays.
- A replication network path exists between the source and destination FlashArray replication ports.
- Array-to-array replication connectivity configured out of band (using
purearray connector the FlashArray management UI).
- Cross-array snapshots are not supported for FlashArray file services, realm-based volumes, or volumes in a stretched pod (ActiveCluster).
- Cross-array snapshots rely on the
isRemotefield in thePureSnapshotCRD spec, which marks a snapshot as having been transferred to a remote target array. PX-CSI uses this field to confirm that a snapshot is a remote snapshot. Ensure that the Portworx Operator has updated yourPureSnapshotCRD to include this field before using this feature. For more information, see PureSnapshot CRD reference.
The transfer is asynchronous: the VolumeSnapshot reports ReadyToUse: false while the transfer is in progress, then ReadyToUse: true when the snapshot has landed on the target array. PX-CSI emits Kubernetes Events on the VolumeSnapshot to report transfer progress.
You specify the target array using the portworx.io/target-array-id annotation on the VolumeSnapshot (per-snapshot) or as a parameters entry in the VolumeSnapshotClass (applies to all snapshots using that class). A VolumeSnapshot annotation takes precedence over the VolumeSnapshotClass parameter.
To find the target array ID, run px csi list backend or check the FlashArray management UI.
Use a VolumeSnapshot annotation
Use this method to set the target array for individual snapshots.
-
Create a
VolumeSnapshotClass:kind: VolumeSnapshotClassapiVersion: snapshot.storage.k8s.io/v1metadata:name: px-fa-snapshotclassdriver: pxd.portworx.comdeletionPolicy: Delete -
Create a
VolumeSnapshotwith theportworx.io/target-array-idannotation set to the target array ID:kind: VolumeSnapshotapiVersion: snapshot.storage.k8s.io/v1metadata:name: volumesnapshot-cross-arrayannotations:portworx.io/target-array-id: "<target-array-id>"spec:volumeSnapshotClassName: px-fa-snapshotclasssource:persistentVolumeClaimName: pure-claim-block -
Monitor the transfer:
kubectl describe volumesnapshot volumesnapshot-cross-array -n <namespace>The snapshot is ready when the status shows
ReadyToUse: true.
Use a VolumeSnapshotClass parameter
Use this method to set the same target array for all snapshots that reference a VolumeSnapshotClass.
-
Create a
VolumeSnapshotClasswith theportworx.io/target-array-idparameter:kind: VolumeSnapshotClassapiVersion: snapshot.storage.k8s.io/v1metadata:name: <px-fa-cross-array-snapshotclass>driver: pxd.portworx.comdeletionPolicy: Deleteparameters:portworx.io/target-array-id: "<target-array-id>" -
Create a
VolumeSnapshotthat references this class:kind: VolumeSnapshotapiVersion: snapshot.storage.k8s.io/v1metadata:name: volumesnapshot-cross-arrayspec:volumeSnapshotClassName: <px-fa-cross-array-snapshotclass>source:persistentVolumeClaimName: pure-claim-block -
Monitor the transfer:
kubectl describe volumesnapshot volumesnapshot-cross-array -n <namespace>The snapshot is ready when the status shows
ReadyToUse: true.
For the KubeVirt CDI use case of cloning a VM disk golden image across arrays, see Clone VM disks across FlashArrays using CDI.
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. This workflow applies to single PVC snapshots and to individual member snapshots within a group snapshot.
-
Define a new PersistentVolumeClaim:
Create aPersistentVolumeClaimspecification that setsdataSource.kindtoVolumeSnapshotanddataSource.nameto the snapshot name. This ensures the new PVC is restored from the specified snapshot. For example:kind: PersistentVolumeClaimapiVersion: v1metadata:name: pvc-restorespec:accessModes:- ReadWriteOnceresources:requests:storage: 20Gi # Must match the original PVC sizestorageClassName: sc-portworx-fa-direct-accessdataSource:kind: VolumeSnapshotname: volumesnapshot-of-pure-claim-blockapiGroup: snapshot.storage.k8s.io -
Confirm the restored PVC:
Apply thePersistentVolumeClaimconfiguration 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.
Delete a Snapshot
Single PVC snapshot
Delete the VolumeSnapshot object to remove the snapshot:
kubectl delete volumesnapshot <snapshot-name> -n <namespace>
Group snapshot
Delete the VolumeGroupSnapshot object to remove the group snapshot and all member snapshots from the FlashArray:
kubectl delete volumegroupsnapshot <group-snapshot-name> -n <namespace>
Individual snapshots that belong to a group cannot be deleted independently. You must delete the entire VolumeGroupSnapshot.
When a protection group no longer contains group snapshots, PX-CSI automatically removes the protection group from the FlashArray.