Link to home
Start Free TrialLog in
Avatar of Steve B
Steve BFlag for United States of America

asked on

Hyper-V corrupt .avhd file after host server crash

I am at wits end with this one.  I had a Windows 2008R2 HyperV host that I inherited as a problem.  It is hosting an Exchange Server 2010 VM which is set up with two virtual hard drives.  One hard drive is the System drive where the OS resides and the second is the Data drive where the data files including Exchange 2010 reside.  The server has a parent image and then three other snapshots that were apparently used as backups of some sort.  The latest snapshot is mounted as shown in the picture on IDE Controller 1 and is linked to a .avhd snapshot for some reason.  Well, the host server lost power and when the VM starts, it reports that the file is unreadable and corrupt.  I restored the entire directory the Hyper-V guest OS is stored in and get the same thing, unreadable and corrupt.  Since it is a snapshot and not a parent image, I think hope is lost so I am looking for alternatives.  I was able to open the latest .avhd file with a program called Kernel for VHD and I could see all of the files.  The odd thing was the modified dates were years old on the Exchange files but I am not sure this program can see the dates correctly.  There is not an option to repair the avhd file with this program that I can see, so it looks like my only option would be to buy it and extract the files from the VHD and then put them back on the server into a new virtual hard disk.  Is there any other way I could make the existing .avhd file readable?  I have also tried following an article that talked about creating a new machine and then attaching the corrupt .avhd file and compacting it, but this failed and I think it was due to it being a .avhd snapshot and not a .vhd parent file.
screen.png
Avatar of bas2754
bas2754
Flag of United States of America image

Take a look at the following link:

http://tristanwatkins.com/recovering-from-virtual-machine-corruption/


In this case the author created his own problem, but the solution may still work for you.  It appears he created a brand new VM and attached the latest snapshot to the new VM and was able to get things up and running.

In your case you may want to look to create a new VM and create a new OS disk and do a fresh install of the OS on the OS disk.  Once that is created, restore the latest backup of the VHD and AVHD files to the VM location and point the new VM's second controller to the latest AVHD.

Fortunately Exchange 2010 has a Disaster recovery mode that will pull all the info needed to install and re-integrate Exchange as long as you have the .MDB files.  If you can pull just those files you should be able to do a full restore of Exchange.

It has been a while but I've done 3 or 4 times in the past few years.
Avatar of Steve B

ASKER

I can't get anything to work.  I have followed the Watkins article and most everything I have Googled to try and get this to work.  I am somewhat doubtful that the file is really corrupt because I have restored a few days of backups with the same result each time.  I read somewhere about corrupting the configuration portion of the .xml file but it appears to be fine.  I need to get this server back so I am down to two things I can think of.  1. Open a case with Microsoft or 2. Buy Kernel for VHD for $149.  With this possibility, I am envisioning keeping the existing Exchange VM, deleting the faulty virtual disk which holds the D partition on the server (the other virtual disk is fine and holds the OS on c:) create a new data partition virtual disk, format it with Windows and then copy the files extracted from the avhd file to the new D partition on the virtual machine.  In theory, this should work but I am not sure if there are any gotchas.  I am very lucky this client is tolerant of not having their Exchange server for a day or two.  

I just don't understand how intolerant of failure HyperV on Windows 2008R2 really is.  I know anything can happen and people will be quick to say you should have done this and should have done that to prevent this.  Probably, but it isn't my server and I'm inheriting a problem I didn't cause.

Anyone have any thoughts on which of my proposed options will bear fruit?
ASKER CERTIFIED SOLUTION
Avatar of bas2754
bas2754
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial