Archive | October 2014

Merging a Hyper-V child VHD/VHDX differencing disks with the parent VHD/VHDX.

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:
diff-disk2
diff-disk3
2.) Using DiskPart from a command prompt.
Enter Diskpart.
select vidsk file=”C:\Temp\MT12-SC-H2-LON-AP1\Virtual Hard Disks\MT12-SC-H2-LON-AP1.vhd
merge vdisk depth=1
diff-disk
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.

Powershell: get-vmswitch, get-vm, etc. blank

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. 🙂
get-vmswitchblank