Admin/SetupGuides/migrate-xen-vm-to-new-host

#On new dom0 Make changes, set the right size disk
vi /etc/xen-tools/xen-tools.conf

#On new dom0 Pick a free IP, and create VM
xen-create-image --hostname walle-vm05 --ip 193.1.99.93 --vcpus 2

#On the new dom0 Xen server: Set netcat to listen and point to the correct disk
nc -l -p 7000 | dd of=/dev/vg1/walle-vm05-disk bs=2M

#On the old dom0 do the following. Point to new dom0 IP
dd if=/dev/mapper/bendervg-vm04 bs=2M | nc 193.1.99.98 -q 10 7000

#Ends.
#The rest is done on the new dom0

mount /dev/vg1/walle-vm05-disk /mnt/
mkdir /mnt/boot/grub
vi /mnt/boot/grub/menu.lst
default         0
timeout         2

title           Debian GNU/Linux 6.0
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.32-5-xen-686 root=/dev/xvda2 console=hvc0 xencons=tty ro
initrd          /boot/initrd.img-2.6.32-5-xen-686

title           Debian GNU/Linux 6.0 (Single-User)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.32-5-xen-686 root=/dev/xvda2 ro single
initrd          /boot/initrd.img-2.6.32-5-xen-686

vi /mnt/etc/securetty
#make sure the following is there
hvc0
vi /mnt/etc/inittab
#make sure the following is there
co:2345:respawn:/sbin/getty 38400 hvc0

umount /mnt/

vi /etc/xen/walle-vm05.cfg
#Change IP to be correct

ln -s /etc/xen/walle-vm05.cfg /etc/xen/auto/

xm create -c /etc/xen/walle-vm05.cfg

last edited 2012-01-12 01:23:47 by 089-101-247164