Recovering a Hyper-V virtual disk (with its snapshots)


My work at Microsoft involves using lots of Virtual Machines and snapshotting their states along the way. Every now and then the physical host machine needs to be reimaged, and not always the virtual machines have been exported (to be imported back, if needed).

So here is a way to recover from this potential catastrophe:

For simplicity, let’s say that you have a original virtual disk and two snapshot disks:

·         Let’s say the original disk is called baseDisk.vhd

·         The first snapshot (snapshot1.avhd)

·         The second snapshot (snapshot2.avhd)

Now follow this process:

1.     Rename snapshot2.avhd to snapshot2.vhd

2.     In Hyper-V Manager, merge snapshot2.vhd into snapshot1.avhd using the “Edit Disk“ function

3.     After completion, rename snapshot1.avhd to snapshot1.vhd

4.     Merge snapshot1.vhd into baseDisk.vhd

5.     Now the based VHD (baseDisk.vhd) is updated with all changes.

If there are more snapshots, just do step 1 and 2 for all previous snapshot file, starting with the last snapshot file created (the one with the most recent date of creation).

One important thing: after a successful merge, the snapshot file which has been merged will be deleted without prior notice! So if you want to be on the safe side, back it up before!

The principle behind the snapshots is that each snapshot (child) just knows about the preceding snapshot or base VHD (parent). You can verify that by using the “Inspect Disk” function.

Please, do note that this process is very, very time consuming. 🙂

Now you just need to create a new Virtual Machine and use the originalDisk.vhd as its virtual disk.

I hope it helps!

For more, see:

Comments (1)

  1. Alex Miroshnichenko says:


    This is an interesting post – on one hand it shows how to simplify the VM image management in a test&dev environment – but it also shows the inherent limitations of the standard VHD infrastructure.

    I recommend that you look at and try out our Virsto One product. We support native high performance virtual disk presented as VHDs, you can take instant unlimited snapshots and instantly roll back to any point in the past. In addition our VHD are always thinly provisioned AND  have much higher performance  than regular fixed VHDs so you''l be bale to complete your tasks faster.

    Please feel contact me alex at virsto dot com .