[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 11:53:51 UTC 2021

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?

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)

 - 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 *.ovf file (-i ova)

 - nothing at all! (-i disk)

Also we don't currently try to find or rewrite /dev/disk/ paths in
guest configuration files.  The only rewriting that happens is for
/dev/[hs]d* block device filenames and a few others.  The actual code
that does this is convert/convert_linux.ml:remap_block_devices

So I wouldn't over-think this.  It's likely fine to identify such
devices and rewrite them as "/dev/cdrom", assuming that (I didn't
check) udev creates that symlink for any reasonably modern Linux.  And
if there's more than one attached CD to the source, only convert the
first one and warn about but drop the others.

Note that the aim of virt-v2v is to make it boot on the target, make
sure the network works, and get the user to a login prompt.  The MTV
management app around virt-v2v allows site-specific pre- and post-
configuration to happen (site-specific Ansible playbooks).  There also
exists ssh and remote console.  For people using virt-v2v on the
command line, if they get the guest to boot on the target and not
every device fully works, there is an expectation that they can log in
as root and fix small[*] things.


[*] Obviously if the boot / system is completely broken, not that.

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