cloud-init reporting does not report boot stage start;finish events for init-local, init-network, modules-config, modules-final
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Undecided
|
Unassigned |
Bug Description
cloud-init 22.3 reporting configuration doesn't report paired start/finish event_types for all of cloud-init's boot stages.
Expected behavior:
cloud-init boot stages (init-local, init-network, config-modules and config-final) to emit both event_type start and finish to represent entry and exit of each boot stage and result "SUCCESS" or "FAILURE".
Results seen:
Only intermittently see init-network finish events, otherwise strictly event children within the named scope of init-local/*, init-network/*, modules-config/* and modules-final/* publish both start and finish events.
# desired init-network event only seen sometimes.
{"name": "init-network", "description": "searching for network datasources", "event_type": "finish", "origin": "cloudinit", "timestamp": 1665613954.3995728, "result": "SUCCESS"}
Test Procedure:
# terminal 1 on LXC host setup simple http server to log POST name:event_type tuples
cat > report_server.py << EOF
#!/usr/bin/env python3
from http.server import BaseHTTPRequest
import logging
import json
class S(BaseHTTPReque
def _set_response(
def do_POST(self):
post_data = self.rfile.
json_data = json.loads(
msg = f"{json_
def run(server_
logging.
server_address = ('', port)
httpd = server_
logging.
try:
except KeyboardInterrupt:
pass
httpd.
logging.
if __name__ == '__main__':
from sys import argv
if len(argv) == 2:
else:
run()
EOF
python3 report_server.py 2> /dev/null
#### Terminal 2
# Setup LXC container with a reporting configuration which will talk to the LXC host
cat > 99-reporting.cfg <<EOF
reporting:
webserver:
type: webhook
endpoint: "http://
timeout: 5
retries: 3
EOF
lxc launch ubuntu-
lxc exec test-reporting -- cloud-init status --wait
lxc file push 99-reporting.cfg test-reporting/
lxc exec test-reporting -- cloud-init clean --logs --reboot
# on the simple http server terminal we end up seeing only event children, we only occasionally see init-network:finish events. Typically the parent event start and finish is not logged and it is only child events within the boot stage init-local, init-network, modules-config and modules-final this gets published in event handler
init-local/
init-local/
init-local/
init-local/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
init-network/
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
modules-
Changed in cloud-init: | |
status: | New → Triaged |
Tracked in Github Issues as https:/ /github. com/canonical/ cloud-init/ issues/ 4032