Migration from Debian Lenny or Etch Xensource VM (LVM) to KVM (LVM)
Heres is a quick info on how to migrate a Debian Lenny or Etch xensource 3.0.1 VM stored in an LVM to KVM.
NB : Maybe some of you won't find that "elegant"...but it works
NB : on my Xen version I was unable to run amd64 linux versions, so I had to install a x86 VM under KVM
In my case, the main problem is the kernel used by the VM (called DomU) is located on the host (Dom0) and this kernel is a xen one... 2.6.18.4-xen for example.
I don't want this kernel under KVM (I'm even not sure it could work).
So we'll have to install under PVE a debian machine, keep it's /boot, /lib/modules/versionkernel directories and /etc/fstab
once the machine is installed, we may :
* clear all the partition but /boot,
* restore the backup from XenSource
* copy /etc/fstab and /lib/modules/versionkernel
* eventually modify the VM conf to have the same MAC address
I've done it successfully for Etch and Lenny Xen Dom0 migrations.
For Etch, I've installed a Lenny businesscard, it doesn't matter as far as we'll keep only fstab and /lib/modules/2.6.22 dir
I did it this way :
* Install under Proxmox VE a debian machine with the same total disk space (or less if you want..juste have enough GB to store all your data)
# create the same LVM as you had under Xen (if you want...)
# install no packages at all
# stop the machine when the installation is done and the VM is rebooting.[/INDENT]
* backup the data :
# on the Dom0 : stop the Dom0
# make a tar.gz of every LV used by the debian DomU and send it to a location seen by the Proxmox VE server.
remember you don't need to backup the /boot as far as we'll use the one we've installed...
* Restore the data
# on the PVE server: mount the VM disk(s) in a directory and make a backup of /etc/fstab and /lib/modules/yourkernelversion => you'll need it later
# rm -Rf of the VM disks
don't delete /boot!!!! and untar your Xen backup to the correct location
# replace the restored /etc/fstab with the one you've backuped from the VM
# restore the previously saved /lib/modules (you can delete the old xen ones)
# modify the MAC address in the PVE GUI to give the same as it was when the VM was under Xen...
you can start your VM...it should work
Don't forget to tell Xen not to start the old DomU anymore
Don't hesitate to report any issue..In case I forgot to note down some steps...
NB : if you think it could be useful to put it in the Wiki..I can do it