I’ve recently had a requirement to merge some child differencing disks, with the associated VHD/VHDX in Hyper-V.
Thankfully this is very straight forward and can be done one of two ways(after a confirmed backup and/or export of your VM!):
1.) Using the edit disk option in Hyper-V:
2.) Using DiskPart from a command prompt.
select vidsk file=”C:\Temp\MT12-SC-H2-LON-AP1\Virtual Hard Disks\MT12-SC-H2-LON-AP1.vhd”
merge vdisk depth=1
Remember in either option, you will need to go back into your VHD location in the Hyper-V VM settings and change the path to point to the base disk.
Note: If you go with Option 2, you will need to manually remove the child differencing disk from your VHD storage location.
Recently when running a get-vmswitch PowerShell command on a Hyper-V host I noticed that the content came back blank. Even though I was a local admin on the host, I still needed to run my PowerShell session as an Administrator. Doh! If you notice you are not getting results, might pay to give it a go. 🙂