Redhat – Need to Migrate Xen DomU to VMWare ESXi – RHEL 5.3/ESXi 4.1

redhatrhel5vmware-esxixen

I've seen plenty of posts outlining the process of converting VMware Linux serves to RHEL Xen (not xenserver) but nothing much has helped me go the other way. I've tried a number of things including using mkinitrd (works great for LVM) but just can't get it right in this situation. Truth be told, I'm a newb at xm commands but I've gained a lot of ground.

Does anyone care to share the process they've followed to successfully complete this conversion? I have access to two environments currently:

  1. the original xm environment that has two Doms in it
  2. a successful vmware build after running vmware converter that I can boot in rescue mode (but not boot otherwise).

I realize also that XM images aren't bootable and need to overcome this (again I've tried but must be missing a detail).

I'd like to experiment with setting up xm for the conversion before running vmware converter since I feel like I've exhausted the process from the standpoint of linux rescue mode after successfully bringing all data over via vmware converter. (but I'll go either way if I can just get a couple of helpful hints…)

Best Answer

I have recently had to migrate a few centos 5.x VMs across to an ESXi cluster. A couple of things were needed before the VMs would boot.

  • Firstly you will need to ensure the rescue CD can see the hardisks: if you cant see them when you do a fdisk -l then try updating the SCSI controller type to LSI logic SAS.

  • Once you are able to see the disk in the rescue environment allow it to mount all the system partitions read/write when it asks. You will also need a network connection to download packages, so assign details when it asks.

  • If the automatic mounting fails you will need to manually mount the / partition and edit the /etc/fstab. The entres will be something like:

    /dev/xvda2 / ext4 defaults 1 1 change the xvda2 to sda2 or whatever it is in your case.

  • reboot to check that the disks are mounted by the rescue CD. Chroot into the /mnt/sysimage folder edit /etc/inittab you should delete an entry that looks like:

    co:2345:respawn:/sbin/agetty xvc0 9600 vt100-nav

    and ensure there is a correct entry such as:

    1:2345:respawn:/sbin/mingetty tty1 (sometimes this will need to be uncommented)

  • Now you can run a 'yum install kernel' and then create an initrd buy doing a:

    mkinitrd /boot/initrd-2.6.18-194.32.1.el5.img 2.6.18-194.32.1.el5

    replacing the 2.6.18-194.32.1.el5 with name of the kernel that you installed in the last step.

  • Now delete any xen related kernel entries in /etc/grub.conf leaving the newly added non-xen kernel and ensuring it is the default.

  • Exit the rescue environment and boot from hard-disk. With any luck the VM will boot as normal.

Its quite an long process and i might have missed something out, so id be interested in hearing how you get on.

Related Topic