cloud-init might incorrectly consider reboot as new-instance during kernel upgrade or downgrade
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Undecided
|
Chad Smith |
Bug Description
Between 4.14 kernel and 4.15 kernel this below commit changed the product uuid of a VM from uppercase to lowercase. Data Sources that use this number to represent instance-id (e.g., Azure) will go through new-instance code path at reboot following a kernel upgrade/downgrade (that is affected by the change). This is problematic for customers who provision with password on Azure because the password is not saved on disk new-instance provisioning will disables password access to VM in that case
Repro Steps:
Deploy a 18.04-LTS latest VM on Azure (kernel version is 4.18.0-1023-Azure as of July 5th 2019).
Downgrade the kernel to 4.14.119 (using the .deb packages here https:/
Configure grub to boot into the 4.14 kernel.
Observe in cloud-init log that new instance first boot is happening
In my VM I can see the product uuid changed the casing
4.18 kernel:
$ cat /sys/devices/
1fd1b593-
$ ls /var/lib/
1fd1b593-
After downgrade:
$ cat /sys/devices/
1FD1B593-
$ ls /var/lib/
1FD1B593-
DataSourceAzure.py is already using instance_
def check_instance_
# quickly (local check only) if self.instance_id is still valid
return sources.
However, the issue lies in stages.py's is_new_instance() method, which does not convert uuid to lowercase before comparison, which results in is_new_instance returning True when it should be False. This affects methods like apply_network_
Changed in cloud-init: | |
status: | New → Triaged |
Changed in cloud-init: | |
assignee: | nobody → Chad Smith (chad.smith) |
status: | Triaged → In Progress |
This bug is believed to be fixed in cloud-init in version 21.1. If this is still a problem for you, please make a comment and set the state back to New
Thank you.