netplan apply triggers udev add events for every network interface
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
cloud-init (Ubuntu) | Status tracked in Oracular | |||||
Oracular |
Invalid
|
Undecided
|
Unassigned | |||
netplan.io (Ubuntu) | Status tracked in Oracular | |||||
Oracular |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
netplan.io version 1.0-3ubuntu1, on Ubuntu 24.10, triggers udev add events for every already present network interface:
```
$ lxc launch ubuntu-daily:o oo
# open `udevadm monitor` on another window within the container
o: # netplan apply
o: # udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
KERNEL[
KERNEL[
UDEV [23616.691806] add /devices/
UDEV [23616.697810] add /devices/
```
This is wrong by its own, but, with cloud-init on aws images is even worse because:
cloud-init installs the following udev rules to configure hotplugged nics:
```
# cat /etc/udev/
# Installed by cloud-init due to network hotplug userdata
ACTION!
ENV{ID_
GOTO="cloudinit
LABEL="
SUBSYSTEM=="net", RUN+="/
LABEL="
```
which gets triggered by the udev add events, and hook-hotplug instructs cloud-init to configure the new nic, and during that reconfiguration `netplan apply` is called by cloud-init, which starts an infinite loop.
Related branches
- Lukas Märdian: Approve
- Ubuntu Core Development Team: Pending requested
-
Diff: 9520 lines (+2927/-1381)72 files modified.github/workflows/autopkgtest.yml (+5/-1)
.github/workflows/build-abi.yml (+1/-0)
.github/workflows/check-address-sanitizer.yml (+1/-0)
.github/workflows/check-coverage.yml (+1/-0)
.github/workflows/coverity.yml (+1/-0)
.github/workflows/debci.yml (+1/-1)
.github/workflows/snapd.patch (+4/-4)
.github/workflows/spread.yml (+5/-1)
README.md (+3/-3)
debian/changelog (+73/-0)
debian/control (+1/-0)
debian/copyright (+1/-1)
debian/patches/0002-CLI-apply-call-udevadm-trigger-using-action-add-Clos.patch (+72/-0)
debian/patches/0003-Revert-wait-online-disabled-wait-online-for-stable-1.patch (+155/-0)
debian/patches/0004-generate-avoid-calling-udevadm-control-reload-LP-199.patch (+82/-0)
debian/patches/series (+3/-16)
debian/tests/control (+1/-1)
dev/null (+0/-386)
doc/.sphinx/requirements.txt (+1/-0)
doc/conf.py (+0/-1)
doc/creating-link-aggregation.md (+86/-0)
doc/howto.md (+26/-14)
doc/matching-interface-by-mac-address.md (+85/-0)
doc/netplan-generate.md (+2/-2)
doc/netplan-status.md (+3/-3)
doc/netplan-tutorial.md (+239/-533)
doc/netplan-yaml.md (+6/-5)
doc/tutorial.md (+2/-0)
doc/using-static-ip-addresses.md (+128/-0)
meson.build (+1/-1)
netplan_cli/__init__.py (+1/-1)
netplan_cli/cli/commands/apply.py (+0/-4)
netplan_cli/cli/commands/generate.py (+10/-1)
netplan_cli/cli/core.py (+2/-2)
netplan_cli/cli/sriov.py (+107/-56)
netplan_cli/cli/state_diff.py (+1/-1)
netplan_cli/cli/utils.py (+1/-1)
python-cffi/netplan/__init__.py (+5/-5)
spread.yaml (+1/-0)
src/generate.c (+25/-10)
src/networkd.c (+219/-58)
src/networkd.h (+5/-0)
src/nm.c (+18/-12)
src/openvswitch.c (+14/-10)
src/parse-nm.c (+15/-0)
src/parse.c (+115/-40)
src/sriov.c (+16/-5)
src/util-internal.h (+12/-0)
src/util.c (+116/-4)
src/validation.c (+4/-3)
src/yaml-helpers.h (+1/-0)
tests/cli/test_get_set.py (+2/-0)
tests/cli_legacy.py (+1/-2)
tests/ctests/meson.build (+1/-0)
tests/ctests/test_netplan_keyfile.c (+65/-0)
tests/ctests/test_netplan_misc.c (+45/-0)
tests/ctests/test_netplan_networkd.c (+74/-0)
tests/ctests/test_netplan_parser.c (+51/-0)
tests/generator/base.py (+3/-0)
tests/generator/test_args.py (+106/-5)
tests/generator/test_auth.py (+11/-11)
tests/generator/test_bonds.py (+14/-0)
tests/generator/test_common.py (+144/-9)
tests/generator/test_ovs.py (+82/-0)
tests/generator/test_wifis.py (+61/-90)
tests/integration/base.py (+93/-0)
tests/integration/diff.py (+2/-2)
tests/integration/ethernets.py (+46/-3)
tests/netplan_dbus/test_dbus.py (+6/-6)
tests/parser/test_keyfile.py (+39/-0)
tests/test_sriov.py (+403/-66)
tests/test_utils.py (+1/-1)
CVE References
summary: |
- netplan apply triggers udev add events for every network interfdace + netplan apply triggers udev add events for every network interface |
tags: | added: foundations-todo |
cloud-init logs on aws