[Bug 2071363] [NEW] netplan apply triggers udev add events for every network interfdace
Alberto Contreras
2071363 at bugs.launchpad.net
Thu Jun 27 14:11:16 UTC 2024
Public bug reported:
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[23616.687850] add /devices/virtual/net/eth0 (net)
KERNEL[23616.687890] add /devices/virtual/net/lo (net)
UDEV [23616.691806] add /devices/virtual/net/lo (net)
UDEV [23616.697810] add /devices/virtual/net/eth0 (net)
```
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/rules.d/90-cloud-init-hook-hotplug.rules
# Installed by cloud-init due to network hotplug userdata
ACTION!="add|remove", GOTO="cloudinit_end"
ENV{ID_NET_DRIVER}=="vif|ena|ixgbevf", GOTO="cloudinit_hook"
GOTO="cloudinit_end"
LABEL="cloudinit_hook"
SUBSYSTEM=="net", RUN+="/usr/lib/cloud-init/hook-hotplug"
LABEL="cloudinit_end"
```
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.
** Affects: cloud-init (Ubuntu)
Importance: Undecided
Status: Invalid
** Affects: netplan.io (Ubuntu)
Importance: Undecided
Status: New
** Affects: cloud-init (Ubuntu Oracular)
Importance: Undecided
Status: Invalid
** Affects: netplan.io (Ubuntu Oracular)
Importance: Undecided
Status: New
** Also affects: netplan.io (Ubuntu)
Importance: Undecided
Status: New
** Also affects: cloud-init (Ubuntu Oracular)
Importance: Undecided
Status: New
** Also affects: netplan.io (Ubuntu Oracular)
Importance: Undecided
Status: New
--
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/2071363
Title:
netplan apply triggers udev add events for every network interfdace
Status in cloud-init package in Ubuntu:
Invalid
Status in netplan.io package in Ubuntu:
New
Status in cloud-init source package in Oracular:
Invalid
Status in netplan.io source package in Oracular:
New
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[23616.687850] add /devices/virtual/net/eth0 (net)
KERNEL[23616.687890] add /devices/virtual/net/lo (net)
UDEV [23616.691806] add /devices/virtual/net/lo (net)
UDEV [23616.697810] add /devices/virtual/net/eth0 (net)
```
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/rules.d/90-cloud-init-hook-hotplug.rules
# Installed by cloud-init due to network hotplug userdata
ACTION!="add|remove", GOTO="cloudinit_end"
ENV{ID_NET_DRIVER}=="vif|ena|ixgbevf", GOTO="cloudinit_hook"
GOTO="cloudinit_end"
LABEL="cloudinit_hook"
SUBSYSTEM=="net", RUN+="/usr/lib/cloud-init/hook-hotplug"
LABEL="cloudinit_end"
```
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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/2071363/+subscriptions
More information about the foundations-bugs
mailing list