Hyper-V P2V using Windows Server Recovery (WinRE)

A few weeks ago I posted about using Disk2VHD see http://blog.thefullcircle.com/2011/05/02/hyper-v-p2v-using-disk2vhd/, however disk2vhd does have limitations e.g 137GB volume size, and you can get errors such as disk too large for dynamic disk, etc. (covered at the end of that post).

Another way of getting a physical host converted to a VM is to back it up, create a VM container, and restore into the new virtual machine, then go through the steps to strip back the hardware and system drivers as normal.

First you’ve got to get a good bare metal recovery backup and for the purposes of this post I’m just going to cover a Windows Server 2008 R2 source/physical server.

Bare Metal Backup on Windows Server 2008 R2

Obviously you need the backup components installed – Add/Remove Features – Windows Server Backup, or scripted using start /w ocsetup WindowsServerBackup

Launch Windows Server Backup and select ‘Bare metal recovery’ – all components to support a bare metal recovery will be checked, if you’ve installed any programs to another disk other than the %HOMEDRIVE% you may find you need to backup more than one disk volume..

image

 
Once the backup is running you can monitor from the GUI or command line… e.g.
 

C:>wbadmin get status
wbadmin 1.0 – Backup command-line tool
(C) Copyright 2004 Microsoft Corp.
The backup of volume System(C:) successfully completed.
The backup of volume Data(D:) successfully completed.
Creating a backup of volume Logs(E:), copied (12%).

 
You can also check on how many versions of backups are available e.g. which one you intent to restore into a VM by using the wbadmin get versions command:
 
C:>wbadmin get versions
wbadmin 1.0 – Backup command-line tool
(C) Copyright 2004 Microsoft Corp.

Backup time: 17/05/2011 00:00
Backup location: Network Share labeled thefullcircle.localBackups
Version identifier: 05/16/2011-23:00
Can recover: Volume(s), File(s), Application(s), Bare Metal Recovery, System State

If the backup drive is an external drive such as a USB this would be reported as:

Backup target: 1394/USB Disk labeled X:

Restore using Windows System Image Recovery

In this case again we are using Windows Server 2008 R2 boot media but this can also be performed using a Windows 7 or ERD Commander WinPE environment, of course technically this is WinRE.

1) Boot from your media, make any language, locale, and keyboard selections

2)  Rather than Install now, select Repair your computer
image

3) Select Restore your computer using a system image that you created earlier.
image

4) If you’re quick enough skip trying to find an image, but more likely you will get a dialogue advising that Windows cannot find a system image on this computer, that’s fine – click Cancel, then Next.
image

5) At the re-image your computer prompt, select Advanced…
image

6) You can then search your network for an image, or you may need to load drivers (should be unlikely with the driver support of Windows Server 2008 R2 as shares codebase with Windows 7 – pretty good driver support!)
image

7) Clearly you do want to connect to the network (if you have DHCP enabled happy days, if not take a crash course in netsh commands to set an IP address)
image

8) Choose your network location..
image

9) Enter credentials – there is no point trying to save them, you’ve probably booted from an ISO or DVD-ROM anyway..
image

10) Select your backup, click Next, then select your volumes

image

image

11) Choose any additional restore options such as Excluding disks, loading additional drivers, or under Advanced – restart options when complete, checking disk errors – checked/yes by default
image

12) A final confirmation of what will be restored, and then ‘another’ final check, Yes is the only option unless you’ve changed your mind about doing a restore today…
image

Wot no disk partitions, volumes, or anything to restore to?

Then you may get this message..
image

or this one
image

which takes you back to..
image

and you can get busy with diskpart, etc. from within a Command Prompt (surely that’s a Command Shell?)… select the disk, create a primary partition, make it active, and then start again..
image

or just let the machine do the work.. click Restart and start again.. (again!)