/srv/irclogs.ubuntu.com/2017/08/14/#cloud-init.txt

=== shardy is now known as shardy_lunch
=== shardy_lunch is now known as shardy
boxrickDoes cloud init run at first boot only or each and every boot?12:05
powersjboxrick: by default it will run at each boot. However, not all parts of cloud-init will run each time. For example, it does not need to generate ssh keys on each boot.12:31
boxrickOk lovely, cheers for that13:29
blackboxswrharper: I'm tearing out the cloud-init query subcommand, no need for Notimplemented() subcommands. We can add it in when we have something17:38
blackboxswas it is right now, you actually get tracebacks because we don't even setup the event stack  approporiately (undefinted parameters etc).17:39
rharperblackboxsw: +117:48
blackboxswrharper: I'm having trouble finding where exactly the module runtime is cached (and validated):w  is the frequency caching handling in cloud-init (19:22
blackboxswoops, typo-world. one sec19:22
blackboxswhaving a hard time finding where the cache of module runtimes is stored once a specific module is run... and where that frequency is validated to avoid running the module a 2nd time (for PER_ONCE frequencies)19:23
rharperblackboxsw: when you say module, you mean each cc_<module>  ?19:23
blackboxswrharper: yeah19:23
rharperso, in stages.py I Think you'll see the reporter setup19:23
rharperalso, the sem files, I think record some data19:24
blackboxswok, yeah I just wasn't really seeing log messages telling me cc_ntp, for instance, is being ignored because it's configured PER_INSTANCE19:25
blackboxswper "cloud-init --debug single --name cc_ntp"19:25
rharperso, when you run in single mode, not sure how well the logging is configured19:31
rharperif you look at cmd/main.py there's *complicated* logic w.r.t when/how logging is configured/enabled IIRC19:32
blackboxswahh I'm seeing the issue now. right logging is incomplete on the single commandline. The appropriate, and needed, messages about skippping due to invalid frequency, or disabled module etc just go into /var/log/cloud-init.log19:37
blackboxswright we need a stdout handler too if running single from the commandline (we don't want that in init,  modules or dhclient-hook subcommand cases I imagine as they are spawned by init or dhcp).19:38
blackboxswok and all semaphore logic is in cloudinit/helpers.19:41
blackboxswok now I get how that works19:41
rharperyeah19:41
TemporalBeingq: what is the intent with `runcmd`? Should it be possible to have multiple `runcmd` sections in a single cloud-init script and have them *all* run or does only the *last* get run?20:26
TemporalBeing(I've found that `package_update` and `package_upgrade` but `packages` installs stuff just fine.20:27
blackboxswmy understanding is that cloud-init piecies together all cloud-config parts ultimately into a single structure representing all  cloud-config parts. So if there are multiple-definitions of the same keys, the latest piece read is what gets honored20:29
blackboxswso I believe if there are multiple commands that we want to run via runcmd, you'd need to include them in a single runcmd list like the simplistic example https://cloudinit.readthedocs.io/en/latest/topics/modules.html#runcmd20:32
rharperblackboxsw: TemporalBeing: yeah, run_cmd takes a list;  package_update and package_upgrade are flags which map to a  distros package manager for fetching repository data (package_update on ubuntu/debian does an apt-get update); and package_upgrade does a apt-get upgrade20:35
rharpers/flags/booleans20:35
TemporalBeing@rharper: I haven't gotten package_update/package_upgrade to work, so I have two runcmd sections - one to do what those do, then after the packages are installed via `package` more to do other things, including enabling things from the installed packages.20:36
rharperTemporalBeing: what does your cloud-config look like ?20:39
TemporalBeing@rharper - something like https://gist.github.com/BenjamenMeyer/eaadf44fb6ac187465578cc6d02f59b920:48
rharperk20:50
rharperTemporalBeing: looks fine, you can collapse the write-files and run commands together;  I found one issue with your pip requriements file, you marked it b64 encoded, but it's just plain txt, so pip didn't like it, http://paste.ubuntu.com/25314461/21:02
rharpertrying that now; you'll be able to ssh in if you add a ssh key, and tail /var/log/cloud-init-output.log to see the apt upgrade/install, etc (output of runcmds end up there)21:02
TemporalBeingyeah, I had to sanitize it - the b64 encoding difference was part of that; the structure is basically the same21:02
rharperah, gotcha21:02
TemporalBeingmy biggest issue is that the first cloud-init data (creating the /root/.config, and pushing a file into it) isn't getting run at all; the rest seems to be working21:03
TemporalBeingcan't figure out why, and can't get cloud-init to dump anything useful to diagnose21:03
rharperhrm, let me see21:03
TemporalBeingtold if I remove some stuff then reboot I can get cloud-init to reprocess, which has kind of worked21:04
TemporalBeingbut no success in diagnostics of what's wrong21:04
TemporalBeingIf I need to rewrite to put everything into unique sections, okay...I can manage21:04
rharperso, you don't need to do a mkdir for things with write_Files21:05
rharpercloud-init will ensure the path to the file exists21:05
TemporalBeingit failed if I didn't :(21:05
rharperhrm21:06
rharperTemporalBeing: which cloud-init  version ?21:07
TemporalBeinginitially on Ubuntu 16.04, now 17.0421:07
rharperwrite_files module uses util.write_file in cloud-init, which calls a method ensure_dir() which does a recursive mkdir on the paths needed21:07
TemporalBeingso presently working with ubuntu's version 0.7.9-113-g513e99e0-0ubuntu1~17.04.121:08
rharperk21:08
* rharper removes the mkdir and tries again21:08
rharperwrite_files will happen first, then runcmd, then package-update-upgrade-install21:09
rharperTemporalBeing: hrm, I think runcmd happens too soon here;  I'm going to file a bug;  as per the docs, it should be running at "rc.local" like time, but21:24
TemporalBeing@rharper thanks for taking a look; refactoring some of my scripts too around the only the last perspective21:25
rharpernp, I'll paste the bug here and you can subscribe to it if you like21:25
TemporalBeingsure - thanks21:26
TemporalBeingthe `write_files` didn't create the directory :(21:28
TemporalBeingokay...I think I know what happened - I added another `write_files` section and the merge functionality isn't merging that section so only one of the two (the second) gets processed21:30
rharperyes21:30
rharperthat's what I mentioned about combining21:30
rharperboth runcmd and write_files takes a *list* of entries21:30
rharperif you have two top-level config keys, one of them will get clobbered when the configs are merged21:30
TemporalBeingit *should* have merged them - that's what the merging functionality talks about21:30
rharperit does mention that21:31
rharperlist type should append21:31
TemporalBeinghttp://cloudinit.readthedocs.io/en/latest/topics/merging.html talks about them getting combined together21:31
rharperso we may have a second bug here (possibly fixed in artful)21:31
rharperbut not yet in xenial21:31
rharperwill need to investigate that21:31
TemporalBeinggotcha21:31
blackboxswrharper: sorry I wasted a bit of your time on my 2nd review of cloudinit analyze today. I hadn't pushed enough content to you. I've addressed review comments now I think and updated docs.21:36
rharperblackboxsw: no worries;  I've implemented a quick summary verb we can use to print a one-line summary of the boot21:36
rharperI'll have a patch/MP for you tomorrow; but it allows a cloud-init analyze (no args) to print that out ala systemd-analyze;   then we can do the cloud-init analyze show|blame|dump etc as we do with params and such21:37
blackboxswbah, just saw your branch up CLI features21:38
blackboxswhttps://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/32899221:38
blackboxswI can rework my commandline.rst topic doc to incorporate your branch/changes21:38
rharperah, doc update21:38
rharperif you want, that's cool21:38
blackboxswok I'll pull it in. as I also touched on that21:38
rharperI just noticed that when reading rtd this morning21:38
blackboxswsorry it took so long to push it up21:39
rharpernp21:39
blackboxswrharper: question once you have a chance to tox -e doc on my branch. should all of that content be migrated to capabilities.rst?21:41
blackboxswor should it continue to live some a separate  page.21:41
blackboxswIt has a lot of your cloudinit analyze README.md notes etc.21:41
blackboxswwhich doesn't feel like it makes sense as the "entry" page of cloudinit capabilities21:42
rharperblackboxsw: lemme see21:50
rharperblackboxsw: so I'd make a new topic for the bulk of that instead of the CLI page;21:52
rharpersomething like a Boot Time Analysis21:52
blackboxswOk and then we just don't talk about cloud-init cmdline21:52
blackboxswmuch other than analyze specifically21:53
blackboxswso where should cloud-init single go?21:55
blackboxswan ammendment to the modules topic?21:55
blackboxswcloud-init (modules|init) are both kindof discussed on the stages topic21:55
rharperWe may want a general debugging/testing section where we can put both Analyze and single21:56
blackboxswthat sounds good, then I can drop the rest21:56
blackboxswand it won't collide w/ your branch21:56
rharperwe certainly can still have a cli reference section that just has mostly --help like output21:56
rharpermy branch is tiny21:56
rharpereasily rebased/appended as needed21:56
rharperI wouldn't worry about collision21:57
blackboxsw+122:00
blackboxswthanks22:00
blackboxswapproved https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/32899222:09
blackboxswand I pushed my doc changes again22:09
blackboxswseparate debugging/testing doc. dropped discussion of cloud-init (init|modules) as that's kinda covered by stages22:10
blackboxswgotta run for a few.22:10
rharperlater22:17
blackboxswback22:33

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