Hi I've been looking for a standalone tool to create OVA/OVF VM files based on a disk image and found none. So I was thinking to write my own. Would you be interested in having such a tool in the libguestfs umbrella ? My aim is too have a free toolchain to build VirtualBox images for Debian (for Vagrant to be more exact, see https://wiki.debian.org/Teams/Cloud/VagrantBaseBoxes) Interface for such a tool would be something like disk2ova --memory 2G --controller sata --network E1000 myDiskImage.{raw,qcow2} based on the command line switches, a XML ovf would be created and packed with the disk image in a OVA file. There is some python code around which does that, for example the ganeti export code and imagefactory https://github.com/redhat-imaging/imagefactory/blob/master/imagefactory_plugins/ovfcommon/ovfcommon.py#L69 but nothing available as a standalone tool. I am afraid I can only contribute Perl code. Emmanuel
Richard W.M. Jones
2016-Oct-21 14:08 UTC
Re: [Libguestfs] libguestfs and exporting to OVA/OVF
On Thu, Oct 20, 2016 at 10:43:26PM +0200, Emmanuel Kasper wrote:> Hi > I've been looking for a standalone tool to create OVA/OVF VM files based > on a disk image and found none. So I was thinking to write my own. > Would you be interested in having such a tool in the libguestfs umbrella ?There is this: http://git.annexia.org/?p=import-to-ovirt.git which can generate OVF, and with not very much extra work could generate OVAs. The problem is that OVF is not a reliable standard. Sure, there is a standards organization behind it, but there is in practice no interop. You have to know the target hypervisor in order to be able to create OVF which will work, and the OVF is quite different for each target.> My aim is too have a free toolchain to build VirtualBox images for > Debian (for Vagrant to be more exact, see > https://wiki.debian.org/Teams/Cloud/VagrantBaseBoxes) > > Interface for such a tool would be something like > > disk2ova --memory 2G --controller sata --network E1000 > myDiskImage.{raw,qcow2} > > based on the command line switches, a XML ovf would be created and > packed with the disk image in a OVA file. > > There is some python code around which does that, for example the ganeti > export code and imagefactory > > https://github.com/redhat-imaging/imagefactory/blob/master/imagefactory_plugins/ovfcommon/ovfcommon.py#L69 > > but nothing available as a standalone tool. > > I am afraid I can only contribute Perl code.I've no objections to helping you to write such a tool. I don't think we would want to ship it as part of libguestfs unless it was something that had general utility (see above). However we could link to the result from one of our web pages. You should certainly have a look at the import-to-ovirt script too since it considers some issues you may not have thought of. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Emmanuel Kasper
2016-Oct-21 22:03 UTC
Re: [Libguestfs] libguestfs and exporting to OVA/OVF
Le 21/10/2016 à 16:08, Richard W.M. Jones a écrit :> On Thu, Oct 20, 2016 at 10:43:26PM +0200, Emmanuel Kasper wrote: >> Hi >> I've been looking for a standalone tool to create OVA/OVF VM files based >> on a disk image and found none. So I was thinking to write my own. >> Would you be interested in having such a tool in the libguestfs umbrella ? > > There is this: > > http://git.annexia.org/?p=import-to-ovirt.git > > which can generate OVF, and with not very much extra work could > generate OVAs. > > The problem is that OVF is not a reliable standard. Sure, there is a > standards organization behind it, but there is in practice no interop. > You have to know the target hypervisor in order to be able to create > OVF which will work, and the OVF is quite different for each target.Thanks for the hint for import-to-ovirt, the code is easy to read and follow, and is close to what I want to achieve. A good part of the script is ovirt specific but I am going to reuse the part where you generate the OVF file. I'll send you a link when I have something to show.
Maybe Matching Threads
- Re: libguestfs and exporting to OVA/OVF
- supermin on arm
- "could not parse ovf:Name" converting OVA
- Re: [PATCH v2 2/5] v2v: ova: don't detect compressed disks, read the OVF instead
- Re: [PATCH v3 2/6] v2v: ova: don't detect compressed disks, read the OVF instead