This week I've been mostly migrating guests from Xen to KVM. This has been a a pretty painless process, and I'm happy with the progress.
The migration process is basically:
- Stop the Xen guest (domU).
- Mount the filesystem (LVM-based) upon the Xen host (dom0).
- Copy those mounted contents over to a new LVM location upon the KVM host using rsync.
- Patch the filesystem once the rsync has been moved:
- Create /dev nodes for the new root & swap devices.
- Update /etc/fstab to use those devices.
- Fiddle with routing to ensure traffic for the guest arrives at the KVM host, rather than the Xen host.
- Hardwire static routes on the dom0 so that cross-guest traffic works correctly.
- Boot up the new guest, and hope for the best.
The main delay in the migration comes from the rsync step which can take a while when there are a lot of small files involved. In the future I guess I should ask users to do this themselves in advance, or investigate the patches to rsync that let block devices be transferred - rather than filesystem contents.
Thankfully all of the guests I've moved thus far have worked successfully post-migration, and performance is good. (The KVM host is going to be saturated with I/O when the rsyncing of a new guest is carried out - so I expect performance to dip while that happens, but once everybody is moved it should otherwise perform well.)
So Xen vs. KVM? Its swings and roundabouts really. In terms of what I'm offering to users there isn't too much difference between them. The only significant change this time round is that I'll let users upload their own kernel and one brave soul has already done that!
ObFilm: Pitch Black
Tags: kvm, xen 13 comments
Hello Steve,
Am I right to assume the Xen guests (domU) you're migrating were previosuly created using xen-tools ?
If so, could you please tell us if at least some of these guests were using kernel initrd images hosted within the host (dom0) ?
I've some old Debian based Xen guests which were created using a very old xen-tools. These ones are using kernel initrd hosted outside the guest itself, inside the host (dom0) machine.
Have you got ny of these and, if so, have you got any non-common/strange issues while migrating them ?