After restart cloud-init reconfigured the machine hostname and ssh keypairs
Bug #1946644 reported by
Nicolas Gatti
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
High
|
Unassigned |
Bug Description
After restarting vms on azure on Oct 8 all th restarted machines where treated as if it were first boot and reconfigured with the initial values of hostname and new ssh keypairs.
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → High |
To post a comment you must log in.
Cloud-init caches instance metadata to disk via pickle. Newer (since mid-2019) Azure instances have a service that removes this cache every boot. This particular instance is old enough to not have that service.
In 21.2, https:/ /github. com/canonical/ cloud-init/ blob/main/ cloudinit/ sources/ DataSourceAzure .py#L361
was added to the Azure datasource. This sort of thing normally needs
to be added to our upgrade framework so unpickling works correctly,
but since the pickle gets removed every boot by that service on new launches, we
didn't catch it in testing. Prior to 21.3, the instance was
never trying to obtain new metadata as it was configured to only fetch
it on first boot. In 21.3, Azure instances will always attempt to
fetch metadata every boot, so trying to read the new variable fails
once you upgrade to 21.3.
We'll add the new attribute to our upgrade framework so this doesn't happen in future, but to fix affected instances, you can "rm /var/lib/ cloud/instance/ obj.pkl" .