[Libguestfs] translating CD-ROM device paths from i440fx to Q35 in virt-v2v (was: test-v2v-cdrom: update the CD-ROM's bus to SATA in the converted domain)

Richard W.M. Jones rjones at redhat.com
Thu Sep 30 14:01:26 UTC 2021

On Thu, Sep 30, 2021 at 12:53:51PM +0100, Richard W.M. Jones wrote:
> On Thu, Sep 30, 2021 at 01:12:39PM +0200, Laszlo Ersek wrote:
> > All this requires virt-v2v to parse complete <address> elements from the
> > original domain XML, and to generate complete <address> elements in the
> > destination domain XML. Is that feasible?

Just to put a bit of flesh on these bones, links to the source:

> The input is not always (in fact, hardly ever) full libvirt XML.  It's
> input specific to the hypervisor.  For VMware it might be:
>  - the *.vmx file (the real source of truth) (-i vmx)

Here's the virt-v2v code that can parse either a local or remote (over
ssh) *.vmx file into virt-v2v's internal metadata representation:


Libvirt also has a vmx driver, but I decided not to use it because it
just adds an extra translation step and probably loses fidelity in the

In all cases, the *.vmx file is the source of truth for VMware.

>  - partial libvirt XML generated by libvirt's vpx driver, but this is
>    derived from information from VMware APIs and ultimately that comes
>    from the *.vmx file (-i libvirt -ic esx:// or -ic vpx://)

The libvirt driver:


I've hacked on this one a little bit in the past, and ... it's complicated.

>  - the *.ovf file (-i ova)

OVF is a pseudo-standard invented by VMware, but essentially a plot so
they can say they are "standard" when in fact it's just a data dump of
internal VMware structures with no compatibility across software that
generates or consumes OVF.

Here's our OVF parser (for VMware-OVF):


We can also generate OVF, but we generate the RHV-flavour of OVF which
(see above) is not related except that some XML element names overlap.

>  - nothing at all! (-i disk)

If you give virt-v2v just a disk then it will invent some metadata:



Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.

More information about the Libguestfs mailing list