/srv/irclogs.ubuntu.com/2021/02/12/#cloud-init.txt

prologicCan anyone help me debug why cloud-init isn't working here correctly? It only seems to do half of it's job on the creation of a new instance. But if I rm -rf /var/lib/cloud and reboot it does everything04:52
prologicProblem I have is I already nuked the cloud-init state in my package template before pushing the image and initially creating an instance from it04:53
prologicthis is really baffling me04:53
prologicHmm 🤔 I don't get it05:12
meenaprologic: maybe if you post the log from that first run, we could see what's up and help06:58
prologicumm sure okay, I've pretty much given up for the day with no luck06:59
prologicI've been scouring through it quite a bit myself06:59
prologicwhat would I have been looking for specifically?06:59
prologicWhy does cloud-init clean && reboot work? But an initial boot not?06:59
prologicI feel like I'm missing something incredibly stupid here :/07:00
=== waxfire7 is now known as waxfire
prologicmeena here it is https://transfer.mills.io/8hwr8/cloud-init.log07:11
meenaprologic:  did you run cloud-init clean before finishing the package?08:17
prologicyes08:23
prologicit's part of the last step in the packer build08:23
Odd_Blokeprologic: Thanks for the log!  I don't see anything immediately wrong, though a couple of notes: 19.4 is fairly old and Photon support isn't upstream, so this may either be already resolved or an issue for whoever has produced your package.  That said, when you say "It only seems to do half of it's job on the creation of a new instance", what do you mean?  Which parts does it do and which parts does it14:19
Odd_Blokenot?14:19
prologicFor example it runs the final_message14:20
prologicI see that in the journal logs14:20
prologicBut none of the write_files get run14:20
prologicI _believe_ run_cmd(s) run and some other stuff14:20
prologicit's really weird14:21
Odd_Blokeprologic: Oh, actually, looking even further, this is also using a datasource that isn't upstream, so we may not be able to get very far in supporting you.  Where is this cloud-init being installed from?14:21
prologicwell cloud-init is a package Photon are installing obviously14:22
prologicit's part of their ISO from the installer14:22
prologicI'm just doing a packer build and adding a few bits/pieces we need14:22
prologicBut you are right, the data source is coming from VMGuestInfo from vSphere14:22
prologicBut14:23
prologicWhen cloud-init runs on boot I _do_ see the full user-data I expect to see in /var/lib/cloud/instances/.../user-data.txt14:23
Odd_BlokeWell, I don't really know what Photon is: they haven't engaged with us upstream to my knowledge. :)14:23
prologici.e: there is nothing missing form the data source14:23
prologichttps://github.com/vmware/photon14:23
prologicMy understanding is, it's just a repackaged/rebranded CentOS distribution optimized for running containers (although that's quite questionable IHMO)14:24
Odd_Blokeprologic: I see the 'init' stage running twice in that log: do you know why that's happening?14:32
prologicunfortuantely no14:33
Odd_BlokeOK, I'd suggest looking into systemd units to see if you can figure that out: that's not how we ship cloud-init upstream so it could be leading to strange behaviour.  If Photon are doing that, then I'm afraid you'll have to take it up with them.14:35
prologicHow is cloud-init normally run btw?14:35
prologicWith or without SystemD's help?14:35
* prologic grumbles about how much he loathes SystemD14:36
prologicAnd also; (if you can help explain this, or maybe it might give you a clue?) If run cloud-init clean && reboot14:37
prologicThe vm comes back with all the things in the user-data correctly run14:37
prologicit's just on the first boot it doesn't (i.e: terraform apply -> vsphere create vm blah)14:38
prologicthis is the behaviour I really don't get at all14:38
Odd_Blokecloud-init runs in 5 stages (the first of which is optional and only supported by systemd), you can read more at https://cloudinit.readthedocs.io/en/latest/topics/boot.html14:38
Odd_BlokeSo your init system needs to be invoking cloud-init in the right order and at the right points in boot: if Photon's packaging hasn't hooked that up as upstream expects, then it's not surprising that we would see strange behaviour.14:40
Odd_BlokeAs for why a `clean` fixes it: I'm not sure, but I think the root cause of why the first boot doesn't work is likely related to the multiple runs of `init` so I think investigating that is the best place to start.14:41
prologicOk.14:42
prologicThanks very much for this insight.14:42
Odd_Bloke:)14:43
Odd_BlokeLet us know how you get on!14:43
prologicSure will do14:45
prologicBut at this point if I try Photon v4 that that exhibits the same behaviour, I'm a bit unwilling to go debug this for VMWare :/14:46
prologicI might have to decide whether running Photon as our base os for docker is really a good cohice14:46
Krikkehow is one supposed to use the network config? does it also require a magic comment at the top of the file?15:07
Krikkehttps://pastebin.com/rQXm7eMY15:08
Krikkelol just realized you can mount the iso :)15:13
Krikkeseems at least network-config exists there15:13
Krikkenetplan is also installed I think, it's an archlinux openstack image15:14
Krikkeif it's not an dependecy for something I'm installing15:14
Krikkerequired by: cloud-init15:15
Krikkeand I'm not installing that explicitly15:15
Krikkeah, removing the networking: from the start did the trick15:23
jas02Hello guys, I am having problem with cloud-init and ssh public key. What am I doing wrong? https://gist.github.com/jas02/868ab330e05b126e909934238e58760716:55
jas02Figured it out, it woks now17:06
dwigtonIn ubuntu 20.04 server, if I add some settings in /etc/cloud/cloud.cfg.d chould they automatically run on reboot or is that a seperate setting? Asking because it didn't take effect until I did "cloud-init clean" "cloud-init init" That seemed a bit overkill.17:35
dwigtonI don't particularly want new server keys everytime I make a change.17:36
=== ijohnson is now known as ijohnson|lunch
=== ijohnson|lunch is now known as ijohnson
blackboxswfalcojr: and Odd_Bloke I finally came out of a tunnel/hole on integration tests for Azure handling case-insensitive product UUID across kernel upgrades. I *think* I've got my ducks in a row on this. but wanted some feedback on better debugging what's going on here21:54
blackboxswjust pushed ba8e07159b748228eb2bbf5d807cbc2956e535f5 to https://github.com/canonical/cloud-init/pull/79821:55
blackboxswoops n/m the help debugging. I didn't realize that there is repeated information exposing and reporting the user_data that I provided to the test case.21:58
blackboxswI just hadn't scrolled up far enough to see a real traceback21:58
falcojrglad I could help ;)22:00
Odd_BlokeGood work falcojr.22:12
Krikkewait cloud-init is canonical's?23:54

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!