Back up Virtual Machines
You can create file-system consistent backups of your KubeVirt virtual machines, including pre- and post-execution rules, snapshot class mapping, and manual or scheduled backup options.
If you want your VM backups to be static-IP safe, then see Static-IP safe VM restore.
Create a VM backup
To create a backup of your VM:
-
Log in to Portworx Backup web console.
-
From the home page, click the Clusters icon in the left navigation pane.
-
Click the application cluster that contains the VM to be backed up.
-
Click the Applications tab and then go to the VM tab.
The VM table displays the NO OF PVCS and TOTAL VOLUME SIZE for each VM. TOTAL VOLUME SIZE is the requested (provisioned) capacity of the VM's PVCs, not the amount of data written to them, so it does not indicate the size of the backup. You can click either column header to sort the VMs by PVC count or by total volume size. For more information on these columns, see Applications.
-
Select the VM(s) to be backed up and then click Backup.
noteYou can select only an entire VM for backup; individual resources within a VM cannot be selected. Portworx Backup backs up the VM along with its disks (PVCs), resource configuration, and network configuration.
-
In the Create Backup window, populate the following values:
For more information on these fields, see Create manual backup and Create scheduled backup topics.
-
Enter name for Backup: the name of the backup you want to be displayed in the Portworx Backup web console
-
Backup location: the S3 bucket or NFS backup location you want to store your backups onto
-
Cross Cloud Backup/Restore: this toggle is always disabled for VM backups, because Portworx Backup does not support cross-cloud backups and restores for VMs.
-
Snapshot Class Mapping: lists the CSI provisioners of the volumes attached to the selected VMs. Map each provisioner to the volume snapshot class (VSC) that Portworx Backup must use to take CSI snapshots:
-
Non-Portworx CSI provisioners: select a volume snapshot class from the Volume snapshot class drop-down.
-
Portworx provisioner (
pxd.portworx.com): no mapping is required. The Volume snapshot class field displays No snapshot class found. -
Offload CSI snapshots to backup location: this checkbox is selected by default.
- Selected: offloads the CSI snapshots to the selected S3-based or NFS backup location, so that you can restore the VM to another cluster.
- Cleared: retains the CSI snapshots only as local snapshots on the application cluster. Local snapshots do not protect against cluster-level failures and cannot be restored to another cluster.
This option does not apply to Portworx volumes. For non-Portworx CSI provisioners that are not mapped to a volume snapshot class, keep this option selected; otherwise, the backup fails.
-
-
Backup Type: use the On a schedule toggle to choose between a manual and a scheduled backup:
- Disabled: creates a manual backup immediately
- Enabled: displays the Choose a Schedule Policy field, so that backups are created at the times defined by the schedule policy you choose
-
Choose a Schedule Policy: select the schedule policy for the scheduled backup. After you choose a schedule policy, the following options are displayed:
-
Include future vms in selected namespaces: adds future VMs that will be created or added to the selected Namespaces of the scheduled backup
-
Allow parallel backup: select this option to enable Portworx Backup to trigger a new scheduled backup even when the previous scheduled backup is still in progress (uploading snapshots to the cloud). See Parallel backup schedules for more information.
-
-
File-system consistent backup
-
Enabled: applies pre-defined/system-defined or built-in rules for file system consistent backups (all data on the file system is in a stable and recoverable state at the time the backup is taken). Make sure that
qemu-guest-agentis installed on the VMs before you enable this option. For more information, see Prerequisites. -
Disabled: creates crash-consistent backups, (a point-in-time copy of data that reflects the disk state after an unexpected shutdown). You can set custom rules or user-defined pre-exec/post-exec rules upon disabling File-system consistent backup option.
-
Pre-exec rule: choose the custom pre-exec rule from the drop-down
-
Post-exec rule: choose the custom post-exec rule from the drop-down
-
note- Custom rules are not recommended for VM backups because they are applied globally (at backup level), once before all volume backups start and once after they complete, rather than on a per-VM basis. These rules are intended to ensure file system consistency across volumes. To achieve more efficient and consistent backups at the VM level, built-in (freeze/unfreeze) rules are specifically designed for per-VM execution. Therefore, using custom rules for VM backups is not recommended.
- If original backup was taken with File-system consistent backup option enabled, the user can choose to disable it during a Retry. However, if this option was disabled initially, then the Retry will not present this option.
-
-
Backup Labels: apply the label(s) in
key=valueorkey:valueformat to your backup to filter the required backups when needed at a later point in time -
LIST OF VM(s): lists out the VMs you have selected for this backup
-
-
Click Create to create a VM backup with selected VMs.
Portworx Backup creates a backup of your entire VM. To view the backup you just created, navigate to the Backups > VM tab from your application cluster page.