About Me

If life is all about change, motion and flow, I would be the one cruising past you on a SunDancer.

Friday, September 19, 2008

Compacting a Dynamic VHD image

One of the nicest features of using Dynamic VHDs on Virtual Server 2005 is that they grow as needed, so system administrators can optimize the disk space usage between several VMs. Dynamic VHDs grow automatically, but they don’t shrink automatically. In order to shrink them, you need to run several tools both inside and outside of the virtual machine.

In order to compact the VHD image to only use the xxx GB which it is actually using, we need to follow this procedure:

  • Defragment the VHD you are going to compact: You can do this from within the Virtual Machine.
  • Precompact the disk: Once the defragmentation is completed, you need to run Virtual Server’s Precompactor. you can do this by shutting down your virtual machine and mount the Precompact.iso on the virtual machine.

On VirtualServer admin screen go to configuration of the machine and under CD/DVD change the Capture to "Known image files" and select Precompact.iso. Click OK

  • Compress the disk: From the VS Admin screen menu, click Inspect and find your VHD and click Inspect.

Thats it, sit back and relax :-) after a couple of minutes(or hours) based on the VHD size, you would find that the VHD is compresses to use the same amount of space as seen from withing the virtual machine.

No comments: