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..
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%).
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
3) Select Restore your computer using a system image that you created earlier.
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.
5) At the re-image your computer prompt, select Advanced…
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!)
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)
8) Choose your network location..
9) Enter credentials – there is no point trying to save them, you’ve probably booted from an ISO or DVD-ROM anyway..
10) Select your backup, click Next, then select your volumes
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
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…
Wot no disk partitions, volumes, or anything to restore to?
Then you may get this message..
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..
or just let the machine do the work.. click Restart and start again.. (again!)