On 6/11/22 8:54 AM, Gionatan Danti wrote:
Hi all,
I just realized that libvirt default for directly attached interface is
vepa mode.
I discovered it now because virt-manager automatically enables bridge
mode, while cockpit-machines get the default vepa mode. This is
unfortunate because, being vepa switches very rare, it means that using
cockpit to configure directly attached interfaces causes guests to not
talk each other.
I have some questions:
- can libvirt default be changed/configured somehow (ie: to
automatically create bridge-mode directly attached interface when no
mode is specified)?
libvirt's defaults are defaults, and can't be changed with config.
libvirt also will never changed the hardcoded default, because that
could break existing installations.
I'm not sure why vepa was chosen as the default when macvtap support was
added to libvirt, but my best guess is that it was just the bias of the
person doing the work who assumed their usage would be the most common
(IIRC it was done by someone who was specifically wanting to support
connection to VEPA-capable switches, and since it was a new feature
nobody else had experience with / opinions about which mode would be
most common, so the reviewers just accepted this default)
- how can I use virsh to discover machines with vepa-mode interfaces
(virsh domiflist <domain> does not return the interface mode)?
I guess you'll need to do a "virsh dumpxml --inactive" for each guest
and parse it out of there.
- can I change the interface type at runtime (virt-xml <domain> --edit
--network type=direct,source.mode=bridge works for inactive domains only)?
No, I think the mode of the macvtap interface is set when the interface
is created, and can't be changed later (i.e. it's a limitation of
macvtap, not libvirt)