Create a CSI backup
Portworx Backup has deprecated the support for cloud native drivers from version 2.7.0 and above to streamline the backup creation process involving multiple drivers. Portworx Backup internally uses either CSI driver or KDMP driver or both to create backups and offers more flexibility to the users in backup creation process.
Using Portworx Backup, you can offload your application-aware CSI snapshots to any object store (S3 and others) or NFS based backup locations. 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
To create a CSI backup (with or without the local snapshot being offloaded to the backup location) of your namespace with local snapshot:
-
Login to Portworx Backup web console.
-
From the home page, click on the Clusters icon from the left navigation pane.
- Choose the application cluster that contains the namespace to be backed up:
- Navigate to Applications tab.
-
Select the namespace(s) you want to back up. You can create a namespace or VM backup in this page.
-
For a namespace backup, you will see the following options:
-
Search by namespace name: this search field allows you to filter the namespaces by their names
-
All resources: this drop-down allows you to select the required resources or all the resources along with a search option to traverse the list with the resource name. After selection of resources, you can select individual resources of a resource group by navigating to Vertical ellipsis > Select Resources (gets enabled after you select one or more resources) under Resources column provided at the end of each namespace in the Portworx Backup web console.
notePortworx Backup web console displays selected resource count under RESOURCES column.
-
-
Add namespace label: allows you to add labels for the namespaces to search them with the applied labels at later point in time
-
Add resource label: allows you to add labels for the resources to search them with the applied labels at later point in time
-
NAME: allows you to back up all namespaces in the current page you are in
notePortworx Backup allows you to select multiple namespaces of a cluster from different pages and then back up the chosen namespaces in a single click.
-
For a VM backup, you will see the following options:
-
Search by VM name: allows you to search the VM by its name
-
Filter by namespace: allows you to filter the VM by the namespace where the VM resides. In addition, it also provides Select All option to select all the namespaces where the VMs that you want to back up reside
-
Add namespace label: takes the search string you provide in this field, displays the VM's with specified namespace labels and includes them in the Backup. In addition, includes future VM's created with these namespace labels if a Backup Schedule is associated while creating a backup.
-
-
-
Click Backup. (For the sake of brevity, let us assume that we are creating a namespace backup here)
-
In the Create Backup window, specify the following:
-
Enter name for Backup: provide a relevant name for your backup
-
Backup location: choose the backup location (object store or NFS) from the drop-down where you want to store your backups.
noteBackup location drop-down displays only the successfully validated object store or NFS backup locations.
-
Cross Cloud Backup/Restore: this option is disabled by default, ensure this is disabled if you want to map your VSC with your storage provisioner
-
Snapshot Class Mapping: facilitates mapping of storage provisioner for Portworx and non-Portworx environments
If there are multiple snapshot classes in the cluster for the same provisioner, drop-down lists all the available volume snapshot classes.
noteIf you do not map CSI provisioner(s) with volume snapshot class, Portworx Backup internally detects the default VSC, creates a backup and offloads the CSI snapshots to the backup location specified in the Backup location.
Portworx Backup creates a backup utilizing different drivers with the options you have provided for CSI backup. For more information on the type of backup that gets triggered for different combination of CSI Provisioner and Volume snapshot class refer to Backup type matrix.
-
CSI Provisioner: Portworx or CSI-based (for non-Portworx environment) or provisioners associated with the applications are listed here. Provisioners can be:
- Portworx: creates a Portworx cloud snapshot regardless of Offload CSI snapshots to backup location option is selected or not
- Non-Portworx (CSI-based): creates CSI snapshot if Offload CSI snapshots to backup location is not selected
- Non-Portworx (CSI-based): creates CSI snapshot and KDMP backup if Offload CSI snapshots to backup location is selected
noteWhen you select a namespace to back up, Portworx Backup auto-detects all the provisioners associated with the applications installed on that namespace and lists them here.
-
Volume snapshot class: lists all the volume snapshot class (VSC) resources. Portworx Backup's default VSC gets selected if no value is selected here and there exists only one default VSC per provisioner. If there are multiple snapshot classes in the cluster for the same provisioner, drop-down lists all the available volume snapshot classes.
This field can have the following values:
- Disabled: for Portworx provisioner
For non-Portworx provisioner:
-
No VSC available (disabled): if no VSC is available
-
Default VSC (auto-populated): if default VSC is available
-
Non-default single VSC (auto-populated): if only one VSC is available
-
Non-default multiple VSCs': if multiple VSCs' are available
For more information, refer to Backup type matrix.
In VMware vSphere environment (OCP or non-OCP) with CSI driver, by default, you can only take three snapshots for vSphere volumes. To take snapshot of the fourth volume you need to delete any one of the existing snapshots out of the 3. If you have to override this default behavior, you need to update
global-max-snapshots-per-block-volume
configuration parameter. Refer the following topics to update the parameter:-
For OCP clusters, refer to Changing the maximum number of snapshots for vSphere.
-
For non-OCP clusters, refer to Configure Maximum Number of Snapshots per Volume.
notePortworx Backup supports only one-to-one mapping of CSI provisioner with volume snapshot class.
-
Offload CSI snapshots to backup location: this option is enabled by default to secure your backups.
- Selected: offloads the CSI snapshot to the backup location, uses both CSI driver and KDMP driver in this case
- Deselected: does not offload the snapshots to your backup location, only uses CSI driver and not KDMP driver
For more information on types of backup supported by Portworx Backup, refer to Backup types by driver.
-
-
Backup type: allows you to choose the type of backup required (manual or scheduled backup)
-
On a schedule: Can create manual or scheduled backup
-
Enabled: creates a manual backup immediately after you click Create
-
Disabled: displays Choose a Schedule Policy option
-
For more information, refer to Scheduled Backup.
-
-
Choose a Schedule Policy: associate a schedule policy with your backup to automate the process of backup creation. Portworx Backup supports hourly, weekly, and monthly scheduled backup runs or allows you to create the backup at the specified time.
-
Pre-exec rule: select a rule from the drop-drown to execute before the backup is created
-
Post-exec rule: select a post rule you want to execute after the backup is created
-
Backup Labels: any labels that you want to add to the backup you are going to create for quick search when required
-
NAMESPACES LIST: Lists all the namespaces selected for backup creation
-
-
Click Create.
Portworx Backup creates a CSI backup with snapshot class mapping options you have provided for the backup.
Object store (S3 and others) and NFS-based backup target supports generic, manual, and scheduled backups.
If CSI snapshot backups of PVCs fail with snapshot timeout error (snapshot timeout out after 5m0s), then navigate to the kdmp-config configmap and modify the default value of SNAPSHOT_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.