/srv/irclogs.ubuntu.com/2023/12/08/#cloud-init.txt

=== IchabodCrane is now known as Kuraokami
Code_Bleuholmanb: can this getting merged be my b-day present? πŸ˜„   ( tomorrow is b-day )  - https://github.com/canonical/cloud-init/pull/465414:50
-ubottu:#cloud-init- Pull 4654 in canonical/cloud-init "dmi: support OpenBSD native reading" [Open]14:50
holmanbCode_Bleu: heh, maybe15:06
holmanbCode_Bleu: happy birthday! 15:06
holmanbCode_Bleu: no promises on merging, but I'm planning on getting in a review for it today15:07
* holmanb has a long todo list of PR's to review and wrap up (too many WIP PR's too)15:09
meenaholmanb, Code_Bleu: looking at that code I'm thinking it would be nice to build a fallback to dmidecode, but in a new PR.15:24
Code_Bleuholmanb: thanks πŸ˜„ 15:45
Code_Bleuholmanb: meena: I was also wondering if there could be some logic in cloud-init somewhere that if ds-identify doesn't work, that it would fallback to using the cloud.cfg.  I tested the new stuff ( without the new ds-identify ) and I assumed it would use my cloud.cfg, but it didnt.15:47
meenaCode_Bleu: no, you have it backwards15:47
Code_Bleuholmanb: it is Friday...so I understand the no merge on Fridays πŸ˜‰  15:47
meenaif you know that ds-identify won't work, you disable the service and hard-code it into cloud.cfg.d/15:47
holmanbCode_Bleu: I'll break the world on friday with a bad merge and sleep just fine15:48
holmanbCode_Bleu: (but then fix it on monday)15:48
Code_Bleumeena: ok, with the ds-identify being in my /etc/rc.local ( broken version ), I was just hoping it would see the failure and use the cloud.cfg...but ok.15:48
holmanbCode_Bleu: fyi, with only one datasource in datasource_list, ds-identify will use that datasource15:49
minimalCode_Bleu: I use cloud-init on Alpine without ds-identify15:49
holmanbCode_Bleu: is that what you want?15:49
meenaholmanb: i don't see what the point is of running ds-identify when you know the datasource_list15:49
Code_Bleuholmanb: I had datasource_list: [ ConfigDrive, CloudStack, None ] in my cloud.cfg15:50
holmanbmeena: sure, if you know what you're running on, why would you try to identify it?15:50
Code_Bleumeena: good point i guess15:50
meenaholmanb: that's very succintly put15:50
holmanbon the other hand, however15:50
holmanb.....15:51
holmanbwhat happens if your datasource "changes" in a flaky way?15:51
meenaI'm going to steal that sentence for my docs15:51
meenaholmanb: if you're in a hybrid environment and move from OpenStack to AWS15:51
minimalexactly, when I build a disk image for a specific cloud or hypervisor I just set the specific datasource15:51
Code_Bleuway to keep things minimal πŸ˜‰ 15:51
minimalfor generic use the default cloud.cfg has a list of all the datasources and it checks each in turn until it finds the appropriate one15:52
holmanbwhich can take a looooong time15:52
meenavery long time15:52
meenaminimal: does ds-identify work on alpine?15:53
minimalhadn't noticed, then again I don't use generic images often15:53
minimalmeena: never tried it15:53
holmanbdisabling cloud-init is really a better choice than generating bad ssh keys via DataSourceNone15:53
meenaminimal: why not try it now?!15:53
holmanbit would be reasonable to add ds-identify as a service before init-local15:56
minimalI'd have to check if it has any deps I'd need to add15:56
minimalalsof ro some reason I'd thought it was Bash-specific but seems it isn't ~(now) - shellcheck is happy its POSIX15:57
holmanbminimal: it uses dash on buntu15:57
minimaldash isn't 100% POSIX though, neither is ash on Alpine ;-)15:58
holmanbminimal: there are a couple of non-posix things I think (local keyword isn't posix iirc)15:58
minimalhmm, must be warnings-ignore for that then as shellcheck normally points that out15:58
holmanbbut I don't think there are any serious bash-isms besides a couple of things like that16:00
holmanband happy to modify for ash compatibility16:00
holmanblol16:00
holmanb$ apt search almquist     16:00
holmanbSorting... Done16:00
holmanbFull Text Search... Done16:00
holmanbdash/lunar,now 0.5.12-2ubuntu1 amd64 [installed]16:00
minimalyeah I use "local" myself all the time16:00
minimalso it simply needs to be run before cloud-init-local? ~Ok, I'll give ti a try later today16:01
meenato be fair, if ds-identify works on FreeBSD, it should work on alpine, too16:02
holmanbminimal: yep, before init-local is the right time16:04
minimalmeena: I'm not saying it won't work, just that I've never tried it & never needed it16:04
holmanbminimal: and really, it would be best to be able to disable cloud-init if no datasource is detected 16:04
minimaland the pre-existing init.d scripts didn't provide one for ds-identify16:04
meenarather than running into a 2-15 minute timeout…16:05
minimalwhat timeout?16:05
holmanbI assume meena is talking about the "timeout" of waiting for attempting to detect each datasource in series for all of the default datasources16:07
minimalhmm, don't remember any noticable delay in the past16:08
minimalI'll have another look and maybe time it16:09
meenaI think dch complained about 5~ minutes a few weeks back, because his machine was detected to be on OpenStack16:09
minimalwasn't that due to an issue around changes made for BareMetal Openstack use (by OVH) that were later reverted due to unexpected side effects?16:10
holmanbmeena: ahhh, openstack detection, running on arm?16:11
meenayes, most likely on arm6416:12
minimalgotta dash, back on in a while16:13
holmanbminimal: that might have been the case too16:14
holmanbbut openstack doesn't have a good detection mechanism on arm16:14
holmanbs/a good/any/g16:19
Code_Bleumeena: should I be able to change hostname and password in CloudStack and cloud-init should pick that up without having to do a cloud-init clean, right?17:17
meenaI don't know, i have to check17:18
Code_BleuI'm seeing in the logs that the set_password and update_hostname are running "successfully", but it's not updating until I do a clean and reboot.17:20
meenahostname i can Kind of understand, but password not so much17:21
Code_BleuI'm ok with the reboot, but I didn't think it needed to basically do a clean run of cloud-init to get that.  The set_passwords is in the cloud_config_module section, which i thought it would run without a clean.17:23
Code_Bleucould it be cached in /run or somewhere and it's a weird thing with OpenBSD again?17:23
Code_BleuI do see those in the /run directory...so maybe it isn't clearing that out like and then the running of cloud-init would then query and get the new values17:29
Code_Bleu/run/cloud-init/combined-cloud-config.json:90: "password": "xxxx"17:29
meenaCode_Bleu: I need to see if I can get this reproduced and debugged17:31
Code_Bleumeena: ok, thanks!17:31
meenai just have this stupid habit of overengineering things…like, I want to create a port before-hand :P17:32
Code_Bleuhttps://dpaste.com/2BT3U6DRK  - hostname is in /run file too.  Weird thing is ...it has both local- and local_17:32
meenaalso, CloudStack is not something I can setup easily lol17:32
meenaso I'll be testing other codepaths, and maybe having to fix those too17:32
Code_Bleumeena: actually there is a quick way to setup cloudstack locally..let me find what it's called again.17:33
meenato be fair, fixing those things would be good17:33
meenalet's see how far i'll get17:37
* meena 's not been feeling great today17:40
Code_Bleu:crossedfingers:17:40
Code_BleuπŸ˜‰ 17:40
Code_Bleusorry to hear that.  Hope you feel better soon17:40
meenamaybe the plague that was … plagueing my family last week has finally caught up with me17:40
meenaIts not Covid!β„’ at least.17:40
meenaSo that's 1 out of a billion other things that's floating around trying to kill us / make a home inside us.17:41
Code_Bleumeena: I believe this is what I was talking about with being able to spin up local cloudstack easily.  It's been a min. since I've messed with it...but from what I recall it was pretty simple. - https://github.com/apache/cloudstack/blob/4e46f5ad17fa16684b689c061c7cc52ad2e5b7cc/tools/docker/README.md#L917:42
meenaoh no not docker, anything but docker please πŸ™ˆ17:43
Code_Bleucome on...docker is fine πŸ˜„ 17:43
Code_Bleubut then again...I don't know what your main OS you run is...and if it's BSD, then well..maybe docker sucks on that ?17:44
Code_Bleumeena: the more I'm looking into things...it's looking more and more like the /run should be cleaned out on reboot and OpenBSD is not doing that.  Now the question is...where does cloud-init look to know not to run the "on first boot" stuff?  Is that also in /run?17:52
meenaCode_Bleu: https://github.com/canonical/cloud-init/issues/418017:54
-ubottu:#cloud-init- Issue 4180 in canonical/cloud-init "/run is not ephemeral on *BSD" [Open]17:54
meenait's not highly critical, but it's annoying17:54
meenaoh, Code_Bleu have you seen https://github.com/canonical/cloud-init/issues/423117:56
-ubottu:#cloud-init- Issue 4231 in canonical/cloud-init "On FreeBSD 13 password is not set after initial reboot with 'set-passwords, always' on CloudStack Datasource" [Open]17:56
meenaactually, let's do that hack for now: rm -rf /run ; ln -s /var/run /run17:57
Code_BleuπŸ‘ 17:58
Code_Bleumeena: that's weird.  who is this igalic person that opened up a bug report on this back in June? πŸ˜‰ 18:01
meenaJune? Good grief18:02
Code_BleuYou mentioned "not highly critical, but it's annoying"....well I pretty much need it to work so my customers can clicky clicky buttons in our UI to change hostname and reset password πŸ˜„ 18:03
meenayupp, making /run a symlink works. so we can do that before ds-identify and before any other thing runs18:03
Code_BleuπŸ‘ 18:04
meenaas in, it's ephemeral now18:04
meenaI still need to check the password change still18:04
Code_Bleuso, you adding this to existin PR or creating new one?18:04
Code_BleuI'm pretty sure this will fix the password too.  I see the password in /run and /run isn't being removed...so18:05
meenalemme prototype something18:07
Code_Bleumeena: I just tested manually clearing /run and running the "reset password" from my UI that talks to CloudStack...and it worked and changed the pw this time18:08
meenaO_o18:08
meenacool18:08
meenawe can commit to the hack for now, but I'd still like to be a good Unix citizen and make /run relocatable in our code/installer18:09
Code_Bleuso however you plan on getting /run to be /var/run and ephemeral...should fix those issues18:09
Code_Bleumeena: is FreeBSD or some BSD your main driver OS you use...or you use something else?18:11
meenaCode_Bleu: I'm running some Ubuntu derivate on this Laptop (elementary OS), and FreeBSD on my servers.18:12
meenaIn my first job, I was working on Solaris, and even had a Solaris workstation! (tho… amd64, not sparc)18:13
meenaand even tho it was amd64, that's still a long time ago lol18:13
minimalat various times in past I had NeXT Cube, Solaris/SPARC "pizza box", HP-UX workstation, and Alpha workstation on my desk ;-)18:15
minimalactually I think it was SunOS rather than Solaris18:16
Code_Bleumeena: you almost sound as old as me πŸ˜„ 18:17
* Code_Bleu is a Gentoo user, but work on all kinds of other Linux distros18:18
Code_BleuSorry meena: maybe I was thinking minimal πŸ˜„   HP-UX...yuck!18:19
meenaI have not had a computer in my house before 2000. Tho that doesn't necessarily say anything about my age, just about my economic background.18:20
minimalCode_Bleu: a lot of the telco stuff it did in late 90s/early 2000s was either HP-UX or SunOS/Solaris based18:21
minimals/it did/I did/18:21
Code_Bleumeena: also just noticed that in cloud.cfg i have the default user shell: /bin/bash, but for whatever reason the user was created with /bin/ksh.  Hrmm18:24
Code_Bleuwell πŸ’©   it's /usr/local/bin/bash18:25
minimalCode_Bleu: isn't that controlled by the OpenBSD shell defined in cloud.cfg.tmpl?18:25
Code_Bleuthe default is /bin/ksh, yes...but I just modified my default user and wanted to put bash...so i put /bin/bash and it should be /usr/local/bin/bash18:30
minimalcloud.cfg is created from cloud.cfg.tmpl so unless you override the default_user block via a file in /etc/cloud.cfg.d/* then the default will be used18:30
meenaCode_Bleu: yeah that seems bogus18:31
minimalI'll have to modify ds-identifty as its detect_virt (on Linux) only checks via systemd18:32
meenahere's the patch for now https://gist.github.com/igalic/9b090874cf1cc82009fff6de00cd347018:34
meenawon't be able to commit this until my goblin child is asleep18:34
Code_Bleucool, thanks18:35
Code_Bleumeena: openbsd?18:37
meenaCode_Bleu: i haven't gotten to OpenBSD yet, but also, just put the contents of that precmd function into rc.local18:44
Code_Bleumeena: simple enough...just wanted to make sure you didn't have some other way in mind.19:14
meenaCode_Bleu: update, https://gist.github.com/igalic/ea855d280b4f778a9692a23824c8d5d219:21
meenanow to write some sensible commit message(s)19:21
Code_Bleumeena: https://whatthecommit.com/19:35
Code_Bleujust keep refreshing page πŸ˜‰ 19:35
meenaCode_Bleu: https://github.com/canonical/cloud-init/pull/467719:41
-ubottu:#cloud-init- Pull 4677 in canonical/cloud-init "hack(sysvinit): On *BSD, create /run as symlink" [Open]19:41
meenathat's what I generally try to do: https://whatthecommit.com/c8a751333acd8052477112b0dd9a24d420:26
holmanbmeena: nice work on the openbsd PR21:01
holmanbmeena: just submitted a review21:01
holmanbCode_Bleu: ^21:01
holmanbrm -rf /run21:08
* holmanb blinks21:08
meenaholmanb: we live dangerously ;)21:15
meenaI could issue a warning instead to have the admin do it themselves21:16
holmanbheh21:18
holmanbif /run is not expected to be ephemeral, what does it mean for any other project that expects files there to exist across boots?21:19
* holmanb thinks about how we might integrate Path's assumptions into the build system21:20
meenaholmanb: /run doesn't exist on BSD21:21
holmanbthen why do we need to rm -rf it?21:22
holmanbwould it not suffice to leave the symlink where it is?21:22
meenathat's in case this is an upgrade, and it already is created, but not a symlink21:23
holmanbwhy would it be anything other than a symlink?21:23
holmanbsomething across upgrade do that?21:23
meenads-identify creates it on / right now21:23
meenaas normal directory structure. if we preempt that by making /run a symlink, the directory structure it creates is ephemeral 21:25
holmanbright, but that's only because ds-identify doesn't know that PATH_RUN should point at /var/run21:30
holmanbI assume you're not wrong, but this hack and doing this in the build system should be about the same level of work, I think21:31
meenaif we do it in the build system, we'd have to make ds-identify a template and that would complicate things21:33
holmanbspeaking of, should openbsd be setting the same file variables as freebsd/dragonfly?21:33
meenahmm?21:33
holmanbmeena: I don't think templetizing ds-identify is necessary21:33
holmanbor even modifying it21:33
holmanbjust set the PATH_RUN environment variable in the init script that runs ds-identify21:34
holmanbthe build system integration would be to get helpers.Path to do the right thing21:36
holmanbactually, build system integration wouldn't be necessary either21:37
holmanbugh, this reminds me why I hate Paths21:38
meenaenv PATH_RUN=/var/run ds-identify21:40
meenathe problem with that is that we then need to teach admins to do this too during debugging, and that we need to teach the rest of python cloud-init where to find /run21:42
holmanbpython cloud-init can be set in cloud.cfg21:42
holmanbvia system_info.paths.run_dir21:43
holmanband wouldn't admins use the dsidentify init script anyways when debugging?21:46
meenaI… dunno?21:47
meenadepends on what we tell them to do, i guess21:47
holmanbI'm hesitant to add a hack when we have what we need already (in a more elegant way), just need to update the default config for bsd and set the env variable21:49
meenai agree but still think the environment variable is too fragile21:51
meenaif we could pull uname parsing before evaluation of the RUN_PATH we could just say if $DI_UNAME_KERNEL = Linux, do current behaviour, else set the default to /var/run21:54
holmanbTrue, that could work 21:59
minimalFYI simple "generic" test on Alpine with NO ds-identify involved and cloud.cfg containing DS list of: ConfigDrive,LXD,OpenNebula,Azure,AltCloud,OVF,MAAS,GCE,OpenStack,AliYun,Vultr,Ec2,CloudStack,Bigstep,Scaleway,Hetzner,IBMCloud,Oracle,Exoscale,RbxCloud,UpCloud,VMware,NWCS,Akamai,NoCloud,None22:10
minimalin init-local stage it took 2.5 *seconds* to check through that list (including searching for various local ISOs/fses) before finding the NoCloud ISO22:10
minimala far way from 2-15 minutes...22:11
minimalobviously would be a bit different for a test using Metadata Servers rather than local ISO22:13
meenaminimal: I would've thought it goes searching in that order22:33
meenanever mind, when i properly think about it, this makes sense22:40
minimalmeena: it DOES go searching in the defined DS order yet only takes 2.5 seconds23:32
minimalit checks filesystems to mount, it checks /sys/class/dmi/, does ephemeral DHCP (for GCE Local) etc23:34

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