/srv/irclogs.ubuntu.com/2020/05/04/#cloud-init.txt

meenathat seems like an interesting omission…09:36
Odd_Blokemeena: What does?13:42
Odd_BlokeLongLiveCHIEF: Can you confirm what version of netplan you had in that image (`dpkg -l netplan.io`)?13:43
LongLiveCHIEFsure, one moment13:44
LongLiveCHIEF0.99-0ubuntu3 for arm6413:46
LongLiveCHIEFq13:46
LongLiveCHIEFq!13:46
LongLiveCHIEFwhoops13:46
Odd_Bloke:)13:48
Odd_BlokeOK, bummer, that's the latest version.13:48
Odd_Bloke(So my hopes that this problem would be solved by someone else have been dashed. ;)13:48
LongLiveCHIEFyeah... :sad:13:48
LongLiveCHIEFthere's still many hopes in that regard. That particular bucket of hope is bottomless13:49
LongLiveCHIEFsomething interesting came up in #raspberrypi over the weekend about rfkill disabling wifi early on when wireless region wasn't set13:50
LongLiveCHIEFin wpa13:50
LongLiveCHIEF...and it did get me thinking13:51
LongLiveCHIEFis there a way to halt cloud-init and drop into a shell before a specific stage?  or to log output of a specific command after/before a stage?13:52
Odd_BlokeLongLiveCHIEF: OK, I've confirmed that waveform, the Ubuntu Pi person, is still looking into the wifi issue.14:03
Odd_BlokeI don't think we have a good way of doing something like that, no.14:03
LongLiveCHIEFno worries, i have my ways14:04
LongLiveCHIEFforward my info to the ubuntu pi person if he wants someone in the field to test and report.  my gh is longlivechief14:07
Odd_Blokeblackboxsw: I think we can improve your force-push method to not need a tracking file: we already have all that information in git history.  I'm putting something together now.14:50
mutantturkeyhi guys. i am building a custom image with packer. this gets build on digitalocean, and then reused on digitalocean. what this means is the first timeit runs it gets information from cloud-init regarding networking information, but when i instantiate  the image on a new virutal server that original network information is no longer correct15:29
mutantturkeythe problem is that, when i create a new server with this image, the FIRST time it boots, it has the incorrect information for networking15:29
mutantturkeyhowever, i think this is because the networking information is inputted into /etc/network/interfaces.d/* AFTER network services are already running. So the first time, it'll not have a net conncetion, but correct values, and then subsequently it will work just fine15:30
mutantturkeyso i am looking for an idea on how to solve this. My one thought was to move /etc/init.d/network to a later sysvinit stage15:30
blackboxsw+1 Odd_Bloke15:39
Odd_Blokemutantturkey: What distribution are these images for?  And how are you installing cloud-init?15:40
blackboxswmutantturkey: I'm not super familiar with packer builds. but do you have the opportunity to run 'cloud-init clean --logs' before shutting down that image and redeploying it?15:40
Odd_Blokeblackboxsw: `clean` wouldn't remove network configuration, right?15:43
blackboxswOdd_Bloke: no but it would tell cloud-init to re-run network config on next boot (the first redeploy of that created image)15:44
blackboxswI was making an assumption that mutantturkey's guess on /etc/network/interfaces.d/* being written AFTER networking services are running is probably unlikely15:44
Odd_Blokecloud-init should detect that its a new instance without a `clean`, though, so doing that could mask a more general issue on DO.15:44
Odd_BlokeIf cloud-init isn't plumbed into the boot sequence correctly, it's plausible (and perhaps likely) that it would run after networking services.15:45
blackboxswgood point. it *could* be a general issue with DO, but I was presuming it was an issue with how the image is being created with packer15:45
Odd_Bloke(And if we're talking about SysV init, then this presumably isn't an Ubuntu image, where I would have higher confidence that cloud-init will get plumbed in correctly simply via installation.)15:46
blackboxswOdd_Bloke: that's a good though too. yeah I guess if the before=networking-target.online (or whatever it's called) wasn't present then right, we could be in that camp15:46
blackboxswor sysV init too right15:47
Odd_BlokeRight, except we get no Before= in a SysV world. :p15:47
Odd_Blokeblackboxsw: https://paste.ubuntu.com/p/kbC4XkHq3H/ is my iteration of the force-push proposal.15:54
blackboxswOdd_Bloke: yes excellent16:37
blackboxswOdd_Bloke: though we need to limit that globbing to just debian/patches/*cpick*16:38
Odd_Blokeblackboxsw: When would we have any cherry-picks in the daily branch that we want to retain?16:38
Odd_BlokeOh, I suppose for non-devel releases?16:38
blackboxswOdd_Bloke: any release can have release-specific packaging, config disabling changs16:43
blackboxswand those debian/patches would not contain a *cpick* or fox-cpick prefix16:43
mutantturkeyblackboxsw: i do have that opportunity16:43
mutantturkeywould that fofce on next boot16:44
mutantturkeythats perfect16:44
mutantturkeythis is sysvinit, this is debian buster with a bunch of custom stuff on top16:44
blackboxswlike https://github.com/canonical/cloud-init/tree/ubuntu/xenial/debian/patches16:44
mutantturkeyi can do a rebuild will take an hour or two, dwill that clean thing work?16:44
blackboxswOdd_Bloke: ^16:44
blackboxswmutantturkey: the clean thing removes all semaphores that marked that networking was created in the first place.... but as Odd_Bloke mentoined, it might be masking some other pre-instance change that cloud-init tries to rely on when you are re-launching your created image16:45
mutantturkeyokay, then let me try that16:46
mutantturkeyagain, sysvinit is more opaque so i dont really want to muck with it if possible :-)16:46
blackboxswmutantturkey: and ok on sysvinit, and Debian, so as Odd_Bloke mentioned the sysvinit dependency ordering may not have been created in your debian image properly to ensure cloud-init writes network before network is brough up by the system, without a strict startup dependency added, cloud-init *could* be writing the network config too late as you guessed16:47
mutantturkeywhat does --logs do16:47
mutantturkeywouldn't i want t o keep my logs16:47
blackboxswmutantturkey: --logs rms /var/log/cloud-init.log /var/log/cloud-init-output.log16:48
mutantturkeyalright im giving it a swing16:48
blackboxswwhich should allow you to distill what cloud-init does on 'first boot' during your first relaunch16:49
Odd_Blokeblackboxsw: The presence of the semaphores isn't relevant if cloud-init isn't running at the right point in boot; we would expect the semaphore to be ignored for a new instance boot anyway.16:49
Odd_Blokemutantturkey: Installing cloud-init from the Debian archive?16:49
blackboxswOdd_Bloke: agreed, but it is useful to compare the last boot stage timestamp against the dmesg or journalctl logs16:49
blackboxswI was only thinking to avoid any previous boot logs from during the image creation process16:50
mutantturkeyOdd_Bloke: yes16:55
mutantturkeyokay, blackboxsw i will look at the logs. Clearing out the old config seems like it would be useful to force cloud init to redo its business.16:55
blackboxswOdd_Bloke: also I don't think we can individually just git log --online through all commits as we have had times where we needed to fixup interrelated cherrypicks and lack of a ordered set of commits across all cpick* patches would mean we can't back them out without conflicts partway through17:07
blackboxswactually oops. right git log debian/patche/*cpick* will order that for us properly anyway17:11
mutantturkeythat did not appear t owork, rebooting now17:19
mutantturkeywell now it's online but refusing ssh, i think something stuck let me try to reboot again17:26
Odd_Blokeblackboxsw: Yep, that should take care of it.17:37
blackboxswOdd_Bloke: good, tested and looks good. I'm resolving your review comments now17:37
Odd_BlokeCool, thanks!17:37
blackboxswOdd_Bloke: I think I'm done https://github.com/canonical/uss-tableflip/pull/4517:51
Odd_Blokeblackboxsw: Did you push?  I'm seeing a lot of unresolved comments.17:56
blackboxswhrm, maybe not. checking again and going through comments18:03
blackboxswI had missed about 5 comments Odd_Bloke pushed the changes18:43
=== tds4 is now known as tds
blackboxswGoneri: +1 on your branch https://github.com/canonical/cloud-init/pull/305/files with a minor nit. Just needs that and a rebase against master and we are good to go20:27
Goneriblackboxsw, done20:29
* blackboxsw just twiddles thumbs waiting on Travis thanks Goneri will land today20:30
Odd_Blokefalcojr: Thanks for the CLA PR, as you can see, I've landed it. :)20:41
falcojrcool, thanks20:41
Odd_Blokelucasmoura: Thanks for the CLA PR!20:49
mutantturkeyalright got sidetracked today but21:07
mutantturkeyfirst boot with cloud-init clean doesn't fix the problem21:07
mutantturkeyfirst boot i can verify has the correct *updated* configs21:07
mutantturkeybut it's not applied (i can see that via ifconfig)21:07
blackboxswGoneri: merged thanks !21:08
mutantturkeyrestarting networking does fix theproblem21:09
blackboxswmutantturkey: so Odd_Bloke's suggestion that maybe the deb didn't wire the proper SysV init script dependencies in your image might be the issue there21:09
mutantturkeyyep21:09
mutantturkeytheoretically i think i understand how sysviinit works but21:09
mutantturkeythe goal is, networking should run after cloud init21:09
blackboxswwe expect to have a 4 stages wired in the right order during startup something akin to this https://github.com/canonical/cloud-init/tree/master/sysvinit/debian21:10
mutantturkeyso those are all different init scripts in /etc/init.d right?21:12
mutantturkeyokay I have those files cool21:15
blackboxswmutantturkey: yep.21:15
mutantturkeyso during boot this should all go to syslog?21:15
blackboxswI was just checking an older release of cloud-init on trusty to confirm separate config files in /etc/init21:15
mutantturkeyyes i do have those21:16
Gonerithanks blackboxsw :-)21:19
mutantturkeyokay blackboxsw we have a lead!21:24
mutantturkeyit appears none of these are configred21:24
blackboxswmutantturkey: guaranteed to go to /var/log/cloud-init.log not sure where debian typically logs cloud-init emitted logfiles besides the default21:24
mutantturkeyif i read rc*.d right, anything that starts with S means 'start"21:24
blackboxsws/besides/in addition to/21:24
mutantturkeyk means, kill at tha trun level21:24
mutantturkeynetworking is in the rc.S runlevel21:24
mutantturkeyso looks like cloud-init's 4 things aren't gettng run at startp21:24
blackboxswthat sounds like reasonable failure path ;)21:24
mutantturkeythough clearly something is running because cloud-init does LOG21:25
mutantturkeyooff21:26
blackboxswmutantturkey: cat /run/cloud-init/status.json that'll tell you what stages did run (on newer cloud-init you can run "cloud-init analyze show")21:26
Odd_Blokeblackboxsw: Note that trusty is upstart, not SysV.21:28
blackboxswoopsie, right-o though our collection of init scripts mentioned here https://github.com/canonical/cloud-init/tree/master/sysvinit/debian should be all-inclusive of what we expect to see on debian right21:29
mutantturkeyS12networking21:29
mutantturkeythat's so whack21:29
Odd_Blokeblackboxsw: I wouldn't assume so (particularly as those haven't been touched in 7 years).21:30
mutantturkeywell that makes non sense21:37
mutantturkeylet me jump into #debian and seewhatup21:37
mutantturkeyblackboxsw: alright,here we go. it's at runelevel S, which is like single user mode, happens before evreything else21:41
mutantturkeythat's before _all_ the cloud service bits run21:42
mutantturkeywhich well makes since to me because other services might try to bind to a specifc IP etc and fail if networking is not up21:42
mutantturkeyso, givne that, is there a move to make here21:45
mutantturkeyso i think "cloud-init writes config files, but doesnt run ifup or the like to configure networking after then config is changed'21:48
mutantturkeybso my simple thought is another init file called /restart-networking-hack that runs on runelevel 6 that reruns ifup21:52

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