Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


October 2009

Crash Course in P2V Migration

You've got a workstation, Hyper-V, and Symantec Ghost--here's how you get from A to B using C
RSS
Subscribe to Windows IT Pro | See More Migration Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Finalize WinPE
After you've customized WinPE, you have two choices. First, you can create a bootable ISO image from the modified WIM file, which you can then either attach to the VM within Hyper-V Manager or burn to disk. Burning a disk is slower than using an ISO image, but a Hyper-V VM can read from physical media so you could use the disk on other systems. To create an ISO image, type the following command in the WinPE command window:

oscdimg -bc:\winpe-x86\etfsboot.com -n -o c:\winpe-x86\iso c:\winpe-x86.iso 

The command outputs the image as winpe-x86.iso. To attach it to a VM, make sure that the Hyper-V host can access the ISO image, then open Hyper-V Manager. Right-click the VM, then select Settings. In the left-hand window under IDE Controller 1, select DVD Drive. Next, in the right-hand window, select Image file, then browse for the ISO image. Click OK to confirm.

Your second option after customizing WinPE is to make it available over the network via WDS. To do this, you need a configured WDS server—either Windows 2003 SP1 or Server 2008. Copy C:\winpe-x86\winpe.wim to the WDS server, then launch the WDS management console on the server.

Expand the tree and right-click Boot images. Select Add Boot Image, browse for the winpe.wim file, click OK, then Next. Enter an appropriate image name and description (or accept the defaults), click Next, then Next again. WDS adds the image file to the list of available boot images. Make sure the VM is on a network that can find the WDS server and boot it from the network, then choose the image in the boot menu, as Figure 4 shows.

Prep the Physical System
Now it's time to get the physical system ready to take a snapshot. You should start by performing a thorough cleanup of the system. I didn't do enough of this and paid the price later with a mind-numbing repair installation. Go through Add/Remove Programs and strip out all driver packages—graphics drivers, network drivers, and so on; they won't be needed on the VM. Keep only what you need to maintain basic functionality.

It's also a good idea to do a disk cleanup and defrag on the hard drive—this is always a good idea before imaging because the process arranges data better on the disk, which results in fewer problems during image transfer. Also, go into System Configuration (Start, Run, msconfig) and disable all startup applications—when the VM comes online for the first time, it won't be fully functional until the Hyper-V Integration Services are installed, so it's better to prevent startup software from running until the system is stable.

If you're moving from a physical system with an IDE hard disk to a VM with an IDE virtual disk, chances are that the image will restore easily onto the VM. If, however, the physical system has a RAID controller or SATA drive, there's a strong likelihood that a straight image up/image down procedure will result in a VM that instantly bluescreens due to a change in the disk controller on the boot disk. You're most likely to have this problem on earlier OSs such as Windows XP and Windows 2000; Vista should cope.

However, because we're rescuing legacy systems, there's a strong chance you're dealing with an older OS. Therefore, you can save yourself a lot of time and bother by using Sysprep. Performing a basic Sysprep on the physical system to trigger the mini-setup gets you past any bluescreen problems when the VM reboots after image deployment. If you want a more elegant solution, incorporate the contents of the \support\x86\en-us folder into the file system on the physical machine before running Sysprep so that the virtual device drivers are present when the guest OS runs through plug-and-play detection. However, you still have to install the Integration Services software after imaging—there's more to the package than just the drivers, such as data exchange, heartbeat, and time synchronization.

Because I was in a rush to get my system migrated, I didn't run Sysprep and paid the price when the VM instantly bluescreened. A repair install fixed the problem, but it took so long that it would have been worth spending the time to go back, run Sysprep on the machine, and recapture the image.

Deploy the Image
When you've prepared the physical system, shut it down and boot into the Ghost client. If you don't have a pre-existing method in place for this procedure, you can use the custom WinPE ISO image created earlier. Or, if the older system supports network booting, let it access the image from the WDS server. You can even take the bootable ISO image and transfer it to a USB key and boot the physical system from that—which makes a great portable tool.

To create an image, open the GhostCast server application and select Create Image. Nominate a session name and file name. Then from the client, go to GhostCast, Unicast and enter the session name to begin the capture session. After it's captured, it's good practice to open the capture file with Ghost Explorer on the GhostCast system to make sure the image files are OK.

When you've created the image, fire up the VM on the Hyper-V host and boot into WinPE, as Figure 5 shows. Remember that if you're booting from the network, you need to attach a legacy network adapter. When the system loads, you’ll be presented with a command window. Navigate to X:\Windows\System32 and enter ghost32.exe to launch Ghost, as Figure 6 shows.

If the VM and GhostCast system are on different subnets, you'll have to enter the server IP address manually for the client to connect. If you're planning to do more ghosting across subnets, consider entering an IP helper address on the router so that you don't have to type in the IP address every time. Wait while the image is restored, then reboot the VM. The only post-install task needed for system stability is to install the Integration Service components—then you're done.

Next Time?
This method of P2V is, to be honest, not exactly elegant. However, it does have the advantage of being quite robust—using Ghost for imaging means that if something goes horribly wrong with the VM, you've still got both the original machine (obviously, don't throw it away until you complete the migration successfully!) and the captured image, so you haven't lost any data.

This method also has the advantage of letting you get your hands dirty with WinPE and WDS. They're a powerful combination and can form the basis of a wide range of custom tools for supporting systems. WinPE is a great platform for deploying useful utilities to any corner of your network, physical or virtual—like ghost32.exe.

Would I follow the same path next time? As long as we still have a supporting Ghost infrastructure, yes. After we've moved across to WDS completely, no. There are ways of converting a physical hard disk to a VHD that you can then attach to a Hyper-V VM—that's a much more straightforward (although apparently equally time-consuming) process, and certainly worth a look. The other, more sensible, option is to make use of System Center Virtual Machine Manager (SCVMM), which has supported P2V methodologies. The downside is that SCVMM is an extra purchase, and businesses that are just playing with Hyper-V at this stage might not consider the cost worth it. If, however, you're considering Hyper-V as your virtualization platform of choice, SCVMM is an invaluable management tool and should definitely be investigated.

End of Article

   Previous  1  [2]  Next  


Reader Comments
Looks rather complicated. I too wanted to perform a P2V from a workstation and found a method from this site: http://easterndigitalsoftware.com/p2v/p2v.htm
that performed perfectly using Ghost. There is the extra step of copying it to MS Virtual server 2005, but it is only momentarily done and can be copied to HyperV and configured.

jakesups July 08, 2009 (Article Rating: )


You guide was fairly straight forward and simple however when the WinPE iso boots ghost32.exe is not loaded. If I "dir" the X:\windows\system32 folder its not listed but if I mount the c:\win_pe folder back on my pc I can see the file is in the directory. Why would it should in the directory but not get copied over when I call the oscdimg command?

jaredt July 10, 2009 (Article Rating: )


jaredt - the oscdimg command just makes use of whatever is contained within the WIM file. Can you double-check that the ghost32.exe is definitely being written to the WIM file using the /commit command? Another thing to check is to mount the created ISO with Daemon Tools to see whether the file was written to the ISO - let me know how you go.

jamesbannan July 13, 2009 (Article Rating: )


James,
The only way I know of checking the contents of the WIM file is by mounting it to a temp directory. If I do that then the answer is "Yes" the Ghost32.exe file IS listed under \Windows\System32.
I installed daemon tools however when I mount the ISO I see only the CDROM files/folders: BOOT, EFI, SOURCES, BOOTMGR.

jaredt July 14, 2009 (Article Rating: )


Jared & James,
There is a missing step in the above How-to. After you are done with the steps that are on Page 1 of this article you need to also complete this command:

copy c:\winpe-x86\winpe.wim c:\winpe-x86\iso\sources\boot.wim, Then Y

This needs to be executed prior to the oscdimg command for the changes that you did to the winpe.wim to be copied to the ISO file. I found this when attempting to add defrag.exe to a WinPE file and it was also useful when doing my P2V migration with Ghost. Post back if you have any questions.

jchamness July 19, 2009 (Article Rating: )


Hi James,

Here's a thought: If you're doing a P2V for NT4, Win2k or WinXP from a single (ie. UNI) core processor to a multi-core processor (ie. MP), you may need to replace the virtual machine's HALs (and a couple other files) if you virtual machine has multiprocessor support. Here are some links:
NT:
http://support.microsoft.com/kb/142660

XP:
http://incore.net/winxp-multicpu/

From what I understand, Vista and Win7 can auto detect the number of processor cores and manual intervention is not required.

Regards,
Bret

bretabennett October 21, 2009 (Article Rating: )


You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
WinInfo Short Takes: Week of November 23, 2009

An often irreverent look at some of the week's other news, including some post-PDC some soul searching, a Google Chrome OS announcement and a Microsoft response, Windows 7 off to a supposedly strong start, the Jonas Brothers and Xbox 360, and so much more ...

2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...


Related Articles Q. How can I perform a physical to virtual (P2V) migration with System Center Virtual Machine Manager (SCVMM) 2008?

3 Disk-Imaging Solutions

10 Steps for Physical to Virtual OS Migration

The Path from a Physical to Virtual World

Virtualization Whitepapers A Business Case for Backup & Recovery for The Virtualized Environment

Related Events VirtualizationPro 2010 Summit & Expo

Deep Dive into VMware vSphere

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement