Using VMware Converter to Convert Physical Linux Servers to Virtual Machines
July 23, 2012
Image Source
Article Source
While much of the work I do is focused around Windows, I also manage a number of Linux servers as well (primarily CentOS). Recently at my place of employment we underwent a fairly major project, virtualizing 90% of our systems. In the process of doing so we ran into a number of different problems, one of which was an issue where ESXi was not properly installing the disk drivers for the created VMs.
In my search to find a solution to this, I came across a great post here which got me 80% of the way there however, there were still a number of other things that needed to be updated/changed to get things to work 100%. The post was written for ESXi 4.0 and I was performing these migrations using ESXi 4.1 and 5.0, so that may be have been the reason for the differences.
In any case, the step-by-step instructions for what needed to be done to get things working is below:
#Boot to Linux Rescue
Mount CentOS disc 1 and boot from disc, then enter Linux Rescue
##Start network interfaces?
No
##Allow rescue environment to find Linux installation
Choose “Continue”
##Chroot to the mounted image
chroot /mnt/sysimage
#Configure SCSI driver that will work
vi /etc/modprobe.conf
alias scsi_hostadapter mptscsih
(Delete any other adapters listed)
##Save modified modprobe.conf
Esc > :wq
#Load SCSI device
##Check CentOS kernel version
cat /etc/grub.conf
vmlinuz-2.6.18-308.8.2.e15
##Load the SCSI device
mkinitrd -v -f –preload mptbase –with=mptbase /boot/initrd-2.6.18-308.8.2.el5.img 2.6.18-308.8.2.el5
#GRUB
##Check grub.conf file
vi /boot/grub/grub.conf
##Ensure kernel file looks similar to below
kernel /vmlinuz-2.6.18-308.8.2.el5 ro root=/dev/sda3
##Exit the file (without changes most likely)
Esc > :q
##Open grub
grub
## Install mkinitrd package into the GRUB partition
grub> root (hd0,0)
(stuff snipped)
grub> setup (hd0)
(more stuff snipped)
##Exit GRUB
quit
#FSTAB
##Check fstab file to ensure swap to tell Linux where the swap file lives
vi /etc/fstab
##(something similar to below needs to be there)
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
##Exit the file (without changes most likely)
Esc > :q
#Reboot system
exit
exit

3 Responses to Using VMware Converter to Convert Physical Linux Servers to Virtual Machines
Hi,
I’m not able to do this, seems like we have more then one version on the same machine, and when I make the command “mkinitrd -v -f –preload mptbase — with=mptbase /boot/initrd-2.4.21-37.elsmp.img 2.4.21-37.elsmp” I get the error: /lib/modules/2.4.21-37.elsmp is not a directory.
Can you please help?
If you can I’ll be much appreciated.
Thanks a lot
I’m not 100% on your exact issue, but make sure you are typing everything 100% correctly as I ran into that issue the first time I tried to get this to work.
Also remember that many things on Linux are case sensitive. I’m not sure if this would fall under that but perhaps it should be ELsmp.img rather than elsmp.img?
Yes, it was a case sensitive issue.
Worked preaty cool for me.
Thanks a lot
Very much appreciated