To clarify the actual root cause here and reflect it back to this original bug.
google-guest-agent defines a `PartOf=` relationship with systemd-networkd.service[1]. This relationship means that if systemd-networkd.service is either stopped, google-guest-agent.service gets stopped. When systemd-networkd.service is restarted, so is google-guest-agent.
But if systemd-networkd.service is subsequently started after a previous stop call, google-guest-agent is left in stopped state. The call `netplan apply` (emitted by cloud-init after writing network config) in fact calls systemctl stop systemd-networkd.service and follows it with a 'start' instead of directly invoking systemctl restart systemd-networkd.service[2]. This leaves google-guest in stopped state indefinitely.
I'm not entirely sure netplan can fix this issue due to some other cleanup they are doing between networkd stop and start, but I have reflected this bug to netplan.io folks and we'll see what the consensus is about whether this can be resolved with instrumenting a "systemctl restart" instead of separate "systemctl stop" and "systemctl start" calls.
To clarify the actual root cause here and reflect it back to this original bug.
google- guest-agent defines a `PartOf=` relationship with systemd- networkd. service[ 1]. This relationship means that if systemd- networkd. service is either stopped, google- guest-agent. service gets stopped. When systemd- networkd. service is restarted, so is google-guest-agent.
But if systemd- networkd. service is subsequently started after a previous stop call, google-guest-agent is left in stopped state. The call `netplan apply` (emitted by cloud-init after writing network config) in fact calls systemctl stop systemd- networkd. service and follows it with a 'start' instead of directly invoking systemctl restart systemd- networkd. service[ 2]. This leaves google-guest in stopped state indefinitely.
I'm not entirely sure netplan can fix this issue due to some other cleanup they are doing between networkd stop and start, but I have reflected this bug to netplan.io folks and we'll see what the consensus is about whether this can be resolved with instrumenting a "systemctl restart" instead of separate "systemctl stop" and "systemctl start" calls.
References: /github. com/GoogleCloud Platform/ guest-agent/ blob/main/ google- guest-agent. service# L13 /git.launchpad. net/ubuntu/ +source/ netplan. io/tree/ netplan/ cli/commands/ apply.py? h=applied/ ubuntu/ devel#n169
[1] https:/
[2] https:/