Friday 30 May 2008

Compressing Hyper-V disk images (.vhd files)

How to compress Hyper-V disk images (.vhd files) >

1) Go to Server Manager.

2) Shutdown the Virtual Machine in Hyper-V Manager.

3) Select the VM and click Settings in the right hand pane.


4) Click the hard drive and select 'Edit'.


5) Select 'Compact' (default action) and click 'finish'.


2 comments:

John Jennings said...

I have a SQL server running in Hyper-V R2 that has a data VHD that was WAY overallocated when it was made, and now I want to reclaim some of that space.

Is performing the VHD safe to do on a drive that is home to SQL DBs?

r5d4 said...

Obviously the SQL Service needs to be shut down first, but yes I've done it as I've over-allocated myself in the past too.

Obviously make sure you back up first.

The compression does take some time, and you will want to take a look at this post to maximise the space you reclaim, and keep everything tidy...

Hyper-V Size Optimization

r