1

Why does head -n 1 /var/log/cloud-init.log show the following,

util.py[DEBUG]: Cloud-init v. 21.2-3-g899bfaa9-0ubuntu2~20.04.1 running 'init-local' at Fri, 21 Jan 2022 18:03:44 +0000. Up 48.49 seconds.

Indicating clearly it's Cloud-init v. 21.2-3 but likewise

# /usr/bin/cloud-init --version
/usr/bin/cloud-init 21.4-0ubuntu1~20.04.1

Indicates it's version cloud-init 21.4. Why does one say 21.4 and the other 21.2?


This is a follow up to cloud-init.log shows write_files.0: Additional properties are not allowed ('defer' was unexpected)

muru
  • 69,900
  • 13
  • 192
  • 292
Evan Carroll
  • 28,578
  • 45
  • 164
  • 290
  • 1
    One function of cloud-init is applying security upgrades. I would check the log to see if it upgrades itself. – jordanm Mar 17 '22 at 14:35

1 Answers1

2

Cloud-init ran as version 21.2 but has since been upgraded to 21.4.

The update might have been a manual sudo apt update && sudo apt upgrade, or it may have upgraded itself.

Sidenote: Your image comes with old versions of cloud-init. To get the latest features and bugfixes, I would suggest sourcing an Ubuntu image of 20.04 with a more recent version of cloud-init. Release 22.1 has been released upstream already and is currently being tested for release into Ubuntu (expected release into Ubuntu within the next couple of weeks).

Brett Holman
  • 498
  • 2
  • 11
  • It would be a really great idea if they made that run first, and then reexec itself with the newer cloud-init. – Evan Carroll Mar 17 '22 at 14:48
  • 1
    I understand the frustration, but I disagree. Cloud-init executes before networking is even up, so it couldn't do it "first". Additionally, this could lead to bugs that are very hard to reproduce, prevent, and reason about. – Brett Holman Mar 17 '22 at 14:54