=== hackedhead1 is now known as hackedhead [15:11] Okay i've tried to RTFM a few dozen times but I have an order of operations issue with user-data trying to include before networking is up [15:12] i've got a iso payload with user-data,meta-data,network-config, (nocloud) userdata strictly includes a remote resource.. btu its failing becuase network isn't setting up first [15:12] configs, notes here: https://armbian.lane-fu.com/linx/m3zebigz.md [15:13] Q: how do i get network-config to execute before #include in users data? [15:29] lanefu: not sure if this answers your question. But it looks like the launch is trying to detect nocloud "local" datasource which happens before your network config is "up". Offhand if you are using qemu to launch that ISO I think you'd want to specify `nocloud-net` datasource with smbios directives https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html?highlight=nocloud-net. That'll keep cloud-init from [15:30] trying to run with your user-data in pre-networking timeframe [15:32] blackboxsw: need to avoid doing smbios because eventually will be using some UEFI only images with qemu [15:33] for the record : In my previous config i was doing bios payloasd for the user-data url + dhcp and it was aweosme [15:35] lanefu: can you explain for me how you are launching this ISO currently with nocloud metadata? Just so I make sure I'm understanding the problem fully [15:38] eyah. did you happen to take a look at the link I shared? it has all my configs documented [15:38] will give you raw qemu command in a sec [15:39] to establish a baseline real quick: the ISO _is_ working.. the network is getting configured, hostname is getting updated.. it's just the #include remoteuserdata is happening too early [15:40] blackboxsw: okay this will make your eyes bleed a bit, but the raw command and templated https://armbian.lane-fu.com/linx/kjfuylbl.json [15:41] the extra stuff you see in there, which you're probably WTFing about is I have to overload some stuff to make it do what i want. [15:41] the iso generation, and deployment is all done via hashicorp nomda [15:41] nomad [15:42] it's qemu stuff works, but you have to sometimes twist its arm a bit [15:47] thanks lanefu, it'll take me a bit to digest this and try a wrap my head around the use-case here as I specifically haven't tried pushing `#includes` into nocloud user-data. If unable to set ds=nocloud-net in smbios directives to the launch. [15:48] I'm the king of unearthing edge-cases that are reasonable, but edge cases nontheless. :P [15:48] thank you for taking a look [15:50] someone suggesed that LEGACY network config might solve the order of operations issue.. but was trying to stick with the more modern option for purity purposes [16:01] lanefu: I'm just throwing out an untested idea here. I think in your provided meta-data you may be able to replace `dsmode: local` with `dsmode: net` [16:02] okay let me try that! [16:02] that should tell the NoCloud datasource to mandate that it run in init-network timeframe instead of init-local (before networking is setup) [16:11] naturally having to unwind another mess i created first :P [16:11] will report shortly [16:11] falcojr: also if we are adding test dependencies we might be able to quickly validate something like `./tools/run-container --unittest rockylinux/8` [16:12] lanefu: story of my life [16:12] blackboxsw: I checked and it's in rocky 8 [16:12] cool [16:12] yeah whatever we do as long as our copr builds don't break we have a prettty good smoke test [16:25] YES! [16:25] blackboxsw: worked! [16:25] thank you! [16:26] booom, I'll take that to the bank. Thanks. I might be able to put some docs together on this for future [16:27] nice.. any snippets I can offer? [16:27] i think that pastebin thing i shared pretty much is what i have tho [16:28] lanefu: have a github useraccount? [16:28] I'll send you a PR review request. I think we want to add some docs to https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html [16:28] blackboxsw: @lanefu [16:28] sure [16:29] GHuser makes complete sense :). I think we also want to provide a dsmode: net/local section at the top and a `::note ` about any remote #include resources require net mode instead of local [16:30] sweet yeah as I move further along on the project i'll try to circle back and see what other lessons i can share [16:30] fun triva fact.. my user-data and meta-data are in a consul KV store and i just have a small nginx write sitting in front of it [16:31] s/write/rewrite [16:31] +1 lanefu if you'd like to adapt the current text a bit and provide a PR, that'd be awesome. the content is here https://github.com/canonical/cloud-init/blob/main/doc/rtd/topics/datasources/nocloud.rst [16:31] we can walk you through getting into the project and shepherding that PR in [16:32] the more the merrier [16:32] tis the way [16:32] okay lemme drop that in ym notes so i dont forget [16:33] lanefu: great. to test doc generation it's basically just edit the rst file and `tox -re doc; xdg-open doc/rtd_html/topics/datasources/nocloud.html` [16:34] roger-roger [16:35] thanks so much... uncorked blocker in my long-term science project that i only rarely get to do deep work on.. aka only on holiday lol [16:38] nice [16:38] lanefu: interesting to see someone using nomad+consul with cloud-init, I'm heading in that direction myself [16:39] lanefu: BTW as a side note you're using virtio-blk, I assume that Ubuntu ARM should support virtio-scsi which is recommended and likely more performant [16:39] minimal: let me sanitize a job file and i'll share you some insanity [16:39] minimal: yeah..baby steps.. step one was get it to use virtio... i had to twist the qemu driver's arm with overload tos to od it [16:40] lanufu: my end goal is completely throwaway VMs using Alpine Linux run-from-ram combined with cloud-init [16:44] love it.. yeah lots of reallyt cool lean options these days especially with some microvm tech [16:44] which even qemu has a flavor now.. so you dont need firecracker etc [16:44] anyway yeah i'll drop some stuff in a repo shortly [16:45] lanefu: I hadn't thought as far as keeping the user-data inside consul (was thinking of some sort of script serving it up) [16:46] lanefu: my own script for cloud-init enabled Alpine images: https://github.com/dermotbradley/create-alpine-disk-image [16:46] not currently run-from-ram, is using "classic" disk install mode [16:48] blackboxsw: re lanefu's problem, is the issue not that networking config hasn't yeat been read from ISO but rather that the interface hasn't yet been brought up before the user-data #include is referenced? [16:50] minimal: yes that's ultimately the base problem. cloud-init has already rendered the network-config v1 that the seed ISO presented. But the networking-online.target in systemd hasn't been reached (and setup) yet. [16:51] because NoCloud detected during the boot local stage, basically happens before a `pre-networking.target` systemd unit which is before systemd-networkd actually brings up the configured network [16:52] blackboxsw: whereas for other DS the ephimeral DHCP would be up to give some network access... [16:52] `Before=network-pre.target` rather [16:56] minimal: I think yes. The ephemeral DHCP context manager for other datasources wouldn't get affected by this I believe because the cloud/backplane/environment DHCP servers would provide the necessary connectivity to access and pull down the remote #include resources. [16:57] I think I need to refresh on context there too, as I though in most cases user-data #includes generally shouldn't be processed until the init-network boot stage https://cloudinit.readthedocs.io/en/latest/topics/boot.html#network [16:57] *as I thought* [17:03] minimal: https://github.com/lanefu/lanecloud-snippets [17:08] lanefu: rather than using ISO have you though of using seed-urls? [17:08] minimal: yes. :P [17:09] i started from seed urls and came to ISO [17:09] lanefu: the only problem I had with seed-urls is that you cannot provide a network-config, its using "fallback" DHCP, and so any things like VLANs etc can't be configured [17:10] yeah [17:10] so my first iteration was great.. seed urls on DHCP nodes and rock n roll [17:10] but now I'm actually doing stuff like static public IPs [17:10] so need static config [17:11] and then with the custom armbian images we're doing... the x86 ones are UEFI only [17:11] so sadly its just cleaner to do the ISO [17:11] and then send remote payload later [17:11] lanefu: you might find my script interesting - lightweight OS images :-) [17:14] lanefu: have you looked at firecracker support in nomad? It seems promising [17:17] minimal: starred your script looks cool.... I typically distance myself from Alpine strictly due to relgious issues, BUT I RESPECT IT :P [17:19] same on those repos. TIL a bit about consul && nomad thanks for the chat here [17:22] lanefu: religious issues? you mean OS-specific opinions? (glibc vs musl, systemd vs non-systemd etc) [17:22] yeah musl and just the package manager [17:22] alpine just annoys me cuz i'm in too much of a hurry to think differently [17:22] lol [17:23] debian brain is just easier for me code for [17:23] especially if i wanna use ansible etc [17:23] also i'm an Armbian dev [17:23] so just sometimes you gotta stick with your team even if they lose a lot of games [17:25] re firecracker: yeah def been on my radar, just gonna be a while before i get there [17:27] order of operations for project is: gracefully deploy any cloud-init generic images, with appropriate payloads sourced from netbox, consul, vault [17:27] then containers [17:27] then microvims [17:27] lanefu: I know the feeling - I've got a long list of stuff like that to try and integrate [17:28] so there's some additional context for all of this of course [17:29] but TLDR; a joke got out of hands after i discovered fiverr and a LOT of random cheap VPS nodes [17:29] and now i'm in the joking, but not joking phase [17:29] https://youtu.be/ptseUMG8VKY [17:30] so really going "make my own cloud provider" but an opinionated modern take as opposed to the mom and pop shops using proxmox and a billing/control panel platform on top of it for provisioning [17:31] and eventually mimic a lot of fly.io [17:31] but running on cheaper infra [17:31] cascading prerequisites lol [17:31] lanefu: interesting you mention fly.io - was looking at their docker->firecracker stuff and their use of Nomad recently [17:32] yeah... i was really mad when I found out they existed and already were doing "my idea" [17:32] I think though we're getting a bit off-topic for this channel ;-) [17:32] fair [17:32] lol [17:36] 'tis friday [23:57] https://devops.stackexchange.com/questions/15678/how-come-my-hostname-isnt-set-to-the-fqdn-with-cloud-init-when-using-prefer-fq