Skip to main content

Microsoft Hyper-V

Using this Protected Item type will incur a per-guest Booster charge.

This Protected Item type backs up Microsoft Hyper-V virtual machines. Comet supports Hyper-V backups using three different modes. Latest VM state (Changed Block Tracking), Latest VM state (Standard) and All VM snapshots.

Backing up a Hyper-V virtual machine with Comet includes, but is not limited to:

  • its configuration file
  • all attached virtual drives
  • the contents of memory (if the machine was running)
  • the full tree of saved checkpoints

You can select individual virtual machines for backup, or choose "All virtual machines".

Latest VM state (Changed Block Tracking)​

The Latest VM state (Changed Block Tracking) option uses WMI/RCT as its underlying technology and is compatible with all versions of Hyper-V running on Windows Server 2016 or later and Windows 10 or later.

Comet integrates with the Hyper-V WMI/RCT writer to perform a backup of Hyper-V virtual machines using WMI mode with RCT acceleration. Comet requests a temporary new Hyper-V checkpoint of the current VM state. The VM's virtual hard disk is read from the checkpoint, constructing a single flat VHDX file into the Comet backup job snapshot. Comet will coordinate with the Hyper-V server to identify any changed sectors since the previous Comet backup job. If possible, disk sectors from a previous Comet backup job may be reused to minimize how much data is read from the Hyper-V server.

Latest VM state (Standard)​

The Latest VM state (Standard) option uses WMI/RCT as its underlying technology and is compatible with all versions of Hyper-V running on Windows Server 2016 or later and Windows 10 or later.

Comet integrates with the Hyper-V WMI/RCT writer to perform a backup of Hyper-V virtual machines using WMI mode. Comet requests a temporary new Hyper-V checkpoint of the current VM state. The VM's virtual hard disk is read from the checkpoint, constructing a single flat VHDX file into the Comet backup job snapshot.

All VM snapshots​

The All VM snapshots option uses VSS as its underlying technology and is compatible with all versions of Hyper-V running on Windows Server, including Windows Server 2022 (the latest version at the time of writing).

This backup type is only applicable when running on Windows Server. Hyper-V on Windows Desktop is not supported when using the All VM snapshots option.

Comet integrates with the Hyper-V VSS writer to perform a Hyper-V backup snapshot, including support for in-VM quiescence on supported guest operating systems. Comet requests a temporary point-in-time snapshot of all the VM's files using a VSS snapshot. All the files for current running VM state (VHDX), as well as any existing Hyper-V checkpoints (AVHDX), are included in the Comet backup job snapshot.

Consistency and guest additions​

The following information applies to all products that perform Hyper-V backup.

When backing up a guest VM, it is important to get a consistent state of the VM. There are some different ways this happens.

If the guest OS has all necessary Hyper-V integration services installed, then the host can request for the guest VM to take a VSS snapshot. The snapshot is then exposed to Hyper-V on the host for Comet to back up. It shouldn't interrupt the guest OS. The VM backup is application-consistent. This is known as a "Production checkpoint".

If the host OS is running Server 2012 R2 or newer, but there are no integration services inside the guest OS, then Hyper-V will take a checkpoint of the VM; Comet will back up the checkpoint; and then the checkpoint will be removed. This kind of checkpoint does not interrupt the guest OS. The VM backup is crash-consistent. This is known as a "Standard checkpoint".

  • You can also achieve this behavior by disabling "Production checkpoints" in the Hyper-V settings for the VM.

If the host OS is older than Server 2012 R2, and there are no integration services inside the guest OS, then the VM will be paused; Windows will take a VSS snapshot of Hyper-V's files in paused state; the VM will be resumed and Comet will back up from the VSS snapshot. It would cause a short interruption to the guest OS. The VM backup is crash-consistent.

  • You can also achieve this behavior by disabling checkpoints in the Hyper-V settings for the VM.

Replica VM​

The following information applies to all products that perform Hyper-V backup.

If you are using Hyper-V replication, you can back up your virtual machines from either the primary or replica host.

A backup taken on the primary VM host is application-consistent (if possible), by quiescing a VSS snapshot inside the VM guest; or crash-consistent otherwise. A backup taken on the secondary VM host is only ever crash-consistent, because the replica VM is not running in order for guest integration services to take a VSS snapshot.

Current versions of Hyper-V do not allow backing up a VM that is currently replicating. If a VM is found to be currently replicating at the time of backup, Comet will retry the operation a few times. If you repeatedly see errors of the form The virtual machine '...' cannot start a backup operation because it is currently executing a conflicting operation. Try the backup again., and you are running backups from the replica VM host, you could consider

  • scheduling the backup job to run at a time when it is more likely that the VM replication is up-to-date; or
  • using Before / After commands in Comet to temporarily stop VM replication while the backup job is running.

For more information about backing up a replica VM, see https://techcommunity.microsoft.com/t5/virtualization/backup-of-a-replica-vm/ba-p/382208

Pass-through disks​

The following information applies to all products that perform Hyper-V backup.

Hyper-V supports passthrough disks, to attach a physical disk from the host directly into the guest VM. This unmounts it from the host OS.

Hyper-V itself does not support backing up passthrough disks (nor does it support replicating them). A Hyper-V backup of the guest machines can be taken from the host, but does not include any data from passthrough disks.

You can work around this issue by either

  • installing Comet Backup inside the guest VM, and backing up the extra data at a file level (this will use an extra Device license); or
  • changing your passthrough disks to be a real disk containing a large .vhd or .vhdx file. The "New Virtual Disk Wizard" in Hyper-V Manager has an option to convert an existing disk to a .vhd or .vhdx file.

For more information about backing up passthrough disks in Hyper-V, see https://techcommunity.microsoft.com/t5/virtualization/working-around-the-pass-through-limitations-of-the-hyper-v-vss/ba-p/381537

Restore​

The following options are available when restoring from Hyper-V backup jobs:

  • Restore directly into Hyper-V on the local machine
    • Restore virtual machines from the backup job into Hyper-V.
    • When selecting this option, new VMs will be created in the hypervisor, preserving the VM settings (including CPU cores and memory size) from the original backup job.
  • Files and Folders
    • Restore any selected virtual machines in their Hyper-V file formats.
    • Select this option if you intend to re-import into Hyper-V, or to restore the virtual hard disk files alone.
    • If the backup job used the "All VM Snapshots" option:
      • If your selected virtual machine was using Hyper-V checkpoints, these are preserved.
      • The restored files are preserved the way Hyper-V had originally stored them, which may be either dynamic- or thick- provisioned.
    • If the backup job used the "Latest VM State" option:
      • If your selected virtual machine was using Hyper-V checkpoints, these are not preserved.
      • The virtual disk files will be restored as thick-provisioned disks, expanded to their maximum disk size.
  • Granular restore
    • Use this option to extract individual files from the guest VM's disk.
    • If the backup job used the "All VM Snapshots" option, both the base VHDX and any AVHDX layers are available for granular, individual file restore.
    • See the linked document for details on specific filesystem support.
  • File format conversion restore
    • Restore VHDX files and automatically convert them to VMDK for import into VMware ESXi
  • Cross-hypervisor restore
    • Restore the backed-up Hyper-V VMs directly into VMware ESXi, or into Proxmox
    • When selecting this option, new VMs will be created in the hypervisor, preserving the VM settings (including CPU cores and memory size) from the original backup job.
  • Other special formats
    • Restore as compressed archive (zip / tar / tar.gz)
    • Simulate restore only (test restore)
    • Program Input (stream data to program stdin)

Importing a running VM into an incompatible hypervisor​

When using the "Import Virtual Machine" wizard in the Hyper-V manager application, you can import the running state of a virtual machine. If you are restoring a VM to a different hypervisor that has a sufficiently different CPU, the VM may fail to resume on its previous running state (vmrs / RAM snapshot) because of an incompatible CPU.

To resolve this issue, either (A) use the 'Power off' option to shut down the imported VM, instead of the 'Shut down' option; or (B) re-import the VM from its saved disk files without including the RAM running state.

Hyper-V Backup Configuration Video Tutorial​