How to recover a deleted VM on Windows Server 2008 R2 Hyper-V

sthay
sthay used Ask the Experts™
on
Dear Experts

Someone has accidentally deleted or somehow the VM has disappeared from the Hyper-V host via Hyper-V manager. In fact, the content of the VM seems to be intact with flat folder structure like this:

-Snapshots
      -*.xml
      -folders
-Virtual Hard Disks
      -*.vhd
      -*.avhd
-Virtual Machines
      -.xml
      -folder

How do I make it appears in the Hyper-V host again?

Your advice is highly appreciated.

Regards
Sot
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
create a New  Virtual Machine, select the appropriate choices but when you get to "Connect Virtual Hard Disk" choose "use an existing virtual hard disk" and select your vhds.
IT Manager
Commented:
As I understand your machine had some snapshots and all configuration files are still there.

You cannot use the previously suggested method to recover a VM with snapshots.

The only officially supported method is to restore the server from a backup but if you don’t have one there is an official method that you could try: http://eniackb.blogspot.ca/2009/05/how-to-recover-hyper-v-virtual-machine.html

Commented:
Word of advice, when VMs disappear from the Hyper V console this is due to the antivirus excludes not configured correctly. Hence your config files get corrupt and the VM goes missing, though the VM files appear to be there.

I would suggest looking at your antivirus solution and make sure they are excluding all VM related files and locations to prevent this happening again.

Author

Commented:
Dear spaperov

Thanks for the tip. I have tried all the three options and none of them work for me. In fact, our VM has a snapshots and thus the process was not straight forward.

Kindly suggest me more.

Thanks in advance.
Sot
Commented:
First copy all files as a backup. Then merge the AVHD to the VHD to create one VHD. Create a new VM with similar config as your previous VM, sorted.

Link to help with the merging: http://www.ms4u.info/2010/09/merge-avhd-with-vhd.html

Author

Commented:
Thanks to both spaperov & Netflo.

spaperov's option #2 has helped solving my problem.

Regards
Sot

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial