Skip to main content
Version: 25.8

Snapshot of FlashBlade PVC

PX-CSI supports snapshot and restore functionality for FlashBlade Direct Access volumes. This page explains how to create on-demand snapshots or use FlashBlade snapshot policies for scheduled snapshots, and how to restore or delete them.

Snapshots on FlashBlade are metadata-based restore points within the same filesystem. When restored, the existing filesystem is overwritten in place.

note

FlashBlade supports restoring only from the most recent snapshot. To restore from an earlier snapshot, you must first delete all newer snapshots.

Prerequisites

Before you begin, ensure the following:

  • FlashBlade API version 2.15 or later (Purity 4.5 or later).
  • Policy-based snapshots are supported in PX-CSI version 25.8.0 or later.
  • A PersistentVolumeClaim (PVC) backed by a FlashBlade storage class with reclaimPolicy set to Retain. See Reclaim policy. For example:
    Kind: Storageclass
    apiVersion: storage.k8s.io/v1
    metadata:
    name: px-fb-direct-access-nfsv4-retain
    provisioner: pxd.portworx.com
    parameters:
    backend: "pure_file"
    pure_export_rules: "*(rw)"
    mountOptions:
    - nfsvers=4.1
    volumeBindingMode: WaitForFirstConsumer
    allowVolumeExpansion: true
    reclaimPolicy: Retain

Create a snapshot

Follow the steps below to create a snapshot on demand using the Kubernetes VolumeSnapshot API.

  1. Create a VolumeSnapshotClass to define how snapshots are handled in your cluster. For FlashBlade Direct Access, set the driver to pxd.portworx.com and specify a deletion policy such as Delete or Retain, depending on your snapshot lifecycle requirements. For more information about deletionPolicy, refer to DeletionPolicy.

    apiVersion: snapshot.storage.k8s.io/v1
    kind: VolumeSnapshotClass
    metadata:
    name: <px-csi-fbda-class>
    driver: pxd.portworx.com
    deletionPolicy: Delete
  2. Create a VolumeSnapshot to capture the state of your PersistentVolumeClaim using the class defined above:

    apiVersion: snapshot.storage.k8s.io/v1
    kind: VolumeSnapshot
    metadata:
    name: <px-csi-fbda-snapshot>
    namespace: <your-pvc-namespace> # Must match the PVC's namespace
    spec:
    volumeSnapshotClassName: px-csi-fbda-class
    source:
    persistentVolumeClaimName: <your-pvc-name>
  3. Verify snapshot creation:

    kubectl get volumesnapshot <px-csi-fbda-snapshot>
    kubectl describe volumesnapshot <px-csi-fbda-snapshot>

Restore from a snapshot

FlashBlade supports only in-place restoration.

To restore from the latest snapshot:

  1. Get the PersistentVolume bound to your PVC:

    kubectl get pvc <your-pvc-name> -o jsonpath='{.spec.volumeName}'
  2. Update the reclaim policy to Retain (skip if already set):

    kubectl patch pv <pv-name> -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'
  3. Scale down the Deployment that uses the PVC.

  4. Delete the original PVC:

    kubectl delete pvc <your-pvc-name>
  5. Recreate the PVC from the snapshot:

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
    name: <your-pvc-name>
    spec:
    storageClassName: px-fb-direct-access-nfsv4-retain
    dataSource:
    name: <px-csi-fbda-snapshot>
    kind: VolumeSnapshot
    apiGroup: snapshot.storage.k8s.io
    accessModes:
    - ReadWriteOnce
    resources:
    requests:
    storage: 5Gi # Must match the original PVC size
  6. Verify the PVC is recreated:

    kubectl get pvc <your-pvc-name>
    kubectl describe pvc <your-pvc-name>
  7. (Optional) Inspect the restored volume:

    kubectl get pv <persistent-volume> -o yaml
  8. Scale up the Deployment.


Delete a snapshot

To delete a snapshot (regardless of method):

  1. Delete the VolumeSnapshot object:

    kubectl delete volumesnapshot <px-csi-fbda-snapshot>
  2. Verify deletion:

    kubectl get volumesnapshot <px-csi-fbda-snapshot>

If deletionPolicy: Retain is set, you must manually delete the corresponding snapshot on FlashBlade. For policy-based snapshots, the persistent volume claim (PVC) won’t be detached from the policy, and snapshots will continue at the specified interval.

Limitations

  • Only the latest snapshot can be restored.
  • Up to 64 snapshots per volume.
  • No automatic retention/expiry cleanup.
  • The original PVC must be deleted before restore (if reclaim policy is Retain).
  • Manual cleanup is required if deletionPolicy is Retain.
  • PX-CSI does not track or display scheduled snapshots as Kubernetes resources.