Wednesday, May 21, 2014

How To Convert a 16MB block size PVS VHD to a 2MB PVS VHD file using Hyper-V

If you've created a 16MB block size VHD file using Citrix PVS you've probably experienced that these disks are a touch more difficult to manage than the 2MB ones.  With 16MB block size VHD's you cannot mount them in Windows natively, compact them, and manipulate them with regular VHD tools.  The only tool that I've been able to manipulate them with is PVS, specifically CVHDMOUNT.EXE.  This allows you to mount the VHD file as a hard disk, but even so you cannot manipulate the disk with lots of tools; the disk isn't recognized at all.  This includes tools like Disk2VHD that you would think would make it easy to make it into a VHD.  Not so.

In order to convert from a 16MB block size PVS VHD you need to do the following steps:

1) Mount the VHD file using CVHDMount.exe (you may need to install the Provisioning Server role on it to get the CVHDMount.exe tools)

2) Go into Disk Management and set your disk to "Offline"

3) Open Hyper-V, right-click your server and go "New > Hard Disk..."

4) Choose the location and filename to save it.

5) Choose to copy from the PHYSICALDISK that corresponds to your VHD you mounted.

6) Click Finish.   And now you're done!  :)

1 comment:

Tonny Andersson said...

Thank you. Helped me out big time!