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.
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 withreclaimPolicy
set toRetain
. 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
- On-demand snapshots
- Policy-based scheduled snapshots
Follow the steps below to create a snapshot on demand using the Kubernetes VolumeSnapshot
API.
-
Create a
VolumeSnapshotClass
to define how snapshots are handled in your cluster. For FlashBlade Direct Access, set the driver topxd.portworx.com
and specify a deletion policy such asDelete
orRetain
, depending on your snapshot lifecycle requirements. For more information aboutdeletionPolicy
, refer to DeletionPolicy.apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: <px-csi-fbda-class>
driver: pxd.portworx.com
deletionPolicy: Delete -
Create a
VolumeSnapshot
to capture the state of yourPersistentVolumeClaim
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> -
Verify snapshot creation:
kubectl get volumesnapshot <px-csi-fbda-snapshot>
kubectl describe volumesnapshot <px-csi-fbda-snapshot>
PX-CSI supports integration with FlashBlade snapshot policies to automate snapshot creation and retention. In this method, scheduling and cleanup are handled entirely by FlashBlade, not Kubernetes.
A FlashBlade snapshot policy defines when snapshots are taken and how long they are retained.
PX-CSI links the PersistentVolumeClaim (PVC) filesystem to an existing FlashBlade policy, allowing FlashBlade to manage snapshots on a schedule.
Using a VolumeSnapshotClass
with a FlashBlade policy attaches the policy only to the filesystem. It does not apply to Kubernetes-native volume snapshots created through VolumeSnapshot
objects.
- Snapshots are created and retained by FlashBlade according to the policy rules.
- These snapshots aren't represented as Kubernetes
VolumeSnapshot
objects. - During restore, PX-CSI queries FlashBlade for the latest snapshot created by the policy and performs an in-place restore.
- PX-CSI does not create, track, or delete individual scheduled snapshots.
Follow the steps below to create policy-based snapshots:
-
Create a FlashBlade snapshot policy:
- In the FlashBlade dashboard, go to Settings → Policies → Snapshot Policies.
- Select Create Policy.
- Define a name, schedule (e.g., hourly/daily), and retention period.
- Select Save.
-
Create a
VolumeSnapshotClass
to define how snapshots are handled in your cluster. For FlashBlade Direct Access, set the driver topxd.portworx.com
and specify a deletion policy such asDelete
orRetain
, depending on your snapshot lifecycle requirements. For more information aboutdeletionPolicy
, refer to DeletionPolicy.apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: <px-csi-fbda-class>
driver: pxd.portworx.com
deletionPolicy: Delete
parameters:
policy_name: "<fb-snapshot-policy>" -
Create a
VolumeSnapshot
to capture the state of yourPersistentVolumeClaim
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> -
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:
-
Get the PersistentVolume bound to your PVC:
kubectl get pvc <your-pvc-name> -o jsonpath='{.spec.volumeName}'
-
Update the reclaim policy to
Retain
(skip if already set):kubectl patch pv <pv-name> -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'
-
Scale down the Deployment that uses the PVC.
-
Delete the original PVC:
kubectl delete pvc <your-pvc-name>
-
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 -
Verify the PVC is recreated:
kubectl get pvc <your-pvc-name>
kubectl describe pvc <your-pvc-name> -
(Optional) Inspect the restored volume:
kubectl get pv <persistent-volume> -o yaml
-
Scale up the Deployment.
Delete a snapshot
To delete a snapshot (regardless of method):
-
Delete the
VolumeSnapshot
object:kubectl delete volumesnapshot <px-csi-fbda-snapshot>
-
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
isRetain
. - PX-CSI does not track or display scheduled snapshots as Kubernetes resources.