Saturday, January 12, 2013

Adventures in P2V of Red Hat 7.3 Valhalla

Well one of the old Red Hat 7.3 Valhalla build machine was in the slow process of dying and since obtaining a new license and configuring it again was impractical, we decided to give P2V a try.  First I tried the latest version of VMware Converter 5 but that failed (it doesn't support RH 7.3), so then started a search on google and best site that described the whole procedure was @ virtualaleph.blogspot.com.  My actual steps turned out to be a little bit different so I am going to list them as I remember them.  You're going to need the following:

- VMware Converter 3.0.3 CD
       You've to search the web for the ISO file. The filename that I found to be working for me was coldclone.3.03.ISO, you can google it as it is no longer available from vmware.
- Red Hat 7.3 Valhalla ISO
       can be download by following the links on this page: Red Hat ISO and save on one of the folders on the destination server.
- VMware Workstation 9
       This is the version that I was using to host the final image.


Procedure:

1. Burn the Vmware Converter 3.0.1 ISO and Boot the source server with it.  Most of the dialogs on there are self explanatory but the only thing I needed to do was the share the Virtual Machines folder on the destination Vmware Workstation 9 server something like \\20.1.0.22\Virtual Machines.

2. Step on is going to take several hours depending on the number and size of the hard drives on the physical server and your network speed.

3. After the conversion is done you're going to have a folder on the destination Vmware Workstation 9 server under virtual machines like \<Machine name of Physical Server> (this is set in step 1 on the source server).

4. Open the new VM in VW9 but don't start it.

5. Right click on the new VM in VMware Workstation dialog and check if the VMware Tools are available.  If not do the next step otherwise skip

6. Select settings (same menu as in step 5), Click on 'options' tab and change Guest Operating system to Linux (from Other) and Version as 'Red Hat Linux'. and click okay.

7. Select settings menu again if you closed the dialog or skipped step 6 and click 'CD/DVD (IDE)' under the Hardware tab. Change 'Use ISO image File' to point to the first CD ISO of Red Hat 7.3 Valhalla (you should've already saved it on the destination server on one of the folders)

8. Start the VM you might've to press F2 on the BIOS screen to boot cdrom before hard drive I certainly had to.

9. type Linux rescue on the prompt of the rescue CD.

10. Select language, keyboard but don't select network and mount the system image in read-write mode.

11. Issue the following command:
                 chroot /mnt/sysimage

12. Edit /etc/modules.conf file and change each instance of  SCSI alias with BusLogic and each Ethernet nic with pcnet32.  For me SCSI was i.o2 and eth was intelsomething. Take care with the BusLogic spelling it needs to be exact... I wasted like half an hour trouble-shooting when I added Buslogic :(

13. Navigate to /boot and make a backup copy of your initrd-2.x.y-zz.img .
Then issue the mkinitrd command mkinitrd -v -f /boot/initrd-2.x.y-zz.img 2.x.y-zz (example for me it was : mkinitrd -v -f /boot/initrd-2.4.20-20.7bigmem.img 2.4.20-20.7bigmem )

14. Reboot.  During the first boot the vm will reboot and kudzu will check for new hardware prompting for removing SCSI modules config and for adding BusLogic and pcnet32 modules.

15. The VM should now boot without kernel panic.

But if you're in my boat and getting the 'INIT: init 'x' respawning too fast error being displayed periodically on the login page (xwidow didn't launch and the text login is displayed) you've to install the vmware tools to resolve this.

16.  Right click on the vm in the VMW9 dialog and select Install VMware Tools (complete guide is available here.)

17. I basically did the following steps after logging in as root user:

mount /dev/cdrom /mnt/cdrom

cd /tmp

tar zxpf /mnt/cdrom/VMwareTools-5.0.0-<xxxx>.tar.gz

umount /dev/cdrom

cd vmware-tools-distrib

./vmware-install.pl
 

Respond to the configuration questions and press Enter to accept the default values.

18. Exit and reboot the vm from something like : shutdown -r now

19. The vm should reboot now, you might still get kernel warning most probably because some the vmware tools are supported on 2.6 kernel and the kernel on my physical server is 2.4. Now the x login screen should come up unless you had some other settings under /etc/initd file. 

20. Enjoy your new VM :) and be a Virtualization god in the Eyes of your peers ;)