Friday, January 30, 2009

How to convert a linux physical server to a VMWare virtual server (P2V)

I was recently asked by someone to help them convert their older physical dell poweredge server into a virtual server. They already have a nice new server running the free version
of VMWare Server (formerly GSX), hosting a number of machines already.

The software I decided to use is called BackupEdge, from Microlite. They offer a free 60 day trial, so there was no need to purchase it, however using it with such success, has forced me to consider buying it as a backup software.

BackupEdge supports most flavours of linux (in this case a very old Redhat 9 box), and supports lots of different backup targets (CD/DVD drive, ftp, S3, etc.). I decided to backup the machine to ftp as there was already an external ftp server on the same local network.

The procedure was really easy, basically start a full backup of the system, and I ended up with a number of large files on the FTP server.

Then I used BackupEdge to create a recovery boot cd. The image itself was only around 5MB and is configurable to include extra drivers/modules for your boot environment. Remember we are switching from a hardware environment (some kind of raid card + physical hardware NIC) to a BusLogic/LSI Logic scsi controller and PCNet32/Intel 1000 virtual nic.

I had to modify the modules.conf and re-generate a new initial ramdisk before creating the recovery cd image. Be sure after creating your recovery image, to revert your initial ramdisk back to the original, if you don't any your machine is forced to reboot, it may not come back up.

The ftp backup took only around 45 minutes. Then I created the target virtual machine, mounted the ISO image created as a cdrom drive, and started it. The recoverEdge software started with support for the scsi and network. I was able to configure the network parameters and pull the backup files from the FTP server. About 20 minutes to restore the filesystem, reboot the virtual machine and everything was running virtually.

If you are switching a physical machine with active/running IP's, be sure to disconnect the port that server is connected to after backing it up. Otherwise you'll potentially have IP connectivity issues.

I think Microlite needs to start marketing their software also as a good solution to P2V conversion, even add a features into their recovery cd creation tool to add in the required modules/drivers/config.

Enjoy.