The Power of VMWare

So I got a new Dell Vostro 200 last week that I wanted to set up to start working a little more in depth with VMWare at home. We already use VMWare ESX extensively at work but I have a lot of old machines running as servers in my house and I would be remiss in not applying the server consolidation idea to my own setup. So Sunday night I decommissioned an old desktop that I was running a couple of test VMs for Solaris 10 x86 and SUSE. It was brain dead easy to just install 64-bit CentOS 5, add the free VMWare Server 1.0.4, shutdown the VMs on the old server and copy them to the new one, and start them up again on the new system. Little did I know that the system I WAS using as this web server had developed some suicidal relation with this other machine and decided to implode in the wee hours of the morning. This is the second time in the five years I’ve owned the Abit NF7-S model of motherboard that it has done this exact thing to me. The last time was almost 2 years to today, when the board died with a week left in the three year warranty. At least I still have the original hard drive.

Needless to say, I was very desperate to get this up and running and I did not have a spare motherboard to run this on, nor enough space on the VMWare server’s 80GB drive for the web server’s 160GB mostly unused drive. VMWare Server has this neat little feature that lets you run a VM off a physical drive, so
I popped the physical SATA drive in this morning. However, I was stuck most of this evening trying to get what was once a SATA drive booting off /dev/hde to boot inside of the VM’s scsi architecture as /dev/sda.
It turned out I did not have any scsi drivers inside of the initrd, so I had to make sure all the right drivers were being handled.

For those that might go through this in the future, you need to use the appropriate Linux CD to do a rescue (“linux rescue”), chroot to the mounted filesystem /mnt/sysimage, change any instances of the old partition info (root=LABEL=/) to the new drive (root=/dev/sda1 in my case) in grub.conf, and do a mystical incantation similar to the following…

* cp /boot/initrd-2.4.20-8.img /boot/initrd-2.4.20-8-bak.img (just in case)
* mkinitrd –preload=scsi_mod –preload=sd_mod –preload=BusLogic /boot/initrd-2.4.20-8.img 2.4.20-8
* grub-install -f -v –recheck /dev/sda

and be sure to make /etc/modules.conf or /etc/modprobe.conf have this to handle the network and scsi adapters…

* alias eth0 pcnet32
* alias scsi_hostadapter BusLogic

Lo and behold it booted up straight away, prompting Anaconda to remove all the old nVidia hardware from the old motherboard and add the new VMWare virtual hardware. And now you can read this on the restored system!

On order is an extra 2GB of memory, and a new 500GB drive that I will be using to host a vmdk copy of this physical drive. This should give me plenty of capacity for running services and test systems. I eventually plan on migrating this web server and all of its services over to a CentOS 5 system to keep things up to date automatically rather than manually compiling all the packages for RH9 as I do these days.