[Bug 1918421] Re: netplan does not match multiple driver specifications
Brian Murray
1918421 at bugs.launchpad.net
Thu Oct 21 15:52:51 UTC 2021
** Tags removed: rls-jj-incoming
** Also affects: netplan.io (Ubuntu Jammy)
Importance: Undecided
Status: Triaged
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to netplan.io in Ubuntu.
Matching subscriptions: foundations-bugs
https://bugs.launchpad.net/bugs/1918421
Title:
netplan does not match multiple driver specifications
Status in netplan.io package in Ubuntu:
Triaged
Status in netplan.io source package in Jammy:
Triaged
Bug description:
The current network-config configuration for cloud-init on the Ubuntu
Raspberry Pi images includes the following section for matching the
built-in Ethernet port on all supported models of Pi:
ethernets:
eth0:
# Rename the built-in ethernet device to "eth0"
match:
driver: bcmgenet smsc95xx lan78xx
set-name: eth0
dhcp4: true
optional: true
The space-separated list of driver names (actually globs) is the
format supported by networkd; from systemd.network(5):
Driver=
A whitespace-separated list of shell-style globs matching the driver currently bound to the
device, as exposed by the udev property ID_NET_DRIVER of its parent device, or if that is
not set, the driver as exposed by ethtool -i of the device itself. If the list is prefixed
with a "!", the test is inverted.
Given that netplan only supports driver matching when the back-end is
networkd, it would be logical to assume that it also permits multiple
specifications here (although the format is somewhat incongruous given
it's not a YAML list), and this had *appeared* to work historically
(netplan happily copied the specification to
/run/systemd/network/10-netplan-eth0.link). However, while testing
netplan under hirsute a recent change (specifically in 0.101-1) makes
it clear that it is in fact failing to match the interface:
$ sudo netplan apply
[]
Cannot find unique matching interface for 'eth0': {'driver': 'bcmgenet smsc95xx lan78xx'}
A work-around I'm implementing for now is to use three separate
sections (each with a different name) to split out the driver
components but I get the impression netplan probably ought to support
this a bit more elegantly given the underlying networkd back-end does.
It would be trivial to tweak "is_interface_matching_driver_name" in
netplan/cli/utils.py to support the space separated format (and I'm
happy to provide a PR implementing that if requested) but for the sake
of consistency I suspect the schema ought to be extended to support
the option of a YAML list instead of a string for that value?
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/1918421/+subscriptions
More information about the foundations-bugs
mailing list