If you want to unify your vm plantform,This article will give you some help.I just make a experiment from xen to vmware,I am simply opening the subject for discussion.
We have two kind of methods,one is using a tool named Vmware-Converter,You can download it from vmware official website.It is easy to operate.But it has many limits,I think the best efficient way is manual migration.So let's talk about it.
Source server: centos 6.1 ip:192.168.0.100 xm vm.
Destination server: Esxi5.1 create a clone system ip:192.168.1.100
1.Install a newest kernal on source server,
#yum search kernel #yum list kernel #yum install kernel.x86_64
After installing,check the kernal file below boot directory
#ls /boot/ System.map-2.6.18-164.6.1.el5xen message System.map-2.6.18-348.12.1.el5 symvers-2.6.18-164.6.1.el5xen.gz config-2.6.18-164.6.1.el5xen symvers-2.6.18-348.12.1.el5.gz config-2.6.18-348.12.1.el5 vmlinuz-2.6.18-164.6.1.el5xen grub vmlinuz-2.6.18-348.12.1.el5 initrd-2.6.18-164.6.1.el5xen.img xen-syms-2.6.18-164.6.1.el5 initrd-2.6.18-348.12.1.el5.img xen.gz-2.6.18-164.6.1.el5
2.install nc command for copy files
yum install nc
3.Create a centos system on esx with vmware sphere wizard,and don't install system,We just want this empty disk.
4.And finally boot up from livecd.assign an ip address which is 192.168.0.100
5.Make partition
You can make logical volume or not.
I divide three partition, boot partition 200MB,LV swap 2048MB, LV / the left space.
So sda1 is boot partition,sda2 is PV
pvcreate /dev/sda2 vgcreate vgname /dev/sda2 lvcreate -l 2048 -n lvname_swap vgname lvcreate -l xxx -n lvname_root vgname mkfs.ext3 /dev/sda1 mkswap /dev/vgname/lvname_swap mkfs.ext3 /dev/vgname/lvname_root
6.copy files
#mkdir /mnt/sysp_w_picpath #mount /dev/vgname/lvname_root /mnt/sysp_w_picpath #cd /mnt/sysp_w_picpath #mkdir boot #mount /dev/sda1 /mnt/sysp_w_picpath/boot
start a receive client on destination server
#nc -l 1234 | tar zxvf -
start a sender on source server
#tar czvf - ./ --exclude ./sys --exclude ./proc --exclude ./lost+found | nc 192.168.1.100 123
Please wait for a moment until complete
7.Configuration
1)#chroot /mnt/sysp_w_picpath 2)#vi /etc/fstab ( select which partition will be load ) Notice lvm partition /dev/sda1 /boot ext3 defaults,errors=remount-ro 0 0 /dev/mapper/vg_bjwiki-lv_root / ext4 defaults 1 1 /dev/mapper/vg_bjwiki-lv_swap swap swap defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 proc /proc proc defaults 0 0 3)#cat /dev/null >/etc/modprobe.conf 4)#vi /etc/inittab (delete a line that is xvc0:2345:respawn:/sbin/mingetty xvc0 )
5)Grub edit #sed -i "s/default=1/default=0/g" /boot/grub/grub.conf #delete /boot/grub/grub.conf console=xvc0 # cat grub.conf
default=0
timeout=5
splashp_w_picpath=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-131.0.15.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-131.0.15.el6.x86_64 ro root=/dev/mapper/vg_bjwikitest-lv_root rd_LVM_LV=vg_bjwikitest/lv_root rd_LVM_LV=vg_bjwikitest/lv_swap
initrd /initramfs-2.6.32-131.0.15.el6.x86_64.img
#grub-install /dev/sda1 #mkinitrd -v -f /boot/initrd-2.6.18-348.12.1.el5 2.6.18-348.12.1.el5
7)network ip
8.reboot,and update system,reset some services
转载于:https://blog.51cto.com/mianhuhu/1279573