Hyper-V, Hyper-V v2, Scripting, Server 2008 R2, Virtualization
Leave a comment

Shell Extensions for VHD files – Updated

I just made another release of VHDShellExt.vbs on MSDN Code Gallery. In this new release, I mostly concentrated on some error checking around the input boxes and added “Merge VHD” feature. Also, enabled all the shell extensions for AVHD files also. So, after you update this release, you will have to run setup once again.

cscript.exe VHDShellExt.vbs /action:Setup

Once the setup is complete, you should see the below context menu on every right-click on a VHD or a AVHD file.

menu 

Word of caution
AVHD files are the snapshot files. You should manually merge snapshots in to a VHD file only when it is extremely necessary. The manual merge of snapshots in to a VHD of a functional VM will cause the VM to fail. This is because the references to VM snapshots are still left in the XML files while a manual merge option deletes the AVHD files after a merge. If you are trying to merge the snapshots of a functional VM, it is recommended that you select “No” when prompted to merge in to the immediate parent and create a new VHD.

image

For any functional VM, deleting snapshots from Hyper-V MMC is the best method to merge snapshots in to the VM’s VHD file.

Filed under: Hyper-V, Hyper-V v2, Scripting, Server 2008 R2, Virtualization

by

Ravikanth is a principal engineer and the lead architect for Microsoft and VMware virtualized and hybrid cloud solutions within the Infrastructure Solutions Group at Dell EMC. He is a multi-year recipient of Microsoft Most Valuable Professional (MVP) award in Windows PowerShell (CDM) and Microsoft Azure. Ravikanth is the author of Windows PowerShell Desired State Configuration Revealed (Apress) and leads Bangalore PowerShell and Bangalore IT Pro user groups. He can be seen speaking regularly at local user group events and conferences in India and abroad.