I'm going to leave out tons of related info that I hope isn't relevant to keep this lean - feel free to ask for detail.

My host is a Windows Server 2008 Standard SP2 (not R2). Last February we had created a snapshot on a virtual machine and then deleted it. About a month later we created another snapshot and deleted it as well. In the Hyper-V manager the virtual machine was not showing any Snapshots. We then deleted the Virtual Machine in preparation to move it to another host (not a good plan, but there you go).

After moving the vhd, we realized the machine was oddly out of date so we went back to the original host and discovered that the vhd had the February date from the first snapshot. We then found that a snapshot had evidently still been in play (although we're pretty sure it didn't show up in Hyper-V Manager).

So now we have the Feb vhd file and the current avhd file, but can't figure out how to get this virtual machine back up and running anywhere. We've found some articles that give approaches, but none of them seem to fit our circumstances and we've run into roadblocks with all of them.

So is there a correct path to recovery here?

link|improve this question
feedback

1 Answer

There is a way to manually merge the snapshots. Here's the process in a nutshell:

  1. Make a copy of the VHD and its corresponding AVHD files.
  2. Rename the AVHD extension to VHD.
  3. 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.
  4. In the Hyper-V manager, open the Edit Disk wizard. Browse to the youngest VHD in the chain, then choose 'reconnect' to point to the next youngest (the one that came before).
  5. Open the Edit Disk wizard a second time and merge.
  6. Then repeat the process until you have only a single VHD.

See the source article here for more information.

In the future, you should move VMs around by exporting them and importing them. It's a lot safer to do. Microsoft has a nice blog about it here

Also, this is a great time to evaluate your backup methods. Hopefully you didn't lose anything this time, but what about next time?

link|improve this answer
This is one of the articles we've tried. We've tried it several different ways. Doing it exactly as described yields "The server encountered an error trying to edit the virtual disk. Reconnecting the virtual disk 'foo.avhd' to its parent disk 'foo.vhd' failed. The operation was passed an invalid parameter." We've tried it with copies (as described). We've tried it with the originals. We've tried it with copies on another host. They all yield the same result. – Kevin Donn Jul 12 '11 at 20:13
You're supposed to rename the avhd to a vhd extension. If you've already done that....well...what's your backup look like? – Jason Berg Jul 12 '11 at 21:33
Sorry. In the message above I chopped out the actual path to the avhd file, but I did indeed change it to vhd. I have internal backups for the machine; it's just a lot more work to go that route. So "The operation was passed an invalid parameter." means what? The disk images are corrupted? What? I don't get it. The host never crashed or anything, the virtual ran fine until deleted. It's just unrecoverable now? – Kevin Donn Jul 13 '11 at 18:45
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.