[01:41] Does cloud-init 19 not work with the latest netplan stuff? [04:33] Smithx10: it should. if a particular use-case isn't working, we'd love a bug. cloud-init should emit /etc/netplan/50-cloud-init.yaml on Ubuntu Bionic (18.04) or later [04:33] I got it to work [04:33] It took me a good 30 minutes to figure out what this thing was doing [04:33] i still kinda have no idea what its doing [04:34] but address ! [04:37] yeah network-config for cloud-init could come from a variety of sources, kernel cmdline, datasource metadata or /etc/cloud/cloud.cfg.d files and cloud-init network renderers will spit out network configuration files (sysconfig, /etc/network/interfaces/ or /etc/netplan) based on what distribution it detects it is running on. [04:38] yea, the logging is pretty errrr [04:38] Also figured otu that I had to reboot the machine in order for it to configure an interface [04:38] pretty noisy for sure [04:38] Or I was running the wrong commands [04:38] i was doing cloud-init clean and then unsetting the interface and downing it [04:39] then running cloud-init init and it wouldnt do anything with it [04:39] bouncing would configure it [04:42] Smithx10: it depends on the datasource(cloud platform) you are running on what couldinit does. generally during reboot there are a number of stages where cloud-init wakes up and does some detection or configuration. All datasource and network config happens in either init-local stage (which is the command cloud-init init --local) or init-networking stage (which is the cloud-init init command you mentioned) [04:42] Best place to see that is in the Modules code? [04:42] What is donein local vs init? [04:42] Smithx10: trying to run those individual commands is not really a supported flow for cloud-init because cloud-init does initial system configuration on boot (and actually runs the other configuration stages like modules and final which actually configure things like users and ssh keys etc. [04:43] so missing any of the stages will likely lead to a misconfigured or partially configured system [04:43] yea, I'm kind of blaming linux for this. [04:43] heh :) https://cloudinit.readthedocs.io/en/latest/topics/boot.html [04:43] The user is happy, their Distro is gettin an addr now [04:44] Smithx10: to see what config modules are done in each stage: read /etc/cloud/cloud.cfg on your system [04:44] the cloud_init_modules: list is what's run in init (network already up) stage [04:46] cloud_config_modules: list == https://cloudinit.readthedocs.io/en/latest/topics/boot.html#config and cloud_config_final = https://cloudinit.readthedocs.io/en/latest/topics/boot.html#final [04:47] in local: some datasources that can be detected before network being up get checked for discovery so they can emit the right network config before the system brings up it's full network stack. the rest of the details should be in https://cloudinit.readthedocs.io/en/latest/topics/boot.html#local [04:55] hahaha [04:55] and this is all better than running a bash script [04:56] lol [04:56] Not the point of cloud-init, i get it :P [04:56] different problem [04:56] Thanks for the advice [04:56] I'll dive in tomorrow and with the docs in front of me find out more [04:56] hehe :) [09:52] hi guys, can anyone point me to the code distinguishing when a node is at is firstboot vs not-first? [10:13] or maybe how is the instances id generated because I can clearly tell from the logs that it changed === cpaelzer__ is now known as cpaelzer [15:35] hi, [15:36] I am trying to understand the cause of som errors logs in /var/lib/cloud-init.log I see this information https://pastebin.com/D4Fh4FmT [15:37] How could I understand how to get more info? Thanks in advance. [15:39] MAbeeTT: looks like the hostname file that was written what not written as proper json.. strange. peeking one sec [15:41] MAbeeTT: check /var/lib/cloud/data/set-hostname on your system to see if it looks like json [15:41] you can cat it and paste here if you like [15:42] or just ensure the following succeeds python3 -c 'import json; print(json.load(open("/var/lib/cloud/data/set-hostname")))' [15:45] ok, the idea is to understand how to proceed in next possible issues. [15:45] * MAbeeTT n00b. [15:45] one thing to also check is egrep 'Trace|Failed' /var/log/cloud-init.log as any issues setting the hostname in the first place (and writing that original set-hostname file) would have been emitted there [15:47] so above that current failure I would have expected to see cloud writing to set-hostname too. so a grep set-hostname /var/log/cloud-init.log would show you the order of operations on hostname related activity [15:48] ok, file says `/var/lib/cloud/data/set-hostname: empty [15:49] ` [15:51] strange as current cloud-init writes a dict always if it writes anything [15:51] write_json(prev_fn, {'hostname': hostname, 'fqdn': fqdn}) [15:51] cloud-init -v and cloud-id commands will tell us a bit more [15:52] also sudo cloud-init query --all will show you all metadata that cloud-init is looking at on your system (careful there may be sensitive information in there if you setup passwords and keys in your userdata) [15:53] and cloud-init query local_hostname should show you the standardized metadata value that cloud-init is sourcing when trying to set hostname [15:54] for more info: https://cloudinit.readthedocs.io/en/latest/topics/instancedata.html [15:55] ultimately this could be a bug once you track down where /var/lib/cloud/data/set-hostname is being written as empty. if so, run "ubuntu-bug cloud-init" and it'll allow you to create a bug and attach the cloud-init logs. [15:56] if you are on Ubuntu that is. on other distros "cloud-init collect-logs" creates a tar of all artifacts/logs to aide in debugging) [15:57] * MAbeeTT reading [16:00] this is a particualr instance ina lab, so there is no sensitie iformation, no problem. An error from my part is at the moment the best candidate for root cause. Anyway this is a good excuse for learning. [16:01] this is an ubuntu focal (20.04) vm in a proxmox PVE server, the cloud-init is generated by proxmox pve tool. (as cdrom drive). [16:06] MAbeeTT: if you are providing user-data to the instance at boot, it generally is the most-likely source if deployment issues. try "sudo cloud-init query userdata > my-userdata.yaml; cloud-init devel schema --config-file my-userdata.yaml --annotate" it will at least validate your userdata is proper yaml and may give hints about failures [16:07] run that on the system exhibiting failures just to double check a couple things about proper whitespace formatting. ... it's still work in progress (as we need better schema coverage) but it may find some glaring issues [16:08] https://cloudinit.readthedocs.io/en/latest/topics/faq.html has some typical debug suggestions [16:09] great. [16:12] from the part of formatting it seems there are no problems `Valid cloud-config file /tmp/my-userdata.yml` [16:12] ok, one ✔confirmed [16:18] `sudo egrep --color 'Trace|Failed' /var/log/cloud-init.log | wc -l 1` gives 3 tracebacks and 1 `Failed to get raw userdata in module rightscale_userdata`. Tis file is just last boot, previous boots are in cloud-init.log_ (just for clearance) [16:27] sudo cat /run/cloud-init/instance-data.json | jq '.v1.local_hostname' [16:27] shows the previous hostname (previous to cdrom rebuild and reboot) [16:28] well, i will be investiating diring the weekend, thanks you so much! [18:08] rharper: is there anyway I can ammend the author of the latest commit without forcing people to rebase? Somehow my last squash and merge for AWS Fred's PR ended up giving 'me' authorship' [18:09] maybe it's that the last commit on his branch he attributed to me via Test provided by: Chad Smith [18:09] blackboxsw: hrm; ISTR we had something like this before [18:09] I thought it was supposed to have multiple authors or something like that [18:12] I think we might have to add the directive Authored-by: if it has multiple attributions [18:13] hrm [18:13] I'm out of my gitfu level here... [18:15] strange is that that merge commit doesn't even have a merge marker from me vs the author like other merges I've squashed using the github ui [18:17] it wouldn't be terrible to amend with author fix; [18:18] rharper: but that changes the commitish, so it might break consumers of tip [18:18] doing that sooner rather than later will reduce the number of rebases needed, no ? [18:18] only if they've pulled since that commit ? [18:18] yes [18:18] I'm not saying do it Right Now, but I don't know another way; [18:18] maybe rbasak or other git folks know how best to handle this [18:19] and if doing we changed the author, I'd also like to correct fomatting on the cmt message and add the LP:#1866290 [18:19] worth a discussion in ubuntu-devel [18:20] yeah [20:43] community-notice: Ubuntu focal upload of tip of cloud-init master accepted [ubuntu/focal-proposed] cloud-init 20.1-9-g1f860e5a-0ubuntu1 (Accepted) [20:43] community-notice: Certified cloud images should update with 20.1-9 over the next couple of days [20:46] blackboxsw: nice!