Backup CSI snapshots
Using Portworx Backup, you can offload your application-aware CSI snapshots, created by Portworx Backup, to any S3 compliant storage or public cloud. This helps to:
- backup any container-native persistent storage
- keep copies of your backup data on multiple storage locations
- recover data from an offsite copy in the event of a storage failure
- maintain compliance by the backup recovery teams
This topic explains how you can back up CSI snapshots and offload them to a backup location:
Backup CSI snapshots
To back up your namespace that contains a CSI-based PVC:
Ensure that the namespace that contains the CSI-based PVC is available in the Portworx Backup cluster Applications page.
From the Portworx Backup cluster navigate to Applications page, select the namespace to back up, and then select the Backup button.
In the Create Backup window, enter the backup name and select the backup location as mentioned in the Create a backup topic.
From the CSI Snapshot Class drop-down list box, select the existing snapshot class that will be used to trigger a CSI snapshot of the PVC
noteIf you select the Default option, then Stork chooses the default snapshot class configured in the cluster.
Click Create.
noteIf you are using Portworx PVCs, instead of the CSI snapshots, Portworx Backup uses Portworx cloudsnapsfor backups.
Portworx Backup takes a local CSI snapshot of a PVC using the provided snapshot class. This CSI snapshot is stored in the same storage system where the PVC resides.
Since Portworx Backup stores this local snapshot locally, and does not upload to any external backup location, the size of the backup data appears as provided by the corresponding CSI driver in the Backups page:
Offload CSI snapshots to back up location
This section explains how you can back up your CSI snapshots both in the local storage system and offload it to the selected backup location (for example, to an external AWS S3 object storage):
In the Create Backup window -> CSI Snapshot Class drop-down list box, select the snapshot class and then select the Offload csi snapshots to backup location check box.
Click Create.
Portworx Backup backs up your CSI snapshot and stores the most recent version of it in the local storage system. You can easily restore this most recent copy from the local storage anytime. Additionally, a copy of the snapshot is also uploaded to the external object storage you selected from the Backup location drop-down list box.
On restore, if the latest backup is chosen and the cluster has access to the local snapshot, then the PVC will be restored from this local snapshot. If the local snapshot is not available, then the PVC will be restored from the backup stored in the backup location.
Since the backup data is uploaded to the specified backup location, Portworx Backup displays the corresponding snapshot data size in the Backups page:
noteIf CSI snapshot backups of PVCs fail with snapshot timeout error (
snapshot timeout out after 5m0s
), then navigate to thekdmp-config
configmap and modify the default value ofSNAPSHOT_TIMEOUT
key to the required value based on your configuration as shown below:SNAPSHOT_TIMEOUT: "<desired-timeout-value>"
For example, update the key to
SNAPSHOT_TIMEOUT: "30m"
to set the timeout value to 30 minutes.noteWhen you request a PVC backup actively in use by an application pod where the storage provider supports native snapshot, then Portworx Backup does not access the volume over a hostpath. Such backups do not run within a privileged container.