Predictable and consistent net interface naming in guests

Andrea Bolognani abologna at redhat.com
Mon Oct 31 16:55:21 UTC 2022


On Mon, Oct 31, 2022 at 04:32:27PM +0200, Edward Haas wrote:
> That discussion mentioned that a guest PCI address may change in two cases:
> - The PCI topology changes.
> - The machine type changes.
>
> Usually, the machine type is not expected to change, especially if one
> wants to allow migrations between nodes.
> I would hope to argue this should not be problematic in practice, because
> guest images would be made per a specific machine type.

The machine type might not change from q35 to i440fx and vice versa,
but since the domain XML is constructed every time a KubeVirt VM is
started, the machine type might be q35-6.0 on one boot and q35-7.0
the next one if a KubeVirt upgrade that comes with a new version of
QEMU has happened in between.

This is unlikely to make a difference in terms of PCI addresses seen
in the guest OS, but it's still not accurate to say that the machine
type will not change.

Live migration is a separate matter, as the machine type will
definitely not change while the VM is running.

> Regarding the PCI topology, I am not sure I understand what changes
> need to occur to the domxml for a defined guest PCI address to change.
> The only think that I can think of is a scenario where hotplug/unplug is
> used,
> but even then I would expect existing devices to preserve their PCI address
> and the plug/unplug device to have a reserved address managed by the one
> acting on it (the management system).
>
> Could you please help clarify in which scenarios the PCI topology can cause
> a mess to the naming of interfaces in the guest?

A change in libvirt (again, due to a KubeVirt upgrade in between two
boots of the same VM) might result in different PCI addresses being
assigned to devices despite the same input XML.

We generally try fairly hard to avoid this kind of situation, but we
can only really guarantee stable PCI addresses for the lifetime of a
VM that has been defined and can't promise that the same input XML
will result in the same guest ABI when using different versions of
libvirt.

-- 
Andrea Bolognani / Red Hat / Virtualization



More information about the libvirt-users mailing list