120 seconds timeout on OpenNebula running subp.py
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hi,
I'm using the latest AlmaLinux 9 GenericCloud image. This has cloud-init 22.1-5.el9.alma and works with OpenNebula. Booting is very slow on OpenNebula because of a 120 seconds timeout.
systemd-analyze blame give me:
2min 3.083s cloud-init-
In de cloud-init.log I see:
<snip>
2023-02-09 11:30:10,244 - util.py[DEBUG]: Reading from /run/cloud-
2023-02-09 11:30:10,245 - util.py[DEBUG]: Read 3674 bytes from /run/cloud-
2023-02-09 11:30:10,245 - subp.py[DEBUG]: Running command ['sudo', '-u', 'nobody', 'bash', '-e'] with allowed return codes [0] (shell=False, capture=True)
2023-02-09 11:32:10,667 - util.py[DEBUG]: Reading from /sys/class/
2023-02-09 11:32:10,668 - util.py[DEBUG]: Read 2 bytes from /sys/class/
2023-02-09 11:32:10,669 - util.py[DEBUG]: Reading from /sys/class/
<snip>
See the two minute timeout after subp.py command.
When running the cloud-init-
OpenNebula passes network information ("Context" [1]) in shell syntax.
Cloud-init drops permissions to the 'nobody' user when parsing that content.
It drops the permissions using 'sudo'. I suspect that sudo is timing out on a dns lookup as networking is not configured at this point in boot. I've never felt it terribly useful for sudo to rely on dns, but it can depending on configuration [3].
The easy solutions for you are:
* figure out why sudo is doing that and configure it to *not* do that.
* hack cloud-init to not use 'sudo' there
The right solution is probably to implement a parser in cloud-init that does not involve executing 'sh' at all. (Sorry, it was me that wrote that the first time).
-- /archives. opennebula. org/documentati on:archives: rel4.2: cong /canonical- cloud-init. readthedocs- hosted. com/en/ latest/ reference/ datasources/ opennebula. html#opennebula /serverfault. com/questions/ 38114/why- does-sudo- command- take-long- to-execute
[1] https:/
[2] https:/
[3] https:/