Consolidating Hyper-V Differencing Disks into One
I deleted two snapshots from a Hyper-V virtual machine (VM) this morning. This left the base .vhd file and two .avhd differencing disks. I decided I wanted to merge them into a single file and learned that the diskpart tool will let you do this.
- Open an elevated command prompt (i.e. run as administrator).
- Run diskpart.
- Enter: select vdisk file="<full path to the latest differencing disk>"
- A differencing disk ends in either .avhd or .avhdx.
- Enter: merge vdisk depth=n
- n will be the number of parent files you want to merge. Since I had two parents, one .vhd and one .avhd for this .avhd file, I used depth=2.
Happy merging!
Rob
Comments
- Anonymous
February 04, 2015
Hi Rob, Thank you so much for this tip ! I have replaced my HyperV 2008 host with a HyperV 2012 ... and no way to run the client management tool and merge my VHDs. I have saved many hours of work. Thanks again