How to merge Hyper-V checkpoints

Table of Contents

Case #

You need to expand the virtual disk size of a Hyper-V virtual machine (VM) but you are not allowed to proceed, even when the VM is shut down, because there are Hyper-V checkpoints.

You first check the user-generated checkpoints and realize that there are no user-generated checkpoints available.

You therefore need to merge the system generated Hyper-V checkpoints, in order to be able to expand the virtual disk size.

In cases where you have a Microsoft or third party backup tool, the backup tool will normally make use of the Hyper-V checkpoint mechanism when taking backups. Generally, the backup tool requests Hyper-V to create a checkpoint for the virtual machine as part of the VM backup process. After the backup tool completes the backup, it sends a backup complete notice, and then Hyper-V merges the checkpoint back into the primary .vhdx file and deletes the .avhdx file. If this does not happen for some reason, you end up with a broken chain of checkpoints which have not been automatically merged.

This how-to article provides step-by-step guidance on how to merge Hyper-V checkpoints by using the Hyper-V graphical management console. You can carry out the same task also by using Powershell.

Solution #

Important Notes

  1. Always ensure that you have full backups of your Hyper-V virtual machines before proceeding with any Hyper-V checkpoint merge operations. Alternatively, you can export your VM in Hyper-V Manager console, to ensure that you have a recoverable copy of the VM in case of a disaster. If the merge procedure is not performed correctly, data loss may occur. Proceed at your own risk! – Review the following article to see a description of the risk of data loss and what to do to protect against this scenario:
  2. If you are running a third party backup solution, your backup solution may be controlling the automatic creation of Hyper-V checkpoints in the background. In this case, you need to consult the backup solution documentation first. The following articles provide further guidance on this:

Carry out the following steps to manually merge Hyper-V checkpoints.

First check in the VM settings to document the Hyper-V checkpoint storage path, as shown in the example below.

Snapshot files for Hyper-V virtual machines are stored in the .avhd(x) file format in the same folder as a parent hard disk image file. Hyper-V snapshots are differencing virtual disks and they have a parent-child relationship with the corresponding parent virtual hard disk. A maximum of 50 snapshots are permitted for each virtual machine. The Hyper-V snapshots are organized in a hierarchical order.

The first thing you need to do is created a hierarchy structure of all .avhd(x) files to map each avhdx file to its immediate parent disk, until you reach the top vhd(x) disk.

To merge Hyper-V snapshots, do the following:

  • Open Hyper-V Manager.
  • Select the required VM.
  • Click Edit Disk. The Edit Virtual Hard Disk Wizard will open. Click Next.
  • Click Browse to select the most recent .avhdx file. Click Next.
  • Select Merge to merge the changes stored in a differencing disk into the parent disk. Click Next. Select To the parent virtual hard disk and click Finish.
  • The merge process shall be carried out.
  • To complete the merge process for all checkpoints, repeat the above steps for each .avhd(x) file until all of the changes have been successfully merged into the top-level parent disk.
  • You can now power on the VM and verify operations.

References #

Powered by BetterDocs