Drop udev remove action in cloud-init-hotplugd
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| cloud-init (Ubuntu) |
Invalid
|
Undecided
|
Chengen Du | ||
| Focal |
Triaged
|
Undecided
|
Chengen Du | ||
| Jammy |
Triaged
|
Undecided
|
Chengen Du | ||
| Noble |
Triaged
|
Undecided
|
Chengen Du | ||
| Oracular |
Won't Fix
|
Undecided
|
Chengen Du | ||
| Plucky |
Invalid
|
Undecided
|
Chengen Du | ||
Bug Description
[Impact]
When `modprobe --remove ena` is executed, the kernel triggers a udev remove event.
This causes cloud-init to refetch the datasource information, expecting the NIC to be gone.
However, since IMDS updates asynchronously, cloud-init's hotplug logic may wait and retry if the NIC still appears to be present.
The process will end up showing the following call trace:
2025-03-21 19:38:43,116 - hotplug_
Traceback (most recent call last):
File "/usr/lib/
handle_hotplug(
File "/usr/lib/
try_
File "/usr/lib/
raise last_exception
File "/usr/lib/
event_
File "/usr/lib/
raise RuntimeError(
RuntimeError: Failed to detect 02:24:50:39:e7:ef in updated metadata
Traceback (most recent call last):
File "/usr/bin/
sys.
File "/usr/lib/
return sub_main(args)
File "/usr/lib/
retval = functor(name, args)
File "/usr/lib/
handle_hotplug(
File "/usr/lib/
try_
File "/usr/lib/
raise last_exception
File "/usr/lib/
event_
File "/usr/lib/
raise RuntimeError(
RuntimeError: Failed to detect 02:24:50:39:e7:ef in updated metadata
cloud-init-
cloud-init-
Failed to start cloud-init-
[Fix]
Monitoring the udev remove action may not be necessary.
Once the device is removed, its configurations become inactive, making explicit updates potentially redundant.
An upstream commit has dropped support for the udev remove action in cloud-init-
commit 3c2ff0ca7086c13
Author: yukariatlas <email address hidden>
Date: Wed, 9 Apr 2025 05:19:07 +0800
fix: drop udev remove action in hotplug (#6152)
When `modprobe --remove ena` is executed, the kernel triggers a udev
remove event. This causes cloud-init to refetch datasource information,
expecting the NIC to be gone. However, since IMDS updates asynchronously,
cloud-init's hotplug logic may wait and retry if the NIC still appears
present. Monitoring the udev remove action may not be necessary. Once the
device is removed, its configurations become inactive, and explicitly
updating them might be redundant.
Fixes: GH-5706
[Test Plan]
1. Launch an instance in AWS EC2.
2. Run `sudo modprobe -r ena && sudo modprobe ena` to verify that the call trace no longer appears.
[Where problems could occur]
The patch is based on the assumption that configurations become inactive once the device is removed.
Explicit cleanup is considered unnecessary, as subsequent udev add events will realign the configuration.
If there are any flaws in this assumption, the cloud-init hotplug mechanism may be affected.
| Changed in cloud-init (Ubuntu Focal): | |
| assignee: | nobody → Chengen Du (chengendu) |
| Changed in cloud-init (Ubuntu Jammy): | |
| assignee: | nobody → Chengen Du (chengendu) |
| Changed in cloud-init (Ubuntu Noble): | |
| assignee: | nobody → Chengen Du (chengendu) |
| Changed in cloud-init (Ubuntu Oracular): | |
| assignee: | nobody → Chengen Du (chengendu) |
| Changed in cloud-init (Ubuntu Plucky): | |
| assignee: | nobody → Chengen Du (chengendu) |
| Changed in cloud-init (Ubuntu Focal): | |
| status: | New → Triaged |
| Changed in cloud-init (Ubuntu Jammy): | |
| status: | New → Triaged |
| Changed in cloud-init (Ubuntu Noble): | |
| status: | New → Triaged |
| Changed in cloud-init (Ubuntu Oracular): | |
| status: | New → Triaged |
| Changed in cloud-init (Ubuntu Plucky): | |
| status: | New → Triaged |

Debdiff for Focal