netplan apply fails to rename network interfaces without reboot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Dear maintainers, hello.
After talking on netplan's IRC regarding a problem I had with netplan, I think it is possible that, with the member that supported me there, we found a bug.
First let me explain the context:
I am trying to create a script that sets up a bunch of identical machines, as part of this script I need to configure the network of the machines (I identify their mac address then try to attribute them names and network properties by generating a config and trying to apply it).
A big constraint for me is to get this setup script working without needing to reboot the machine.
*Report:*
Ubuntu Version: XUbuntu 20.04
Netplan Version: 0.100-0ubuntu4~
I am creating a netplan configuration using match: macaddress: and set-name: to attribute new names to my network interfaces as shown here: https:/
But when I run `sudo netplan apply` interfaces are not renamed.
Manually pulling them down with `sudo ip link set xxx down` before applying netplan configuration does not solve the situation.
Running `sudo netplan --debug apply` seems to have yielded something weird according to the person that helped me yesterday, and I quote:
> "DEBUG:Skipping non-physical interface: enp6s0" part of your log looks interesting... as enp6s0 actually IS a physical interface and should not be skipped."
Here is the sudo netplan --debug apply result: https:/
Full disclosure: After reboot the interfaces have the correct name, however as stated at the beginning of this post, for my use-case I need to make it work without a reboot.
For reference, the IRC log where we found this behaviour is here (between 8:36 and 13:56): https:/
Related branches
- Łukasz Zemczak: Approve
-
Diff: 4519 lines (+2723/-308)52 files modified.github/pull_request_template.md (+1/-0)
.github/workflows/build.yml (+33/-0)
.github/workflows/check-coverage.yml (+41/-0)
Makefile (+5/-6)
README.md (+2/-3)
dbus/io.netplan.Netplan.conf (+2/-0)
debian/changelog (+19/-0)
debian/libnetplan0.symbols (+2/-0)
dev/null (+0/-4)
doc/manpage-footer.md (+1/-1)
doc/netplan-dbus.md (+42/-0)
doc/netplan-generate.md (+5/-0)
doc/netplan-get.md (+39/-0)
doc/netplan-set.md (+42/-0)
doc/netplan-try.md (+3/-0)
doc/netplan.md (+48/-35)
examples/dbus_config_scenario.txt (+41/-0)
examples/openvswitch.yaml (+45/-0)
examples/wireguard.yaml (+27/-0)
netplan/cli/commands/__init__.py (+4/-0)
netplan/cli/commands/apply.py (+40/-49)
netplan/cli/commands/get.py (+67/-0)
netplan/cli/commands/info.py (+1/-1)
netplan/cli/commands/set.py (+123/-0)
netplan/cli/commands/try_command.py (+7/-3)
netplan/cli/ovs.py (+6/-2)
netplan/cli/utils.py (+52/-6)
netplan/configmanager.py (+56/-2)
netplan/terminal.py (+15/-10)
src/dbus.c (+662/-50)
src/generate.c (+58/-29)
src/networkd.c (+13/-12)
src/nm.c (+5/-2)
src/openvswitch.c (+2/-2)
src/parse.c (+18/-1)
src/parse.h (+3/-0)
src/util.c (+21/-3)
src/util.h (+3/-0)
tests/dbus/test_dbus.py (+556/-15)
tests/generator/base.py (+10/-7)
tests/generator/test_errors.py (+15/-0)
tests/generator/test_routing.py (+58/-0)
tests/generator/test_vlans.py (+47/-56)
tests/integration/base.py (+2/-1)
tests/integration/ethernets.py (+76/-0)
tests/integration/ovs.py (+1/-4)
tests/integration/routing.py (+17/-0)
tests/integration/tunnels.py (+1/-1)
tests/test_cli_get_set.py (+322/-0)
tests/test_configmanager.py (+29/-3)
tests/test_ovs.py (+10/-0)
tests/test_utils.py (+25/-0)
- Łukasz Zemczak: Approve
-
Diff: 4041 lines (+2702/-304)49 files modified.github/pull_request_template.md (+1/-0)
.github/workflows/build.yml (+33/-0)
.github/workflows/check-coverage.yml (+41/-0)
Makefile (+5/-6)
README.md (+2/-3)
dbus/io.netplan.Netplan.conf (+2/-0)
doc/manpage-footer.md (+1/-1)
doc/netplan-dbus.md (+42/-0)
doc/netplan-generate.md (+5/-0)
doc/netplan-get.md (+39/-0)
doc/netplan-set.md (+42/-0)
doc/netplan-try.md (+3/-0)
doc/netplan.md (+48/-35)
examples/dbus_config_scenario.txt (+41/-0)
examples/openvswitch.yaml (+45/-0)
examples/wireguard.yaml (+27/-0)
netplan/cli/commands/__init__.py (+4/-0)
netplan/cli/commands/apply.py (+40/-49)
netplan/cli/commands/get.py (+67/-0)
netplan/cli/commands/info.py (+1/-1)
netplan/cli/commands/set.py (+123/-0)
netplan/cli/commands/try_command.py (+7/-3)
netplan/cli/ovs.py (+6/-2)
netplan/cli/utils.py (+52/-6)
netplan/configmanager.py (+56/-2)
netplan/terminal.py (+15/-10)
src/dbus.c (+662/-50)
src/generate.c (+58/-29)
src/networkd.c (+13/-12)
src/nm.c (+5/-2)
src/openvswitch.c (+2/-2)
src/parse.c (+18/-1)
src/parse.h (+3/-0)
src/util.c (+21/-3)
src/util.h (+3/-0)
tests/dbus/test_dbus.py (+556/-15)
tests/generator/base.py (+10/-7)
tests/generator/test_errors.py (+15/-0)
tests/generator/test_routing.py (+58/-0)
tests/generator/test_vlans.py (+47/-56)
tests/integration/base.py (+2/-1)
tests/integration/ethernets.py (+76/-0)
tests/integration/ovs.py (+1/-4)
tests/integration/routing.py (+17/-0)
tests/integration/tunnels.py (+1/-1)
tests/test_cli_get_set.py (+322/-0)
tests/test_configmanager.py (+29/-3)
tests/test_ovs.py (+10/-0)
tests/test_utils.py (+25/-0)
tags: | added: fr-937 |
Changed in netplan: | |
status: | New → Confirmed |
Changed in netplan: | |
status: | Confirmed → Fix Committed |
Changed in netplan: | |
status: | Fix Committed → Fix Released |
Investigating this issue, it looks like there are several issues with the rename code:
1) "DEBUG:Skipping non-physical interface: enp6s0" -> The rename code seems to ignore interfaces which are matched by name/mac/driver rules (glob). It seems to just consider direct matches between netplan ID & interface name.
2) The logic for renaming interfaces via "udevadm test-builtin net_setup_link /sys/class/ net/IFACE" && "udevadm settle" seems to do nothing, i.e. not actually renaming the interface.