VMware Cloud Community
pprajapati
Contributor
Contributor

Converting a Cent OS xen vm to esxi

I converted a Cent OS VM on Xenserver to ESXi 5.0 using VMware converter. when i try to boot up the VM in esxi, i get the attached error.centos.PNG

0 Kudos
18 Replies
TonyNguyen
Enthusiast
Enthusiast

Do you convert to the VMWare Infrastructure or VMWare Workstation format?

Also, what version of VMWare Converter did you use?

In general, I've found a good catchall to solve problems post conversion is to use the OVF Tool. Download the VMWare OVF tool, convert the VMX to a OVF template and deploy in vCenter. Seems to work everytime.

Hope this helps. Smiley Happy

0 Kudos
pprajapati
Contributor
Contributor

I converted to the VMware infrastructure. I used VMware converter 5.0

I will the suggestion you made and let you know.

Thanks

Sent from my HTC smartphone on the Now Network from Sprint!

0 Kudos
TonyNguyen
Enthusiast
Enthusiast

To use the OVF, try converting to workstation if doing the vsphere conversion doesn't work. The OVF file will use the vmx files and disks as the source input.

Hope it helps!

0 Kudos
continuum
Immortal
Immortal

Why do you think OVF will help here ?
That would just be a completely unnecessary extra step - good idea if you get paid per hours..

The problem here obviously is the re-configuration of the guest - and maybe also the use of a XEN enabled kernel.
For this problem OVF will be no help at all.

Also an export with Converter to Workstation is not an option for Linux - Linux VMs must be directly imported to ESXi as only on ESXi targets the reconfiguration procedure works.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
pprajapati
Contributor
Contributor

Then is there something called VMware kernel like xen kernel

Jus wondering as the error says about xen kernel.

Sent from my HTC smartphone on the Now Network from Sprint!

0 Kudos
cyclooctane
Enthusiast
Enthusiast

This is a grub error.

It has nothing to do with the method of V2V that was used

Error 13 (according to the man pages) is as follows

"13 : Invalid or unsupported executable format
This error is returned if the kernel image being loaded is not  recognized as Multiboot or one of the supported native formats (Linux  zImage or bzImage, FreeBSD, or NetBSD)."

In all likelihood it is being caused by the line

kernel = /vmlinuz-2.6.18-194.17.4.el5xen


Grub can not find this kernel

This could be for several reasions.

Option 1. The name of the kernel is wrong. (since this is a xen kernel this would not supprise me)

Try editing the line in the grub boot loader and remove the "xen" from the end of it.

Option 2: Grub is looking in the wrong place on the file system for the kernel.

Again there is a good chance that this was caused by the V2V, possibly changing the partition numbers.

To fix this one

Try running the following at the grub prompt

grub > find /vmlinuz

This should display the something like the following.

(hd0,0)

Note that if it is different use what grub shows, it should be in the format (hd,X,Y)

Next to get the full name of the kernel type

"grub > null (hd0,0) /vmli" and press TAB

This should output something like the following

  Possible files are: vmlinuz vmlinuz-2.6.18-194.17.4.el5, vmlinuz-2.6.18-194.17.4.el5xen

Lets say for this segment that the kernal is called (again use the grub output from the prevous line to gude you)

/vmlinuz-2.6.18-194.17.4.el5

Now that you know the full name try typing the following

grub > root (hd0,0)

grub > kernel = /vmlinuz-2.6.18-194.17.4.el5 root=/dev/VolGroup00/LogVol00

grub > boot

This should boot the system (hopefully as long as nothing else it wrong)

I hope this helps

Once you are up and running you will need to reconfigure grub.

There is plenty of data on google showing how to do this.

Regards

Cyclooctane

0 Kudos
pprajapati
Contributor
Contributor

Sorry if I'm being a noob... But how do I get into grub? Do I have to do this by booting the old machine up in xenserver?

Sent from my HTC smartphone on the Now Network from Sprint!

0 Kudos
pprajapati
Contributor
Contributor

Figured it out. Will post the results soon

Sent from my HTC smartphone on the Now Network from Sprint!

0 Kudos
pprajapati
Contributor
Contributor

This is what i get when i run 'grub > find /vmlinuz'

"Error 15: File not found"

what do i do?

0 Kudos
cyclooctane
Enthusiast
Enthusiast

Sorry

I forgot that grub does not support wild cards in the prompt. (or I can not remember how to use them)

Any way when you type

find /vmlinuz

at the prompt, press TAB

This should auto complete the line.

Then press enter.

That should work.

Also you will get an

Error 27: Unrecignized command

when you run

"grub > null (hd0,0) /vmli" and press TAB

However the autocomplete should work and you will get the name of the file anyway.

The rest of the list should then work fine.

I just tested it on a centos 5 system (that uses the same version of grub) and it works fine.

I just hope that the V2V will not cause driver issues.

Regards

Cyclooctane

0 Kudos
pprajapati
Contributor
Contributor

Below is the error I get now

cid:image001.png@01CD958C.D68FC9C0

Thanks,

Pratik Prajapati

0 Kudos
cyclooctane
Enthusiast
Enthusiast

I will look into this and try and replicate the problem.

Regards

Paul Duncan

0 Kudos
pprajapati
Contributor
Contributor

I was able to finally figure it out!

I had to go into linux rescue mode, set the IP and then ssh into the vm.

Then, I had to modify few lines under /etc/inittab and then install a regular linux kernel.

Uninstall Xen kernels, shut down the vm and boot it normally. Then remove the citrix .repo file and install vmware tools.

All good!

Thanks a lot for your help. Let me know if you need further details.

Thanks,

Pratik Prajapati

0 Kudos
cyclooctane
Enthusiast
Enthusiast

So it was most likely a driver issue with the kernel drivers then.

(since you had to modify /etc/inittab and install the normal kernel)

I will make a note that ESXI does not like xen kernels.

Anyway, great to know that it works.

I am happy to help if anything else comes up.

Posting what you did to the /etc/inittab here would most likely help someone who has the same problem.

Regards

Cyclooctane

0 Kudos
pprajapati
Contributor
Contributor

Sure. Below is what I did in /etc/inittab

Modify /etc/inittab by adding a hash in front of the line containing the xen console(line 45) and make it look like below. I

uncommented 3 ttys:

  1. Run gettys in standard runlevels

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

1:2345:respawn:/sbin/mingetty tty1

2:2345:respawn:/sbin/mingetty tty2

3:2345:respawn:/sbin/mingetty tty3

#4:2345:respawn:/sbin/mingetty tty4

#5:2345:respawn:/sbin/mingetty tty5

#6:2345:respawn:/sbin/mingetty tty6

Thanks,

Pratik Prajapati

0 Kudos
mleo963
Contributor
Contributor

At work, I have been tasked with migrating our existing Xen Linux guests (RH on RH) to a new VMWare environment.

Since I have yet to find a very comprehensive procedure, I thought I'd write one.

This is a work in progress and as I fine tune the procedure I will update, but for those needing to do it, this should work for you:

How to Convert a Xen Linux Guest to VMWare

These are the high level to-do’s that are ahead of you. Please do not use this part of the guide to do the conversion, it is only a synapses of what you are in for.

Step 1: prep the source Xen guest for remote root/password access
Step 2: run the VMWare conversion process (confirm “new” disks are up to new standards)
Step 3: change nic to vmxnet3 in new VMWare guest settings
Step 4: boot the newly created VMWare guest off a Linux live CD; configure network
Step 5: mount converted file systems; chroot into this environment
Step 6: edit inittab; modprobe.conf
Step 7: install non-xen kernel version insuring the SAME kernel version
Step 8: edit grub.conf
Step 9: install vmware tools
Step 10: fix remote root/password access; reboot
Step 11: test test test. re-test.

Tools you need or need access to:
VMWare virtual center with permission to create new guests.
VMWare converter.
Access to Xen source as root.
Access to Linux live CD media (typically already on a data store).
Fairly good knowledge of Linux command line tools and VMWare.

Step by step:

Step 1:
For the conversion process to work, the VMWare converter needs remote root/password access to the Xen guest you are converting.

Change the root password to something new and unique. DO NOT use the default root password during this process.

Note the current xen kernel version for use later.

Step 2:
Access VMWare Converter via client or direct log on to converter server.

Select live OS

Enter hostname, root and password. Feel free to review source machine to insure proper access.

Enter VC credentials.

Select proper cluster.

Select proper storage.

Make sure to convert only those files systems that are required (no NAS mounts for instance).

Make sure NEW file systems adhere to any new or updated policy regarding size. Adjust accordingly.

Select the option to configure the network using a unique IP (unless your server network uses DHCP) and NOT the source machines IP.

IF THIS IS A REAL CONVERSION AND NOT JUST A TEST: Make sure to select the option to power off the source Xen machine (leave the new machine off as well).

Run the conversion process.

Connect to VC, open the console of the new VMWare machine that the conversion process is creating.

NOTE: for some reason (a bug?), the NEW “helper” VM sometimes cannot get on the network on its own. You must log into it as root using the temp password you created on the source Xen machine, and ping something off the network. This will kick start the networking and you should now see the converter doing its thing.

NOTE: In order to access the new "helper" VM that the converter creates, you must first configure the converter itself to allow such a thing, BEFORE you begin this process. I'll link to those instructions when I find them again. This change will allow you to log into the helper VM using the source Xen credentials.

Enjoy an espresso or two while you wait.

Step 3:

Once done, both the source Xen machine and the new VMWare machine should be powered off automatically.

IF THIS IS A REAL CONVERSION: Disable the source Xen network configuration to insure it doesn’t come back on the network. This process documented elsewhere.

Re-configure the new VMWare machine to use the vmxnet3 nic driver (remove existing e1000 and add a new vmxnet3 nic), and also point the CDROM to a Linux live CD of your choice (I’ll use Fedora in this document).

Also change the boot option delay to at least 10ms (or higher) to make your life easier.

NOTE: The new VMWare guest WILL NOT boot up in its existing condition. This is a known problem we are about to address.

Step 4:

Boot the new VMWare machine via the Linux live CD.

Configure the live CD network with any available IP (the source Xen IP is fine to use here if you are on the same network obviously).

Step 5:

From the Linux live cd, mount the guest file systems (the specifics will depend on what your source Xen machine looked like):
open a terminal:
$ su - (no password is needed on the Fedora live cd)
# mkdir /mnt/server
# mount /dev/mapper/vgroot-lvroot /mnt/server
# mount /dev/sda1 /mnt/server/boot
# mount /dev/mapper/vgroot-lvusr /mnt/server/usr
# mount /dev/mapper/vgroot-lvopt /mnt/server/opt
# mount /dev/mapper/vgroot-lvvar /mnt/server/var
# mount --bind /dev /mnt/server/dev/

chroot into this environment:
#chroot /mnt/server

mount proc:
#mount /proc /proc -t proc

Step 6:

Edit /etc/inittab and comment out the Xen console line:
(At my office, the first getty line is co:blahblahblah, which is the Xen console. You don't need this so comment it out)

Edit /etc/modprobe.conf to include new scsi driver and vmxnet3 driver:
This is key. Xen uses a different scsi controller than vmware.
Comment out the xenblk line and make sure you have:
alias eth0 vmxnet3 ---- the recommended vmware nic driver
alias scsi_hostadapter mptbase ----- the recommended vmware scsi adapter
alias scsi_hostadapter1 mptspi ----- the recommended vmware scsi adapter

Step 7:

Install non-Xen version of the SAME kernel as the source Xen machine (you can look at /boot and /boot/grub/grub.conf for which kernel if you didn’t note this in Step 1 as instructed):

# yum install kernel-XXXXXXXXXXXX


Step 8:

Edit grub to make this new kernel the default:
default=(what ever line your new non-Xen kernel is

Step 9:

From the VC client, choice to “Install VMWare tools” for this machine.

Mount the CDRom (again, this is from within the chroot'd environment):
# mkdir /media/cdrom
# mount /dev/cdrom /media/cdrom

Explode the vmware-tools installation files:
# tar -zxvf /media/cdrom/YYYYYYYY -C /var/tmp/

# cd /var/tmp/YYYYYYYYYY

run the installer:
# ./vmware-install

Pick all default answers.

You may have to pick a screen size IF x-server is installed on this guest already.

Pick 1024x768 unless you know a reason not to.

Step 10:

fix the sshd config file (if you normally dis-allow remote root access) and change the root password back to the current one.

reboot.

Step 11:

Test access; test for proper kernel version; test; test; test; test.

0 Kudos
ereal
Contributor
Contributor

I've converted a RHEL5 vm to VMware but can't configure network to install non-xen kernel.

At Step 4: boot the newly created VMWare guest off a Linux live CD; configure network

1. boot from cd, linux rescue

2. chroot /mnt/sysimage

3. configured eth0 with static IP

But the HWADDR in eth0 is not a VMware mac. The mac address on the settings on the vm is a VMware mac and even checked its .vmx file to double check. I've edited eth0 to reflect the VMware mac I see in both the UI of the vm settings and its .vmx file. When I try to bring the device/interface up i get this error: Device eth0 has different MAC address than expected, and can't start network service

eth0.JPG

0 Kudos
ereal
Contributor
Contributor

Because I couldn't figure this out, I ended up mounting the CD and running the update which in turn installed the needed nonxen kernel and presented the needed nic.

0 Kudos