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.

4 comments:

David said...

Thanks for this info. I am really interested in how you built the new initrd with the proper modules = LSI disk controller and Pro/Intel 100 NIC.

Thanks in advance for any info!

David.

DRX said...

Hi,

It's been some time.. but I was able to piece together a few more details.. It all depends on what distribution your trying to convert from.

I used these 2 links to help me generate a new initrd:

http://lists.us.dell.com/pipermail/linux-poweredge/2003-December/011857.html

http://www.netadmintools.com/html/mkinitrd.man.html

Basically editing the modules.conf to include the other modules then running the command to generate it. Unfortunately I don't have the exact commands documented. But I can see from the server (which is still running but soon to be turned off)..

/etc/modules.conf:

[root@dell root]# cat /etc/modules.conf
#alias eth0 tg3
alias eth0 pcnet32
#alias eth1 tg3
alias eth1 pcnet32
#alias scsi_hostadapter megaraid
alias scsi_hostadapter BusLogic
below usbkbd hid

You can see how it used to use tg3 for physical adapters, and megaraid, but I was able to alias them to other modules.

Also the backupedge file still on there is aware of the modules. I remember somewhat that it listed the modules it was using in creating the emergency restore iso image.

[root@dell root]# cat /root/.recoverEDGE.rc
#
# Microlite RecoverEDGE for Linux - Configuration
#
KERNEL Red Hat Linux (2.4.20-24.9)
BOOTLILO Yes
INITLILO Yes
INITGRUB Yes
FORMAT Yes
VERIFY Yes
TEMPPART /dev/loop0
BOOTNODE cdrom0
OUTPUTDEV
REPORT /usr/lib/edge/recover2/RE2.REPORT
PRINT lpr
AUTOMOD Yes
COMPMOD Yes
LOTSOMISC Yes
ALOTSOMISC Yes
NETWORK Yes
IPADDR 69.90.XXX.XXX
NETMASK 255.255.XXX.XXX
BROADCAST 69.90.XXX.XXX
TELNET 23
RSV_FILES Yes
RSV_DNS Yes
RSV_NIS No
RSV_NISPLUS No
PCMCIA No
MODULES sg iptable_filter ip_tables tg3 ide_cd cdrom usb_ohci usbcore ext3 jbd megaraid sd_mod scsi_mod pcnet32 BusLogic mii


If you have any more questions, feel free to post, I'll do my best. It looks like they have a newer version now of backupEdge, so it could be even easier now.

David said...

DRX,


Thanks for the additional info. That is _very_ helpful.

I will try it out this weekend and let you know. If it works, I will send you the detailed instructions on how I did it.

I will be trying to convert from a Red Hat Enterprise Linux Server 5.2 on a Dell PowerEdge to VMWare 5.x. to test disaster recovery.


Thanks again for all your help!

David.

David said...

Oops - forgot to check the box to email follow-up comments! - so here's my "cheat" message/post.