Moving a XEN domU to a new server
Note In order to ease reading the LVM-vg is called vg_raid on newhost and vg_main on oldhost
Create logical volumes on the newhost
newhost# lvcreate -n <hostname>-disk -L <disk-size-in-gig>g vg_raid newhost# lvcreate -n <hostname>-swap -L <swap-size-in-meg>m vg_raid
Shutdown the domU on oldhost
oldhost# xm shutdown <hostname>
Copy the data
oldhost# dd if=/dev/vg_main/<hostname>-disk bs=1k | ssh -C <newhost> dd of=/dev/vg_raid/<hostname>-disk bs=1k
Copy the configuration file
oldhost# scp /etc/xen/<hostname>.cfg <newhost>:/etc/xen/
if newhost is running Lenny you need to move the etch kernel as well
oldhost# scp /boot/*2.6.18-6-xen-686 <newhost>:/boot
Do a file system check
newhost# e2fsck -f /dev/vg_raid/<hostname>-disk
edit /etc/xen/<host>.cfg
and change vg_main to vg_raid
Start domU and handle swap
newhost# xm create <host>.cfg -c domU# mkswap /dev/sda2 domU# swapon -a