PDA

View Full Version : XenServer to VMware (Debian Squeeze)


edge
11th July 2012, 09:43
I've got a XenServer VM what I would like to convert to VMware.
This can "in theory" be done with "VMware vCenter Converter Standalone Client".

In theory...

When you run the Converter as is, it will give an error when 99% is done of the converting. FAILED: An error occurred during the conversion: 'GrubInstaller::InstallGrub: /usr/lib/vmware-converter/installGrub.sh failed with return code: 127, and message: Installing GRUB1 on (hd0)... /vmware-updateGrub.sh: 59: grub:
not found Error installing GRUB Error running vmware-updateGrub.sh through chroot into /mnt/p2v-src-root '

Basically the error is caused because the NEW layout responce string from: grub-install -v (grub-install (GRUB) 1.98+20100804-14+squeeze1)
The converter does not recognize the responce.
It should be: grub-install (GNU GRUB 1.98+20100804-14+squeeze1)

To fix this I added the following to /usr/sbin/grub-install:

if [ $# -eq 1 -a "$1" = "-v" ] ; then
echo "grub-install (GNU GRUB 1.98+20100804-14+squeeze1)"
exit 0
fi

Now when running the converter I get the following error:FAILED: An error occurred during the conversion: 'GrubInstaller::InstallGrub: /usr/lib/vmware-converter/installGrub.sh failed with return code: 1, and message: Installing GRUB2 on (hd0)... /usr/sbin/grub-setup: error:
no such disk. Error installing GRUB Error running vmware-updateGrub.sh through chroot into /mnt/p2v-src-root

Unfortinatly running the created VM I get the error:Error loading operating system_

When I boot from CD into rescue mode, I do see all the files
I guess that the only problem is Grub.
Now how do I reinstall Grub, and where should it be installed?
Using the Reinstall GRUB boot loader option from the rescue option does not fix the problem.

Anyone here who might know how and where to install the GRUB boot loader?

edge
11th July 2012, 10:17
Some more info from the converted VM:

#fdisk -l

Disk /dev/sda: 42.9 GB, 42945347584 bytes
2 heads, 82 sectors/track, 1497814 cylinders
Units = cylinders of 56 * 512 = 28672 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x090631c4

Device Boot Start End Blocks Id System
/dev/sda1 * 3 149776 41937664 83 Linux

Disk /dev/sdb: 1070 MB, 1070465024 bytes
52 heads, 32 sectors/track, 1256 cylinders
Units = cylinders of 1664 * 512 = 851968 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6ffad3af

Device Boot Start End Blocks Id System
/dev/sdb1 1 1256 1044224+ 82 Linux swap / Solaris
#

And.

# cat /boot/grub/menu.lst
..
..
..
title Debian GNU/Linux, kernel 2.6.32-5-686-bigmem
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-5-686-bigmem root=/dev/xvda1 ro console=hvc0 quiet
initrd /boot/initrd.img-2.6.32-5-686-bigmem

title Debian GNU/Linux, kernel 2.6.32-5-686-bigmem (single-user mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-5-686-bigmem root=/dev/xvda1 ro console=hvc0 single
initrd /boot/initrd.img-2.6.32-5-686-bigmem

title Debian GNU/Linux, kernel 2.6.32-4-686-bigmem
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-4-686-bigmem root=/dev/xvda1 ro console=hvc0 quiet
initrd /boot/initrd.img-2.6.32-4-686-bigmem

title Debian GNU/Linux, kernel 2.6.32-4-686-bigmem (single-user mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-4-686-bigmem root=/dev/xvda1 ro console=hvc0 single
initrd /boot/initrd.img-2.6.32-4-686-bigmem

title Debian GNU/Linux, kernel 2.6.26-2-686-bigmem
root (hd0,0)
kernel /boot/vmlinuz-2.6.26-2-686-bigmem root=/dev/xvda1 ro console=hvc0 quiet
initrd /boot/initrd.img-2.6.26-2-686-bigmem

title Debian GNU/Linux, kernel 2.6.26-2-686-bigmem (single-user mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.26-2-686-bigmem root=/dev/xvda1 ro console=hvc0 single
initrd /boot/initrd.img-2.6.26-2-686-bigmem

### END DEBIAN AUTOMAGIC KERNELS LIST
#

falko
12th July 2012, 10:41
Have you tried to run grub-install from the rescue system?

edge
12th July 2012, 13:14
Yes I did, and I get:
#grun-install
install_device not specified
Usage: grub-install [OPTION] install_devide
Install GRUB on your drive.

...
...
...

#
I guess that it needs to be installed on /dev/sda1, but I need to be sure before I do so, as creating a new VM of the system takes about 4 hrs.

Also.
ON the Xenserver the Disk's are named different than on this VM.
I'm not sure if this will cause a problem?

This VM the are (see also 2nd post):
/dev/sda1 (set to boot)
/dev/sdb1

On the Xenserver they are:
/dev/xvda1 (set to boot)
/dev/xvdb1

host:~# fdisk -l

Disk /dev/xvdb: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x86a2ed46

Device Boot Start End Blocks Id System
/dev/xvdb1 1 130 1044193+ 82 Linux swap / Solaris

Disk /dev/xvda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000dc2c6

Device Boot Start End Blocks Id System
/dev/xvda1 * 1 5221 41937651 83 Linux
host:~#

So.... It's "grub-install" .... ????

falko
13th July 2012, 16:34
Should be either
grub-install /dev/sda
or
grub-install /dev/xvdaIf the device doesn't exist, the system will tell you. I'd try this on a copy first.

edge
13th July 2012, 17:10
Hi falko.. Thank you for your time on this.

Okay.

#grub-install /dev/xvda
/usr/sbin/grub-probe: error: cannot start `dev/xvda'.
#grub-install /dev/sda
Installation finished. No error reported
#

After this I reboot, and it does show the installed kernals (looking good so far)
Then.. When I select one I get the following error.

error: no such device: 23f86d60-263c-4a2b-b28d-dd4093a22677.
Loading Linux 2.6.32-5-686-bigmem ...
Loading initial ramdisk ...

After this the VM does do nothing anymore.. (looks like it's hanging)

So close... But still so far away :-(

falko
14th July 2012, 17:51
What's in /etc/fstab? Can you try to use device names instead of UUIDs?

edge
14th July 2012, 19:09
What's in /etc/fstab? Can you try to use device names instead of UUIDs?

fstab looks like this:


proc /proc proc default 0 0
/dev/xvda1 / ext3 errors=remount-ro,usrquota,grpquota 0 1
/dev/xvdb1 none swap sw 0 0

I've also tested this, but with no luck (same error)
proc /proc proc default 0 0
/dev/sda1 / ext3 errors=remount-ro,usrquota,grpquota 0 1
/dev/sdb1 none swap sw 0 0

When I boot the "single-user mode" kernel I get this:Decompressing Linux... Parsing ELF... done.
Booting the kernell
_

After this the VM just sits there.. (looks like hanging)
I'm about to give up on this...

falko
15th July 2012, 14:00
Hm... I'm running out of ideas as well... :(

edge
15th July 2012, 16:31
Fu***t....

I'm going to do a new "clean" install, and move all the accounts from the Xenserver VM to the new VMware vSphere VM!

Does this trick still work to do the moving from one ISPconfig server to an other?

http://www.howtoforge.com/forums/showthread.php?t=57640

falko
16th July 2012, 16:47
Does this trick still work to do the moving from one ISPconfig server to an other?

Yes, the procedure is still valid.

johjoh2k
16th July 2012, 17:50
If you want to try, this sequence worked for me:
- shutdown the VM in XenServer
- Export it somewhere so you can work on the VHD Virtual Hard Disk File (I have build an NFS Virtual OpenFiler on the new server and connected to both virtualization server)
- with the aid of http://www.winimage.com/ Professional, under "Disk" you can find "Convert Virtual Hard Disk Image"
- convert to VMDK

Good luck! :D

edge
16th July 2012, 23:25
If you want to try, this sequence worked for me:
- shutdown the VM in XenServer
- Export it somewhere so you can work on the VHD Virtual Hard Disk File (I have build an NFS Virtual OpenFiler on the new server and connected to both virtualization server)
- with the aid of http://www.winimage.com/ Professional, under "Disk" you can find "Convert Virtual Hard Disk Image"
- convert to VMDK

Good luck! :D

Okay. I've used winimage to convert the ".xva" to a ".vmdk".

Now how do I get this into VMware?

I uploaded it to datastore [datastore1], and created a new VM.
When asked "Select a Disk" I used the option "Use an existing virtual disk.....", and selected the ".vmdk".
Unfortunately this did not boot...


Did I do something wrong here?

johjoh2k
17th July 2012, 02:15
Yes VMDK exported by WinImage it's an old format of VMDK (4 if I remember correctly)
Now with VMware converter convert from VMDK to Vsphere ;)

edge
18th July 2012, 01:17
Hmmmm.

My VMware converter does not have the option to convert from VMDK to Vsphere!

Are you talking about the "VMware vCenter Converter Standalone Client", or some other VMware converter?