I was having the following issue when running an instance with IMDVs1 disabled. My user_data.sh is empty since I am not doing anything special but seems like cloud-init is trying to retrieve the instance-id. Is there a way to update the cloud-init configuration during boot to accept IMDVs2?
[[32m OK [0m] Reached target Remote File Systems.
[ 9.155309] cloud-init[633]: Cloud-init v. 18.5 running 'init-local' at Sat, 05 Mar 2022 23:56:27 +0000. Up 9.12 seconds.
[ 60.325042] cloud-init[633]: 2022-03-05 23:57:19,050 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [0/120s]: bad status code [401]
[ 61.338391] cloud-init[633]: 2022-03-05 23:57:20,063 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [1/120s]: bad status code [401]
[ 62.345464] cloud-init[633]: 2022-03-05 23:57:21,070 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [2/120s]: bad status code [401]
[ 63.350126] cloud-init[633]: 2022-03-05 23:57:22,075 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [3/120s]: bad status code [401]
[ 64.361486] cloud-init[633]: 2022-03-05 23:57:23,086 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [4/120s]: bad status code [401]
[ 65.366914] cloud-init[633]: 2022-03-05 23:57:24,091 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [5/120s]: bad status code [401]
[ 67.372195] cloud-init[633]: 2022-03-05 23:57:26,097 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [7/120s]: bad status code [401]
[ 69.377789] cloud-init[633]: 2022-03-05 23:57:28,102 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [9/120s]: bad status code [401]
[ 71.384404] cloud-init[633]: 2022-03-05 23:57:30,109 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [11/120s]: bad status code [401]
[ 73.390297] cloud-init[633]: 2022-03-05 23:57:32,115 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [13/120s]: bad status code [401]
The AMI seems to use an old version of cloud-init that doesn't support IMDSv2; it's supported only starting from version
19.4
(you have 18.5): https://github.com/canonical/cloud-init/blob/main/ChangeLog#L1051So, how can I check which version of cloud-init I am running. Just by checking the newest ami log?