Converting a Physical Windows Server to Xen / Oracle VM, by way of VMware
At work, we are moving from a huge datacenter space (about 12′ x 12′, 12 cabinets) to less than 1 cabinet. This will be a great change in all respects, mostly financially, for all the saved space, but also environmentally, for all the saved power. We probably use about the same amount of power to run our whole infrastructure as we used to to run two or three servers.
We are using an IBM Bladecenter, with fully loaded blades – 5 for now, expandable to 14. Each blade has 8 CPU cores, and 32GB of memory. It would be a waste to run a server OS on the blade itself, it would definitely not be properly utilized and we’d be wasting compute power, electrical power, and space. So, we’re moving ahead with deploying everything on Oracle VM Server – a Xen based virtualization platform, that does some cool stuff like load balancing, failover, live migration, etc.
In our old infrastructure, we have a few Windows servers, whose functionality we need to keep around, but we’re not too excited to move over these old, Pentium III waste-of-space servers. Last week my main task was to figure out how to get these old servers moved into Xen virtual machines.
There’s not much information out there on making this conversion – there are some commercial tools that will do everything for you, but they are quite expensive. The included P2V functionality in Oracle VM is documented only for linux, and for systems with large hard drives with lots of free space, is pretty wasteful.
The process I came up with requires no downtime on the server to be cloned, only minimal changes beforehand (installing the VMware converter software package), and allows you to resize hard disks as needed. Once you get the hard disk cloned, you change the drivers, installed software, etc. on the VM only, so the original machine still works and is your backup/fail safe. The process isn’t all that time consuming either – it mostly depends on your network and disk speed to clone the image, and convert it.
The basic process is as follows:
- Clone the physical server using VMware converter – you need to install the VMware converter software on a management host, and the agent on the physical server to clone. You need to provide proper login credentials, and a samba/cifs share that both machines can access. Full instructions are available here:
http://www.howtoforge.com/vmware_converter_windows_linux
- Once you have the vmware image (.vmdk and .vmx files) open them in vmware server, fusion, or whatever version of VMware you have install / converted to.
- Install vmware tools to make your life easier.
- Just in case, install the Windows recovery console: http://support.microsoft.com/kb/307654
- Run MergeIDE: MergeIDE — This is the secret sauce that copies in and installs the proper basic drivers in the Windows registry.
- Shutdown the VM.
- Copy vmdk files over to Oracle VM server (or Xen flavor of choice)
- Create a new windows VM in Oracle VM manager, power off after creating
- Delete the created disk file (System.img)
- Convert the vmware images with qemu-img: qemu-img convert vmwarefile.vmx System.img
- Start vm in Oracle VM, let it detect devices and install drivers
- Use and enjoy being unbound from crappy old hardware!
6 responses so far








MergeIDE.zip is bad file ???
I convert vmware image and start under Oracle VM, but getting error with “another hard disk – blue screen”
I try to find mergeide on the net, but nothing …
Please, help..can you see what’s wrong with that archive ?
Regards!
It was a bad file, don’t know what happened there. I uploaded another copy, that should work. Also, I originally found it here:
http://www.virtualbox.org/wiki/Migrate_Windows
Thanks, this helped me a lot to get an existing Win2003 64 bit VM across to Xen, particularly the MergeIDE batch file (it is in German so needed a bit of translation. It searches the Windows i386 drivers; I had to change this to AMD64 drivers). There were some points I noted during the process that may be helpful to others.
1. You say to install VMware tools. Other advice I found said to uninstall them but I left them in. The end result was services that didn’t start and drivers that couldn’t load. Probably not harmful, but it would seem that uninstalling them is preferable.
2. The converted VM disks had to be raw format, which creates sparse files. I tried a number of others (qcow2, vmdk etc) but Xen just hung and wouldn’t boot or otherwise use the disks. I don’t know why this is the case; I may even go and read the manuals. I didn’t follow your procedure to the letter here. Instead of creating an install and deleting the resultant img file, I simply added the raw files during creation – I had several disks. Maybe this is the reason. Also the disks had to be IDE type.
3. Once up and running, install the gplpv drivers (see http://wiki.xensource.com/xenwiki/XenWindowsGplPv) inside the guest. This will then allow SCSI disks to be used which overcomes a strange limit of four IDE drives in Xen, as well as boosting performance by a huge amount. The lack of PV drivers is the main reason I shied away from KVM.
Ken
Thanks for the helpful info, I haven’t done much work on this since I first posted. You mentioned you changed it to amd64 drivers, can you post those changes? Also, I’m trying to figure this out for Windows 2000, but can’t seem to get it right – let me know if you have any insight.
The batch file starts with
—————————
@echo off
if “%1″==”" goto noarg
set ctdir=%1:\i386
goto tryit
:noarg
set ctdir=%SystemRoot%\Driver Cache\i386
:tryit
—————————
Just replace i386 with amd64, works fine.
Sorry haven’t used Win2000 – it seems to be a different beast.
Ken
This was very useful for me while I worked on the new PXE boot environment. See this: Adding Centos 5.3 to PXE
thanks a lot!