jueves, 26 de enero de 2012

How to manually merge Hyper-V snapshots into a single VHD

Author: BrianEh
url: http://itproctology.blogspot.com/2008/06/how-to-manually-merge-hyper-v-snapshots.html
Okay, so you have to recreate your VM configuration and you absolutely know that your VM had a snapshot at some time.

You also realize that if you just link to the base VHD that you will lose the current state of your VM - what do you do?



You manually merge your snapshots into your base VHD before you boot your VM. (I am assuming that you know how to connect to an existing VHD using the new VM wizard).
Merging of snapshots can be performed manually. This is achieved by:

On your Hyper-V host.
1. Power off the Virtual Machine.
2. Make a copy of the VHD and its corresponding AVHD files.
3. Rename the AVHD extension to VHD.
4. Write down the order of the disks from youngest to oldest (the oldest should be the root VHD). You can do this by looking at the last modified time stamp on the origional AVHD files, find the one that last changed. And find the last one that changed before it.
5. In the Hyper-V manager, open the Edit Disk wizardBrowse to the youngest VHD in the chain, then choose 'reconnect' to point to the next youngest (the one that came before).
6. Open the Edit Disk wizard a second time and merge.
7. Then repeat the process until you have only a single VHD.

In a disaster case, you need to recover a copy of the root VHD prior to attaching it to a new VM and booting it (the act of booting it, modifies it)

Usually the most difficult part of this process is finding the last AVHD (differencing disk) in the chain.

BADBOY wrote:
My experience

On my case
1. Deleted first snapshot on tree.

2. The VM dissapear after shutdown.

3. After reading you post, i've actually started a new VM pointing to Virtual Hard Disk .vhd. It won't boot. I've used a Win 7 Boot CD and checked that the exchange DB was 2 months ago.

4. Found your post.

5. Copied .avhd files and vhd with subsequent dates to External USB

6. On server: I've renamed avhd looking for date stamp order:
file4.vhd (vhd disk)
file3.vhd
file2.vhd
file1.vhd (youngest)

7. Run Disk Editor selected file1.vhd and reconnect to file2 (i've renamed all files so i've to browse to find file2.vhd)

8. Run Disk Editor again selected file1.vhd and select Combine. File1.vhd dissapeared

9. Run again the two steps 7 and 8 with file3.vhd with the file2.vhd and the file3.vhd with the original file4.vhd

10. Boot the VM, reconnect NICs, assigned old ip address, etc.

No hay comentarios:

Publicar un comentario