Skip to main content
Version: 3.2

Virtual Machine backups

Applicable to Classic mode only

note

VM backup (KubeVirt) is not supported in Federated mode for this release.

Portworx Backup enables you to back up and restore KubeVirt Virtual Machines (VMs) running on Kubernetes clusters in an enterprise environment. You can also protect VMs running on OpenShift Virtualization, including VMs that were migrated to KubeVirt or OpenShift Virtualization from VMware environments. Portworx Backup backs up and restores these VMs; it does not perform the migration from VMware. Portworx Backup detects these VMs to provide end-to-end data protection for VMs, VM disks, resource configuration, and network configuration data.

KubeVirt is a Virtual Machine management add-on that provides a unified platform for VM workloads in the Kubernetes environment and allows VMs to run in parallel with containers on Kubernetes, OpenShift, and other environments. With KubeVirt, you can run VM workloads and Kubernetes-native workloads without requiring additional management tools or dedicated pipelines.

Prerequisites​

Make sure that:

  • KubeVirt v1.0.0 or later and its dependent modules are installed on all managed Kubernetes clusters, both source and destination clusters.

  • qemu-guest-agent is installed on the VMs. This agent is required only for the freeze/thaw (pre-exec and post-exec) rules that produce file-system consistent backups. A VM without the agent can still be backed up and restored, but the backup is not file-system consistent.

  • Stork version 24.1.0 or later is installed on all application clusters. The per-VM partial success behavior for VM restores additionally requires Portworx Backup 3.2.0 or later and Stork 26.5.0 or later. For more information, see Partial Success in VM Restores.

  • To back up VMs that use data volumes in VolumeBlock (block) mode, the clusters run Portworx Enterprise 3.4.x or later.

  • For the Portworx product versions required for KubeVirt VM protection, see the Feature Support Matrix.

The following table lists the backup and restore workflows and the scenarios supported by Portworx Backup as part of this feature:

Resource typesSupport
ClustersBackup and restore on OCP, EKS, GKE, and Kubernetes Vanilla clusters
Backup locationsBackup and restore of VMs on S3 compliant object store and NFS backup locations
Cloud accountsAll the cloud accounts that Portworx Backup currently supports
Pre-exec and post-exec rulesFreeze/thaw (unfreeze) rules for file-system consistent backups
Backup typesManual and scheduled backups
Backups and restores
  • Data volumes with VolumeMode set to block and file system
  • Portworx Enterprise backed data volumes
  • Non-Portworx Enterprise backed data volumes that support CSI snapshots
  • Cross-region backups and restores
  • note
    • VM volume backups are snapshot-based. For non-PXE volumes, map a snapshot class using Snapshot Class Mapping during backup. For more information, see Create a VM Backup.
    • Cross-cloud (KDMP driver) backup and restore is not supported for VM backups. The Cross-cloud Backup/Restore toggle is disabled for VM backups, so the KDMP/generic method, which performs a file-system-level copy (offload) instead of a snapshot, is not used for VM volumes.

    Backup and restore workflows supported by Portworx Backup for VM resources are outlined in the following table:

    VM resourcesSupport
    PVCs (CSI-based and non-CSI based)

    Yes

    • Volumes backed by Portworx Enterprise (PXE) are backed up using Portworx snapshots.
    • Non-PXE volumes must be provisioned by a CSI driver that supports CSI snapshots, which are offloaded to the backup location.
    • Block mode (VolumeMode: Block) requires Portworx Enterprise.
    Hotplug volumesYes
    (Supports hotplug volumes with persist enabled)
    Kubernetes secrets (used as startup scripts, networkDataSecretRef)Supported with manual selection
    (These resources are not selected automatically; you must select them during backup creation)
    NetworkAttachmentDefinitionYes
    Network PolicyNo
    Service object
    Data volumes (DV)No
    (Supports backup and restores of PVCs associated with data volumes only)
    Data volume template (serves as a template to create data volume for a VM)No
    (Supports backup and restores of PVCs associated with data volume templates only)
  • VirtualMachineInstancetype (namespaced)
  • VirtualMachinePreference (namespaced)
  • Yes
  • VirtualMachineClusterInstancetype (cluster-scoped)
  • VirtualMachineClusterPreference (cluster-scoped)
  • No
    (Cluster-scoped objects are outside the namespace scope of a VM backup. Ensure they exist on the destination cluster before you restore.)
  • VirtualMachineInstancePreset
  • Virtual Machine Templates
  • No
    note
    • Portworx Backup automatically selects the supported VM resources for backup, except as noted in the table above. Resources that are not part of the VirtualMachine configuration, such as NetworkPolicy and Service objects, are not backed up (see the No entries in the table). Because these resources are not backed up or restored, recreate them on the destination cluster after the restore. Otherwise, the restored VM might be unreachable if a required Service or NetworkPolicy is missing.
    • Cluster-scoped VirtualMachineClusterInstancetype and VirtualMachineClusterPreference objects are not backed up. If a restored VM references one of these objects and it does not exist on the destination cluster, the VM might fail to start. Ensure that any required cluster-scoped instance types or preferences exist on the destination cluster before you restore.

    The following steps use the Portworx Backup web console. You can also perform these operations through the Portworx Backup CLI, the REST or gRPC API, or the Ansible collection.

    To back up and restore your KubeVirt VMs (or namespaces that contain your VMs):

    1. Log in to the Portworx Backup web console.

    2. From the home page, add a cloud account.

    3. Configure a backup location.

    4. Add the required type of cluster.

    5. Create pre-exec and post-exec backup rules, or use the built-in (default) rules available in Portworx Backup. To create pre-exec and post-exec backup rules for file-system backups, see Backup Rules for file-system consistent backups.

    6. Create a VM backup.

    7. Restore a VM backup. For how multi-VM restores report per-VM outcomes, see Partial Success in VM Restores.

    note
    • Portworx Backup creates backups of VMs regardless of their state. By default, VMs restored from backup return to a running state, even if the VM was stopped during backup creation. To prevent a restored VM from starting automatically, use the Skip virtual machine restart after restore option during restore.
    • If you restore a VM to a cluster where the original VM still exists, or restore the same backup more than once, you can create duplicate VM workloads and IP or MAC address conflicts. To control MAC address handling and preserve static IPs during restore, see Preserve Static IP and MAC address for VM Backup and Restore.
    In this topic: