Backup CSI snapshots
Using PX-Backup, you can offload your application-aware CSI snapshots, created by PX-Backup, to any S3 compliant storage or public cloud. This helps to:
- backup any container-native persistent storage
- keep copies of your back up 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 backup CSI snapshots and offload them to a backup location:
Backup CSI snapshots
To backup your namespace that contains a CSI-based PVC:
Ensure that the namespace that contains the CSI-based PVC is available in the PX-Backup cluster Applications page..
From the PX-Backup cluster -> Applications page, select the namespace to backup, 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 PVCNote: If you select the Default option, then Stork chooses the default snapshot class configured in the cluster.
PX-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 PX-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 backup location
This section explains how you can backup 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.
PX-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 BackupLocation.
Since the backup data is uploaded to the specified backup location, PX-Backup displays the corresponding snapshot data size in the Backups page:
NOTE: When you request a PVC backup actively in use by an application pod where the storage provider supports native snapshot, then PX-Backup will not access the volume over a hostpath. Such backups do not run within a privileged container.