8

I've recently been appointed to create some VMs for production use, and went gung ho into making a KVM based VM instead of finding out what our production server uses.

I've only recently found out though that our own servers use Xensource OS, and don't look like they're going to be upgraded in the near future. So for the moment, I'm stuck with either two choices- attempting to convert the KVM VM into a Xen VM, or rebuilding what I have into a new Xen VM.

Being the lazy person I am, I would rather not have to rebuild the VM. I've looked for some documentation on a procedure to do this, but the only thing I can come up with is an ancient article with some vague instructions.

So this is my question, Server Fault- can one migrate a KVM running on a KVM kernel to a Xen kernel? And if so, how?

qweet
  • 731
  • 5
  • 11

2 Answers2

1

The short answer is that it is definitely possible.

The longer answer of how depends on how you created you KVM guest. The VM will likely run with little or no modification on Xen.

Can you update to add some more details on how you created the KVM guest and whether it is Windows or Linux etc.?

Also posting the configuration of the KVM guest (for example if it is libvirt) or the command line that you used to start the VM.

It is likely just a matter of making a Xen configuration file that points to the guest disk or image file. It would be helpful for you to also post an example of the domU configuration file that is being used by your Xen install. For example, these configurations are typically stored in /etc/xen/

Can you also clarify which distro you are working with (both for KVM and Xen). Since there are lots of options of how things might be set up. Xen, in particular, has many ways to deploy it (see for example Deploy Xen)

(By the way this is also a great question for the xen-users mailing list - http://lists.xensource.com/mailman/listinfo/xen-users - especially with the clarifications as asked for above)

Todd Deshane
  • 463
  • 2
  • 6
0

Basically this is pretty easy. If converting to XEN I would recommend going straight into PV-mode. In the VM:

  1. Install the XEN-kernel
  2. Change hda or sda to xvda
  3. Boot in in PV mode using pygrub.

If everything works, remove the KVM-kernel.

Nils
  • 7,657
  • 3
  • 31
  • 71