Regarding the investigation requested and the 2 minute wait-online
timeouts reported by Suda in comment #4:

Ive tracked down the exact failure mechanism in cloud-init and submitted an 
upstream fix with unit tests:
https://github.com/canonical/cloud-init/pull/7085

Root Cause:
In cloud-init-local.service, cloudinit.net._get_current_rename_info() 
determines which interfaces are safe to bring down before renaming. For IPv6 it 
filters by `scope global permanent`, but for IPv4 it ran `ip -4 addr show` with 
no scope filter.

On Ubuntu 26.04 images, early IPv4LL autoconfiguration (169.254.0.0/16,
scope link) assigns an address before init-local finishes. Because of
the missing scope filter, the interface is flagged with downable=False.
Because the Linux kernel forbids renaming interfaces while UP (-EBUSY),
cloud-init refuses to take the link down and aborts:

[busy] Error renaming mac=... from ens3 to eth0

Because the interface remains ens3, Netplan's generated config for eth0
never binds, causing the 120 second systemd-networkd-wait-online timeout
on first boot. When cloud-init is not installed (comment #1), this check
doesn't run and udev/netplan completes the rename normally.

The fix I proposed was fairly simple:
Added scope global to the IPv4 address query in _get_current_rename_info() to 
mirror the existing IPv6 behavior and allow cloud-init to bring the link down, 
complete the rename, and bring it back up cleanly

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2136392

Title:
  Rename of interfaces broken at boot time (netplan-configure.service vs
  cloud-init-network.service)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/2136392/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to