Skip to main content
Version: 25.8

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.

note

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.

  1. Create a VolumeSnapshotClass:
    Define a VolumeSnapshotClass with the driver field set to pxd.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
  2. Create a VolumeSnapshot:
    Define a VolumeSnapshot that links to the VolumeSnapshotClass 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
  3. 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:
      kubectl get crd
      Then run the command with the full path, for example:
      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.

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.

  1. Define a new PersistentVolumeClaim:
    Create a PersistentVolumeClaim specification that sets dataSource.kind to VolumeSnapshot and dataSource.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
  2. Confirm the restored PVC:
    Apply the PersistentVolumeClaim 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.