AVHD Files HyperV

alexbryant75

Weaksauce
Joined
Dec 28, 2007
Messages
91
Can someone please educate me on AVHD files and how to force them to rollup into the main VHD file within HyperV?
I have a VM that is running using a AVHD file and cannot seem to get it to rollup into the main VHD file by just shutting the VM down and giving it time to do the process as Microsoft Recommended.

Thanks In Advance!
 
Did you delete the snapshot then shut down the VM? If so, you should see a Merging process indicator in Hyper-V Manager. Once that completes, the AVHD is merged and gone.
 
I did not delete the snapshot.

So are you saying that I need to do the following:

1. Delete the snapshot
2. Shut Down the VM
3. Observe Merging Process
 
Correct. If you're running Hyper-V 2012 or newer, then you don't need to shut down the VM, the AVHD will merge while the VM is running. Shutting down the VM is necessary for Hyper-V 2008 and 2008 R2.
 
I want to make sure that this is the same process if my VM is currently using the AVHD to run currently.
 
Yes. If your VM is currently running on a snapshot you'll need to delete the snapshot and, if you're on Hyper-V 2008 or 2008 R2, shut down the VM for the snapshot to merge. In Hyper-V 2012 or newer, shutting down the VM isn't necessary, the merge will happen live. Once the merge is complete, the snapshot will be gone and you can no longer rollback to when that snapshot was taken. Snapshots should not be kept around more than 24 hours since they grow over time and hurt performance.

If the VM has no snapshots, the other possibility is your VM is running on a differencing disk rather than a fixed or dynamic VHD. This means the VM's hard drive is a snapshot of a different VM's or parent VHD. This is generally a big no-no except in special cases. Take a look at your VM's properties, then click "Inspect" on the disk to see if the hard disk type is differencing disk.
 
Also it's not recommended to have many snapshots. It can be very messy if something goes wrong. Been there done that :p
I now don't use snapshots in production at all.
Also if regular deleting of snapshot somehow will not work you can manually merge it through editing of avhd that you want to merge from hyper-v manager.
 
Back
Top