Disaster Recovery - How Can I Restore Windows 2008 R2 Server Bare-Metal Backup to Hyper-V VM?

I am continuing to work on disaster recovery plan for a small business.  I have purchased ShadowProtect license to use for the server that runs SBS 2011 with Exchange, and that part of the plan is settled.  There are two other primary application servers in use for the business, and they are identical hardware machines running MS 2008 R2 Server Standard.  The storage driver in use is Intel ICH8R/ICH9R/ICH10R/DO/PCH SATA RAID Controller, using a RAID 5 volume.  I am performing a nightly bare-metal (full) backup of each server using the built-in Windows Backup.

I would like to be able to restore these bare-metal backups to a Hyper-V VM in a separate 2008 R2 server I have rebuilt specifically for this purpose, in the event that either server goes down, so that I can quickly recover temporarily while I repair the main server.  This rebuilt "Host" server shows two storage drivers: Intel C600+/C220+ series chipset SATA RAID Controller, and a Microsoft VHD HBA Controller (I assume for the virtual machines) This machine's physical array is a RAID 1 mirror volume.

There is plenty of disk space in the Host server, and I have created a virtual hard disk of 1.5 TB to use with the virtual machine.  I am in the testing phase now, and I am able to create a VM that works, and I have performed successfully a restore from the bare-metal backup from one of my main servers.  However when it tries to boot after the restore there is an error right away, and I have seen the BOSD error ending in 7B that indicates the wrong mass storage driver is loaded.

I have done exhaustive Google searches, and there are many articles that reference this problem, however I have found none with a solution that works for me.  I have tried using the repair console to use the command line, and loaded the registry hive, and tried to change some of the controller "Start" settings to "0" for the intelide, LSI-SAS, etc. entries that I found in one article.  This method has not helped so far, unless I am just missing the right combination of settings.

Does anyone know if what I am trying can even be done successfully?  If so, is there any available information to tell me what to do using my particular hardware configurations?  This seems like it would be a really good solution for me if I can get it to work... our budget does not allow for me to purchase the two additional licenses of ShadowProtect right now, so I am trying to seek a more affordable solution.

I know I can use my rebuilt Host machine as a physical replacement if needed for either of these other servers, as I have been able to restore the Windows bare-metal backups to the physical hardware, but it would be much easier and cleaner if I could use a Hyper-V VM instead.  Any help would be appreciated.  Thanks!
Rob GrinageManagerAsked:
Who is Participating?
Rob GrinageConnect With a Mentor ManagerAuthor Commented:
I have been testing and trying various solutions, and I can now report that I have made this work!!  I don't know if my particular hardware setup is "quirky" - I don't think so, but I have discovered the issues that I am running into with P2V bare-metal Windows (2008) backups to Hyper-V, and how to proceed to fix those issues and get either of my server backups to successfully restore to a VM.

After I restore either server backup, and boot to a command prompt, DISKPART reveals that nearly all of my disk volumes have been restored with incorrect drive letters... this is Issue #1.  Issue #2 is that after the drive letters are corrected, startup reports that the BOOTMGR is missing.  Issue #3 is that after repairing the BOOTMGR, the "Start" parameters for certain of the Storage drivers in the registry are not set right to allow virtual boot.  There was a further complication that I ran into with my equipment/backups that the repair process was not possible using the Windows 2008 Server Install DVD... I can only get everything to work using a Windows 7 - 64 bit Installation DVD, after the initial restore.  I am going to list the specific steps that work for my situation, in the hope that this will help others with similar problems...

ISSUE #1 - Disk volume/drive letters are incorrect after the initial restore process:
a) Boot to Windows 7 DVD
b) Command prompt - diskpart - and use functions to rename all disk volumes to original letters.  As a last step, make sure to select the volume where O/S installed (C: usually) and make "active"
c) Reboot to Windows 7 DVD

ISSUE #2 - Startup does not find BOOTMGR
a) After the reboot in Issue #1-c above, using the Windows 7 DVD, the system reports "found problems" - select "Repair and Restart".  In my scenario, this still does not correct the whole problem - but on the subsequent Restart, boot to the DVD again and it will show that the O/S is detected and on the correct (C:) partition.  For some reason, the 2008 Server DVD does not work here... it does not detect the O/S.  I've tried it numerous times, and it does not work for me, so the Windows 7 DVD is a must in certain situations, like mine.
b) After selecting the "Repair" option on the subsequent reboot, the system should detect the O/S in the proper partition.  If the Startup Repair process does not start automatically, go to Command Prompt.  CD to "recovery" directory and run StartRep.exe
c) After the repair process, Reboot the system and DO NOT boot to the DVD

ISSUE #3 - BSOD with error 7D, or system still will not startup:
a) If the system still won't startup, like in my case, reboot again this time to the Windows 7 DVD.  Go to Command Prompt and type: regedt32 and Enter to open the System Registry window
b) The remaining issue is with the storage driver settings in the system registry, and there could be different setting than the ones I have to change, depending on your hardware, etc.  I will spell out the exact procedure that I have used, which successfully repairs this issue for my restored servers:
c) In the Registry window - highlight HKEY_LOCAL_MACHINE, then on the top menu select File -> Load Hive; navigate to the O/S drive (C:) -> \Windows\System32\Config\ and click on SYSTEM -> then Open.  Enter Key Name = Restored_HKLM, and click OK
d) Under HKLM, expand Restored_HKLM\ControlSet001\services and ensure the following "Start" parameters are set:

aliide = 3
amdide = 3
atapi = 0
cmdide = 3
iaStor = 0
iaStorV = 3
intelide = 0
msahci = 3
pciide = 3
viaide = 3

The items in bold above are the ones that I have to change in my systems.  After these changes are made, go back up to and highlight the Restored_HKLM, then click File -> Unload Hive.  Close the window, exit from the Command Prompt and reboot the machine.

Bypass the Boot to DVD prompt to boot normally, and the server should start normally.  Upon logging into the server, it automatically detects other driver issues and installs the appropriate virtual drivers as needed.  It will require one more Restart after that - and then it should operate normally.

I have no idea what set of circumstances lead to these issues when I restore either of my 2008 Server backups to a VM, but after extensive Google searching I am convinced that I am not alone.  I hope my solution will help others with similar issues.  Restoring physical hardware to virtual machines is a convenient and quick disaster recovery option to be used while the main failed hardware can be repaired or replaced.

Thanks for all help - Rob
Mike TLeading EngineerCommented:

What you are trying to do is perfectly possible and sensible. I am not sure what your process is though as I have done this recently and it works on every flavour of machine without any trouble. The steps I did are:

1) use disk2vhd - this runs inside Windows and uses the VSS (shadow copy) feature to create a VHD whilst the machine is up. If you have SQL stop the services first. It helps to do a defrag first but for disaster recovery that's irrelevant :). The result is one or more VHD files - one for each physical disk.
The hardware was standard HP DLxxx boxes, with RAID, SAS disks and SQL, IIS and all manner of things installed. I did this on 4 or 5 servers.

2) On a Hyper-V host - copy the VHD locally to an empty disk. Create a blank VM. Attach each VHD to that VM.

3) Start the VM

That's it. You don't need the 1.5TB virtual disk - any backup you have will already need to be in VHD format, so you just have to attach it to a template VM.

As for drivers, all the HP's have Intel and PERC controller drivers so are even more exotic than yours, but when you first boot the VM it ignores them. The only issue I've seen is they insist on doing a chkdsk. Once that's done, everything is awesome (to quote the Lego film).

There's a walkthrough here: http://blog.thefullcircle.com/2011/05/hyper-v-p2v-using-disk2vhd/

using WSB to restore to a VM is certainly possible, but you should just setup a blank VM and use the recovery system to restore it.

Create a VM with hardware as similar to the original as you can get away with.
Create the same number & size of (vm) disks as the original server has (you can create bigger disks if required, but not smaller)
You may have to use a 'Legacy Network Adaptor' as the normal one may need drivers that aren't installed until you add the integration tools

You can then boot from the 2008 DVD (within the VM) and follow the options to 'recover my computer'
This should automatically amend he storage drivers and normally works fine.
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

Rob GrinageManagerAuthor Commented:
@totallytonto - I like the sound of your solution since I am currently using the Windows Server Backup system.  I have a question though, in order to test this.  I understand about creating the correct number and size of virtual disks before doing the restore.  What I don't understand is after I fire up the VM and go to "recover my computer" how do I get the backed up disks restored to the correct virtual disks that I created?  I've only tried a restore that does the whole backup at once, so I don't know another way to do it.  Can you explain in more detail?  Thanks!
ignore the fact this is a virtual machine for the moment and just look at the windows recovery system.

The backup is basically an image of the disk. You're booting from a windows DVD and using the recovery system to help you restore the image to a new server. All you need to to is make the hardware as similar to the original server as possible.

as long as you have the same number of physical disks the restore process makes sure the appropriate partitions are created. (each physical disk should be represented by a virtual disk of the same or larger size, not each partition)

this kind of restore recovers the entire computer, assuming you backed up the entire system in the first place.
Mike TLeading EngineerCommented:

I knew I forgot something: the bit about using Windows backup. Windows backup creates VHDs too so step 1) is already done for you. Just follow steps 2 and 3.

For a complete walkthrough Mitch Tullock uses Hyper-V to demo restores here:


The bonus is he shows how to get around a possible gotcha with the disk.

Rob GrinageManagerAuthor Commented:
OK, what is happening with my restore from Windows bare-metal backup to Hyper-V VM is really strange, so I am going to list the steps I'm taking, but first a little background.  I have tried this procedure with bare-metal backups from two different physical servers, both with identical hardware.  The two servers each have 4 hard disks configured in a RAID 5 volume, with a total drive space of about 1.4 TB.  I get a full bare-metal recovery backup each night on each machine, to separate external HDs attached to USB ports.

So, in my Hyper-V "host" server I have created a VHD that has 1.5 TB fixed size - I figure I can reuse this for testing purposes for now.  I create a Virtual Machine using the original server name, about 16GB RAM, no network configuration (I'm just testing at this point), and select my pre-configured VHD.  After the machine is created I go into settings and add an IDE drive for the physical DVD reader, and a SCSI drive for the physical USB drive containing my backup.  The pre-configured 1.5 TB VHD is attached as an IDE drive.

1. Start the VM and boot to DVD - click past the language setting - select repair computer
2. Select "restore using system image" - setup scans and finds my most recent backup
3. I select the option to "format and repartition" the disk, and the restore begins.
4. Restore indicates "restoring disk (c:)" - restoring disk (e:) - restoring disk (d:), in that order, then says restore of computer was successful and restarts.
5. Upon restart I receive an error that "Windows failed to start" and it takes me to the recovery console.  I open a command prompt and go into "diskpart" to inspect, and here is what I find:
disk 0 is my 1500 MB drive, so I select it and then do "list volume", and here is the result:
- volume 0: letter assigned=G, (DVD drive)
- volume 1: letter assigned=C, (System Reserved 100 MB partition)
- volume 2: letter assigned=E, (by size I can tell this is my O/S partition)
- volume 3: letter assigned=F, (this is partition D: of the original server)
- volume 4: letter assigned=D, (this is partition E: of the original server)
- volume 5: letter assigned=H, (USB drive)

I can use diskpart to reassign the volumes to the correct drive letters, then mark the "C" volume as "active" - but Windows still fails to start.

A Google search led me to a forum where someone suggested inserting a Windows 7 64 bit DVD and using the repair option on that to "automatically" fix startup problems, but that did not work - it tried, but eventually said that it was unable to fix the startup problem.

I can't figure out the reason for my restore operations to give incorrect drive letters to my volumes, or why after re-assigning them it fails to boot.  This behavior is the same no matter which machine's backup I use - so at least I am consistent.

If anyone knows why this is happening, or more importantly - how to fix it - I would really like to know.  Please help me...  I know my backups will restore to bare-metal physical hardware, i have successfully tested that, but I would like to have the option to restore to a VM.  Thanks.
Mike TLeading EngineerCommented:

To simplify your restore remove the DVD in case that's displacing the volumes (as it appears as volume 0). Also you need to make the boot volume IDE not SCSI. 2012 it can use SCSI I think but not 2008.

agreed. the different layout of ide devices are affecting the ids of your partitions.

Ensure you have set the DVD to ide channel 2, and the primary VHD to channel 1 to see if this resolves.

you're not booting to the USB disk so that should be an issue, but there is actually an issue with SCSI drives as they are not presented to the Virtual machine until after boot. The system restore process may not like this. Seems unlikely to be the cause as you advise the process appeared to be successful, but it's worth considering.
Rob GrinageManagerAuthor Commented:
So here is the latest update to my problem.  Just to be sure that my backups were being done correctly, I restored one to bare metal hardware without any problems.  All volumes (logical drives) were restored to the hard disk and the recovered machine operated as normal.  The server where the backup was performed is a RAID 5 volume with four physical disks, and the server where the backup was restored is a RAID 1 volume with two physical disks.  This seemed to make no difference at all and the restore was completely successful.

So I took the very same backup file, created a new VM in Hyper-V, and tried the restore again with exactly the same (erroneous) results as described above - the drive letters after the restore are not associated with the correct volumes on the restored disk, and windows fails to start.  I'm sure if I try to use diskpart again to correct the drive letters, and mark the correct volume as "active" it still wouldn't boot... that's what happened over and over before.

In the settings of my VM, I have IDE channel 0 attached to the VHD, IDE channel 1 attached to the DVD drive to run my Windows startup disk, and the USB drive containing my backup files is attached as SCSI drive 0... I don't know how else to attach my backup drive, and I don't know exactly how to use the legacy network adapter "trick" to try and access my backups that way... nor do I know whether that would help.

If anyone knows why this is happening to my restore attempts, or what I can do differently - I would really appreciate the help.  Thanks.
try adding the USB drive as IDE instead of SCSI. As long as it's after the VHD & DVD it should come later in the list of partitions.

There are usually 2 IDE channels with 2 devices on each.
Rob GrinageManagerAuthor Commented:
I had high hopes after reading totallytonto's suggestion above, and also after finding a post on some forum site that said if you have a partition called "System Reserved" which is created automatically by Windows on installation, that you have to give that partition a letter, and it must be included in your bare-metal backups.  Well it had always been included, but before now I never had a drive letter assigned to it.

However, even after making the drive letter change, and using an IDE drive in the VM for the USB attached with my backup files, the restore still does not work correctly.  I even figured out how to perform a bare-metal backup to a folder on my VM Host server, and I was able to locate the backup by using the network option on the restore operation - but still the restore did not work properly.

In every attempt, the restore operation does not label the volumes properly, and even if I use diskpart afterwards to re-assign the correct drive letter to the right volume, Windows still cannot start.

When I try to use the StartRep.exe after fixing the drive letters, it comes back with an error saying that it was unable to repair and start windows.  I've even gone through the process of running bcdboot and trying to fix the Boot record, but nothing I do will allow Windows to start.

I know that many people are able to get this P2V type of restore to work, but I still cannot make it work for me.  If anyone has any other helpful tips to offer, I would really appreciate it.  Like I said before, the backups I get do restore just fine on other physical hardware, just not to the Virtual Machine.  Thanks.
I've tried to replicate this issue but I cant get it to do what yours is doing.
When I create this VM it assigns the correct disk order on restore.

I'm sorry mate but I'm running out of ideas.
Rob GrinageManagerAuthor Commented:
After there were no Experts that provided the complete solution, I performed extensive research and testing in order to get the restore process to work with my Hyper-V virtual machines.
Mike TLeading EngineerCommented:
Thanks for posting back the solution. It is odd, but sometimes things just don't go to plan!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.