Azure Ubuntu – Linux VMs Stuck on Cloud-Init Initialization

azurecloud-initUbuntu

I have around 5 VMs in Azure, which were originally provisioned as Ubuntu 18 and since then I've been dist-upgrading them several times. A few months ago I noticed that similar VMs on different subscriptions fail to boot, being stuck on "cloud-init" step. enter image description here

Some of those VMs do have "Raise network interfaces" failure, some don't.

So far the workaround has been to detach the drive, edit it in a different VM and remove the "cloud-init" service from startup, allowing the VM to boot. Once it boots, network turns out to be just fine, despite the error logged. However on apt-get upgrade the cloud-init will get re-enabled and will halt the start of the VM again.

Is there a more persistent workaround to this? I trust the problem should be rather common as I am getting it on all of my Linux VMs in Azure, out of a sudden.

Best Answer

You appear to be hitting a bug that was introduced in cloud-init 21.3 that only affects Azure instances launched a few years ago that have been upgraded since.

https://bugs.launchpad.net/bugs/1946644

This bug is fixed in cloud-init 21.4, so upgrading should fix your issue.