VM streaming export in XenServer

Have you ever wanted to copy a VM to another pool or host?

So far, you have to do this:

  1. export the VM somewhere (on a storage large enough to handle the whole VM size)
  2. import the VM on a new host

Picture of the old solution

And not only this, you need to do it for a halted VM. Or manually make a snapshot of the running VM and then export the VM. Or make a script.

Is it possible to do otherwise? You have Xen Storage Motion, which is great and allow to move a running VM from a host to another, even without shared storage.

What about not moving but making a copy? And what about halted VMs? And all of this without using a large storage to export then import it after?

And also, by scheduling this for opening a nice Disaster Recovery possibility. Oh and with a retention rotating the older copies. With a coffee please.

Is it possible? In fact, it wasn't. Dundee will offer new possibilities on this topic[^n], but on your existing XenServer hosts, you can't do that.

Xen Orchestra to the rescue!

Our solution

Let's recap what you want:

  • create a copy of your VM (running or halted) on another server
  • no intermediate file creation on a shared storage
  • schedule this during the night for example
  • no complicated configuration, should be fully automated
  • have a retention of this copied VM (keep only the 3 latest copies for example)
  • compatible with all XenServer 6.x versions

Remember what we have accomplished with our streaming patching system?

We started to experiment "exporting on one side" and "importing on the other" at the same time, by plugging export output to the import input.

Guess what? It works :D And this is like that now:

Picture of the new solution

That's the first step to a better Disaster Recovery solution. A next article will explain this in details. And it will be out for the 4.9!

[^n]: Xen Storage Motion of halted VMs would be possible, but it's moving a VM, not a copy!