Space shuttles aren't built for rocket scientists, they're built for astronauts. The goal isn't the ship, its the moon.
posts - 293, comments - 169, trackbacks - 33

My Links



Post Categories

Published Works

Merging Differencing Disks with Hyper-V

A differencing disk is a disk that is a child of a parent disk. Differencing disks are very helpful in keeping disk images small, manageable and consistent, because you can create a base parent disk- such as a Windows 2008 Standard base image- and use it as the foundation for all other guest virtual machines and disks that will be based on Windows Server 2008. For example, I have a Windows Server 2008 guest that I use exclusively as sandbox for development. I am in the process of building out another guest based on Windows Server 2008 that will be for some TFS 2008 demos that I am working on for an upcoming series of talks. Rather than copy the Windows Server 2008 guest VPC over and over again, I can simply create one differencing disk for my development environment role and one for my TFS role. The result is a VHD that represents the intersection of the base/parent disk (in this case, a barebones install of Windows Server 2008 Standard) and any additional software I've installed or configuration changes I have made. This not only conserves disk space, but also saves me a lot of time in copying hefty giga-some-odd vhds around.

Sometimes it is necessary to merge a differencing disk back to it's parent or into a new disk. For example, you may be moving VHDs around as I did recently to a new, high speed E-SATA drive. My old drive hosted a vhd that I used as my development sandbox that used a parent on the old disk. I certainly don't want to depend on my clunky old USB 2.0 drive for the parent (the IO cost alone would be just silly), and at a minimum, there is state on the differenced guest OS that I do not want to lose. 

The first thing to do is copy over the parent VHD, create a new differencing disk based on the same parent, but in the new location.

Next, since the differenced guest VHD has state that you want to move over (lest you lose it), it is necessary to merge the state of the "old" differenced guest VHD with the new copy. To do so, under Server Manager, in the Hyper-V Manager, click "Edit Disk", and locate the disk that you want to merge into a new differenced disk:


On the next screen, under Action, select "Merge":


Select "To a new virtual disk", and choose a name and path for the new disk that you created in the initial copy:


The "old" differenced disk, which is based on the original parent disk plus state from the "old" differenced disk is merged into the new disk on the drive you specified:


That's all there is to it. Differencing is a powerful feature in virtualization, and there is very nice support for migration of differenced disks right within the Server Manager.

Print | posted on Friday, August 15, 2008 11:26 PM | Filed Under [ Hardware Misc. ]



# re: Merging Differencing Disks with Hyper-V

Nice work, it was really helpful for me
1/6/2010 4:34 AM | Ashraf Mostafa

# re: Merging Differencing Disks with Hyper-V

Been looking all over for a tool to do this and couldn't find one... Now I know why it was out of the box functionality. Thanks for the Great Blog Post. -Phoenix, AZ
6/7/2011 6:19 PM | Peter J. Smith
Comments have been closed on this topic.

Powered by: