My company needs to automate the creation of new VM's with our proprietary solution, for this we would like to ship the product either on a a standardized format (OVA seems to be the only "standard" out there) or to be able to convert from the same machine to various different Virtualization types.

Thus far this is made manually, meaning that if a client wants a HyperV VM we need to build it on a HyperV Server we have inhouse, VMWare on VMWare etc... Our goal is to have this automated.

Explaining better: The plan is to have a KVM server, provision the VM and after provisioning export it to an OVA Format, and possibly as as extra courtesy to our clients on their Hypervisor of choice.

I can convert the disks just fine with "qemu-img convert" however i cannot seem to convert the machine definition (XML) to to other formats as needed by other hypervisors.

I cannot find any appropriate tools for this, suggestions?

Note: we do not have access to the hypervisor where these will be installed so we need to export it as OVA/TAR etc...

  • OVA is the answer, that's what the standard is there for and it works. – Chopper3 Feb 26 at 18:57
  • So how would one export from libvirt to OVA ? doesnt seem to exist any automated way, or even automateable way of exporting the VM definition. – Onitlikesonic Feb 26 at 19:00

Unfortunately OVA promises far more than it is able to deliver. At best it is a standard format for distributing disk images, but it does very little, if anything, to ensure that a disk image can be booted seamlessly on multiple hypervisors. Every hypervisor emulates a different set of virtual hardware, so guest OS will need different drivers installed for each hypervisor. Some operating systems like Linux are reasonably good are being able to boot with arbitrary hardware, autodetecting drivers to match what they find, but even then its easy to mess up are make it break. eg if your /etc/fstab lists "/" as being on /dev/vda1 disk (for QEMU's virtio-blk disk driver) that's not going to work when booted on VMWare with a SCSI disk that appears as /dev/sda1. Windows is really hard to adapt to different harware as it likes to tightly bind specific drivers to each disk / NIC / etc.

There's also problem that every hypervisor has its own preferred disk image format - VMWare prefers vmdk, QEMU likes raw or qcow2 ideally, VirtualBox has another, etc, etc. OVA does nothing to address any of these hard problems.

These kind of problems are why tools like virt-v2v (http://libguestfs.org/virt-v2v.1.html) exist which take a disk image for one hypervisor and re-configure the guest OS to work on a different hypervisor, changing disk format at the same time.

Even if you somehow build a disk image that you think works on all of them, you still need to put it through a full QA test cycle to ensure you've actually got it working correctly.

IMHO it is way easier to just build a dedicated disk image for each hypervisor.

  • Thanks for the Thorough Answer @Daniel, I have no problem creating multiple disk types as i mentioned in the question, we can easily use the "qemu-img convert" tool for it. What i cannot seem to be able to convert is the machine definition (The actual XML that defines the VM itself), any pointers on that? – Onitlikesonic Feb 27 at 12:24

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.