=== cpaelzer_ is now known as cpaelzer === janitha75 is now known as janitha7 === jrm2 is now known as jrm [21:27] meena: sorry for the question out of left field. Do you know if kenv kernel env var names are synonymous across freebsd, openbsd, netbsd, dragonflybsd etc? I ask because I'm wondering if this check should actually be is_BSD() https://github.com/canonical/cloud-init/blob/main/cloudinit/dmi.py#L161 [22:36] I'm trying unsuccessfully to get userdata scripts to execute. [22:37] - `cloud-init query --all | jq .userdata` returns "#cloud-config\nruncmd:\n ...' as expected [22:38] - passing a shell script also produces the expected result `loud-init query --all | jq .userdata "#!/bin/sh\...` [22:38] but logs and filesystem don't show these as executing [22:45] there is no `allow_userdata: false` key, and AFAICT I'm following https://cloudinit.readthedocs.io/en/latest/topics/format.html#user-data-script === SirScott6 is now known as SirScott === kenyon_ is now known as kenyon [23:11] dch: can you provide a pastebin of /var/log/cloud-init.log and/or your userdata? [23:11] hmmm `cloud-init status` returns "running" but no processes remain [23:12] systemctl list-units --type=service --state=active # probably will also show you someting is hung or incomplete etc. [23:13] this is FreeBSD 13.1-RELEASE amd64 with py39-cloud-init-22.3.4 btw [23:14] I don't have a cloudinit.log for some reason, but here is the various userdata etc [23:14] userdata https://git.sr.ht/~dch/cloud-confused/tree/main/item/var/lib/cloud/instances/5f05e50c-79bc-4d26-841c-4176dd41566d/user-data.txt [23:15] falcojr: btw this repo is the snapshot of /var/lib/cloud and the config /usr/local/etc/cloud/ off the system post-cloudinit running [23:15] hrm, ok BSD. `sudo cloud-init schema --system` should check that user-data provided is right format and header [23:15] status.json https://git.sr.ht/~dch/cloud-confused/tree/main/item/var/lib/cloud/data/status.json shows no errors AFAICT [23:16] ahh sorry cloud-init schema --system is only for #cloud-config specifically :/ [23:16] script looks fine to me [23:16] # cloud-init schema --system Error: Cloud config schema errors: format-l1.c1: File None needs to begin with "#cloud-config" [23:16] "computer says No" [23:16] heh [23:17] too true now that I know your user-data isn't #cloud-config different set of tools :/ [23:17] let me restart one and get the console log, it has all the cloudinit logs that we expect to see [23:17] your https://git.sr.ht/~dch/cloud-confused/tree/main/item/var/lib/cloud/data/status.json also shows that none of the other boot stages ran [23:18] interesting. I'm not yet familiar enough with all these files to know what I should expect [23:19] I'll stick with a basic shell script atm, in case #cloud-config has bsd-related bugs [23:19] I'd expect to see both a start and finished time for modules-config, modules-final and init-local. So those separate rc.d services are not being started in your image for some reason [23:19] it looks like the only boot stage that ran was 'init' stage in this image in order to discover the Ec2 datasource. modules-(config|final) is where all the user-data is acted upon [23:20] per https://canonical-cloud-init.readthedocs-hosted.com/en/latest/topics/boot.html [23:21] typically these stages are skipped in Linux if there is a system ordering dependency cycle that forces cloud-init's separate systemd init scripts from being run in the current boot target. [23:22] ok so once this next fresh boot finishes, I will re-run cloudinit locally without rebooting, this should be a bit easier to deal with [23:22] blackboxsw: btw I can't read that rtd-hosted URL, it requires GH auth and then 404 [23:23] https://cloudinit.readthedocs.io/en/latest/topics/boot.html is presumably close enough? [23:25] oops. my bad, we just started setting up a paid offering without RTD adds and not up for public consumption yet. It is exactly the same, sorry about mis-link there [23:25] both are a direct mirror of each other. [23:27] yes dch, there should be four rc.d scripts to get cloud-init functioning properly (and those init scripts should run the following in order [23:27] sudo cloud-init init --local [23:27] sudo cloud-init init [23:27] this is annoying, it was working a few months ago, and our new release broke something... hope to track bug down [23:27] sudo cloud-init modules --mode=config [23:27] sudo cloud-init modules --mode=final [23:28] ok, now with logs! https://git.sr.ht/~dch/cloud-confused/tree/main/item/console.log [23:28] https://git.sr.ht/~dch/cloud-confused/tree/main/item/console.log#L630 [23:28] L764 we got metadata ok [23:29] L816 we skip network deliberately [23:30] what I see in that boot log is https://git.sr.ht/~dch/cloud-confused/tree/main/item/console.log#L631 only the 'init' stage was run, no 'init-local' 'modules:config' or 'modules:final' stage log header when starting each boot stage [23:31] +1 on proper meta-data detected for Ec2 datasource discovery in L 764, yeah just nothing seems to have called `sudo cloud-init modules --mode=config` or --mode-final for the final two boot stages [23:32] +1 on proper meta-data detected for Ec2 datasource discovery in L 764, yeah just nothing seems to have called `sudo cloud-init modules --mode=config` or `--mode-final` `for the final two boot stages [23:33] hmm [23:33] "normally" on FreeBSD we just use `cloudinit_enable=YES` and that's all that's required to run the full gamut [23:34] Here are our systemd services templates for modules:config stage[1] and modules:final (each is separate in Linux) [23:34] 1. https://github.com/canonical/cloud-init/blob/main/systemd/cloud-config.service.tmpl [23:34] 2. https://github.com/canonical/cloud-init/blob/main/systemd/cloud-final.service.tmpl [23:34] blackboxsw: thanks for your diag help here, is there a log of a working one you can point me towards? [23:34] I'd expect something in rc.d for each of those [23:34] doesn't have to be FreeBSD, I just need to see what line we're missing [23:34] sure. and cloud-init analyze show typically organizing this output based on boot stages. one sec [23:34] on bsd here I have cloudinit, cloudinitlocal cloudfinal, cloudconfig [23:35] for example, this config is what we deploy in Oracle Cloud. Let me check if that still works... [23:39] ok, `cloud-init analyze blame|show|dump` all blow up [23:39] https://www.irccloud.com/pastebin/Zy4Osq8R/cloudinit_analyze_dump [23:43] presumably this is because there's no log file to digest [23:44] sorry crashed my browser: https://paste.opendev.org/show/bQuuSdQMl12zyPz9DQtT/ [23:46] on linux: absence of /var/log/cloud-init.log isn't a trace [23:46] root@dd-j:~# cloud-init analyze show [23:46] Cannot open file /var/log/cloud-init.log [23:46] ok! [23:46] we got it [23:46] but that could be just a newer commit [23:47] you are (all) right [23:47] cloudfinal needs to be run [23:47] this also causes `cloudinit status` to be "done" [23:47] ok so I'm curious when you find out what's off if you can give feedback on which rc.d script wasn't running or why [23:47] just for our context [23:48] yeah I think we can improve the port by adding a short message "enable these things or you will fail" [23:49] yeah good note: also `cloud-init status --format json`should give more information about the reasons we are in waiting state (it'll be in cloud-init version 22.4 ) [23:50] doesn't help today, but we could raise a bigger warning message if we are blocked on different stages not yet run [23:50] https://paste.opendev.org/show/biPxW0DUiq8xbx6lZkIl/ [23:54] ok now we have this all figured out, I think there are 3 things: [23:54] 1. the FreeBSD port should be clear that you need to run all the commands now [23:55] 2. it shouldn't put stuff in /run/cloud-init/ but use /var/run/cloud-init/ like other BSD stuff [23:55] 3. it should (by default) produce logs. they are useful. [23:55] 4. the existence of the 4 boot rc.d scripts should be clarified. [23:56] I think all of these can be addressed downstream [23:56] 5. I owe you all some sort of beverage. Perhaps I should come to FOSDEM for the first time. [23:56] sounds like a great plan, and anything that makes sense upstream we would like to incorporate [23:57] Boom FOSDEM'd be nice that'd make two of us for first timers. [23:58] -> have to head out for dinner EndofDay. Take care thx for the help on BSD [23:58] I checked, I copypasted my cloudinit stuff from the FreeBSD openstack deployment. [23:58] I guess none of these worked fully. [23:59] although, reading my OCI patch, I definitely tested this and had it working. [23:59] https://reviews.freebsd.org/D34746 [23:59] that was ~ a year ago maybe?