[Solved] Cannot Merge AVHD Chain in Hyper-V
In Hyper-V virtual machine, .vhd(x) and .avhd(x) files are associated with each other. When you want to free up your disk space, it turns out that you cannot merge avhd in Hyper-V. So how to solve this issue? Please continue to read this article.
Why cannot merge automatic vhd chain
Automatic virtual hard disk is the Hyper-V differencing disk which stores the checkpoints of virtual machines in the .avhd(x) file format. When you create a checkpoint, you will create an automatic vhd associated with the parent disk. All of Hyper-V checkpoints are connected with each other and combined in the form of a chain, so they should be merged in a specific order: from the newest to the oldest ones.
When you cannot merge avhd chain, you can check whether the virtual machine lacks disk space, the parent disk has been damaged, or the order is incorrect.
So the idea to solve the problem is basically: check that all the caveats are followed, and then merge Hyper-V avhd files manually in the correct way.
5 things you must know before merging Hyper-V avhd
Here are some rules you should know to ensure the merge can work. If you cannot merget automatic vhd chain properly, check if any of the following points have been violated:
1. Don’t delete Hyper-V checkpoints directly from the computer.
2. Do not delete checkpoints in the middle of the avhd chain since avhd is tightly associated with the parent disk. Hyper-V will automatically merge the AVHD file into its parent disk in the tree structure. If one of the intermediate disks is damaged, it will lead to its child disks unusable.
3. Power off the virtual machine before merging .avhd files. If the checkpoint is deleted while the VM is running, this AVHD file continues to save all operations of virtual machine. Then when the VM is powered off, Hyper-V will start merging files, which may cause data loss or the disk to be unable to boot again.
4. Do not expand the virtual hard disk with checkpoints in the virtual machine since it will leave checkpoints unusable.
5. Do not use checkpoints as backups and delete checkpoints regularly. An deep AVHD chain reduce the speed of reading data, take up a lot of disk space, and degrade virtual machine performance.
How to fix Hyper-V merge failed in progress - merge manually
If the Hyper-V merge in progress failed, you may not do it right. The thing is, if you have numerous AVHD files, you need to merge them in a specific order: from child to parent. You need to figure out the checkpoint structure, then manually merge .avhd files according to its order.
Here I will show you how to do it correctly step by step.
Part 1. Establish the structure of the checkpoint tree in Hyper-V Manager
1. Open Hyper-V Manager. Select the virtual machine whose checkpoints you want to be merged.
2. In Action pane, select Inspect Disk to establish the structure of the checkpoint tree.
3. In the open window, select the .avhd(x) file and open it.
4. Then you will see the disk information including its type, name, location, size and the parent’s name. Record the parent disk name.
5. If you have multiple checkpoints, please repeat steps 4 for each .avhd(x) file.
Part 2. Merge Hyper-V AVHD manually and correctly
After the above opertion, you are ready to get down to business. Here's how to manually merge avhd:
1. In Hyper-V Manager. Select Edit Disk in the right pane.
2. In Before You Begin section, click Next.
3. In Locate Disk section, select Browse to locate the newest .avhd file in the chain.
3. In Choose Action section, select Merge that will merge the changes stored in the differencing disk into its parent disk or another disk.
4. Configure disk by selecting To the parent virtual hard disk.
5. Click Finish to close this wizard. Then repeat the process until you have only the original parent disk.
6. When you complete all steps, reboot the virtual machine.
Merging multiple avhd files improves the performance of Hyper-V virtual machine. Checkpoints should not be kept for too long, so if you want to protect VM data, you should use backup methods instead of checkpoints.
Note: Hyper-V checkpoints cannot replace backup
Multiple automatic virtual hard disks impact the I/O and occupy a lot of disk space, which causes poor performance of Hyper-V virtual machines. So you should not create so many checkpoints in your Hyper-V virtual machine. For better Hyper-V data protection, you can use a third-party tool or built-in features to backup Hyper-V VM.
Here, I will use a free Hyper-V backup software - AOMEI Cyber Backup to automate Hyper-V VM protection. It offers flexible backup strategies to protect business from security threats and supports VM backups on Hyper-V host (2012 and above). With this professional backup tool, you can benefit from these features for free.
Perpetual Free: no time limit for AOMEI Cyber Backup Free Edition.
Easy to use: With its intuitive interface, you can easily create powerful backup tasks without installing agents.
Schedule VM Backup: Run Hyper-V backups automatically to reduce human errors and simply VM management through central console.
Fast Disaster Recovery: Based on clicks, you can restore a Hyper-V VM from a backup file quickly to its previous status, without complicated reinstallation or configuration.
Low Time and Cost: Perform hot backup automatically and offers incremental backups, thus minimizing operation disruption and saving storage.
Role-Assignment: allow one administrator to create sub-accounts with limited privilege, effectively reduce administration cost and manual errors.
Please hit the button below to download and use AOMEI Cyber Backup for free:
*You can choose to install this VM backup software on either Windows or Linux system.
Steps to backup Hyper-V virtual machines for free:
1. Bind your device instead of installing an agent on virtual machine. Enter the basic information and add Hyper-V device.
2. Click Backup Task >> Create New Task to schedule Hyper-V backup tasks.
3. Enter Task Name, and select Hyper-V Backup. Then select virtual machines you want to backup.
◆ Specify a Backup Target such as network or local place. It’s better to use 3-2-1 backup rule and store the VM backups in different locations.
◆ Schedule Hyper-V backup using full/incremental backup and set the time and frequency as daily/weekly/monthly.
4. Click Start Backup to perform the auto Hyper-V backup for multiple virtual machines.
✍ While the Free Edition covers most of the VM backup needs, you can also upgrade to Premium Edition to enjoy:
✦ Batch VM backup: batch backup large numbers of VMs managed by vCenter Server or on standalone ESXi hosts.
✦ Backup Cleanup: Configure retention policy to auto delete the old backup files and save storage space.
✦ Restore to new location: Easily make a clone of a virtual machine in the same or another datastore/host, without reinstalling or configuring a new VM.
What to do when you cannot merge the automatic vhd chain? In this article, we discussed how to fix the issue of Hyper-V merging failed in progress, and introduce how to manually merge avhd in Hyper-V virtual machines. But please remember, checkpoints or snapshots cannot replace backup. For VMware and Hyper-V VM, backup is always a better option for long-term data protection.