Migrate XEN to KVM

Before you start to migrate xen to KVM, make sure that:

Change modules from:

xenblk xennet

to

virtio_blk virtio_pci virtio_net virtio_ballon

Copy KVM Image and Convert to KVM

Get a list of all XEN VMs:

xe vm-list

Copy one VM via ssh to another host:

xe vm-export uuid=<uuid> filename= | ssh -c blowfish -C <user>@<host> 'dd of=/path/vmname.xva'

Use the following script: http://www.robotics.net/wp-content/uploads/xenmigrate.py

Extract the the file with:

tar xvf vmname.xva

You should have a directory like:

---------- 1 root root   30251 Jan  1  1970 ova.xml
drwxr-xr-x 2 root root 1527808 Feb 24 11:10 Ref:5

Convert it with:

python xenmigrate.py --debug -–convert=Ref\:5 {image}.img

Now you can import the image with:

virt-install --name={image] --cpuset=auto --ram=2048 --network bridge=br123 --disk=/dev/vg/example --vnc --vnclisten=0.0.0.0 --noautoconsole --cdrom=/win2k8.iso