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

holmanbmeena: what do you want exit status for? I get that the rcs interface is awkward but it does standardize command failure a bit, and I'm hesitant to add a second interface that does the same thing unless there's something we can't do with the existing one. 05:50
meenaholmanb: I've had to add error parsing to some commands to know whether a failure was something i need to act upon, or if it was acceptable to ignore08:14
meenaI've since tried to rectify that at the source: https://reviews.freebsd.org/D2716108:16
Code_Bleuholmanb: meena: Is there a reason we have linting disabled in the .pylintrc file, but then we are failing CI/CD jobs because of linting?  It would have been nice if this wasn't disabled for things like "unused imports" and I would have caught it in my editor before submitting a PR - https://github.com/canonical/cloud-init/blob/12bb6818a5ef5a7bd896ffffcc28093c9821967d/.pylintrc#L3015:07
VijayHi Everyone, I am new here and was trying to build an custom yocto distro. While I am running bitbake core-image-minimal command I am getting below error:15:58
Vijay| DEBUG: Python function extend_recipe_sysroot finished15:58
Vijay| DEBUG: Executing shell function do_install15:58
Vijay| git describe version (None) differs from cloudinit.version (20.3)15:58
Vijay| Please get the latest upstream tags.15:58
Vijay| As an example, this can be done with the following:15:58
Vijay| $ git remote add upstream https://git.launchpad.net/cloud-init15:58
Vijay| $ git fetch upstream --tags15:58
=== meena7 is now known as meeena
minimalVijay: isn't that a yocto-specific issue?17:16
=== meeena is now known as meena
Code_BleuHey meena o/~18:02
meenaCode_Bleu: yes, I'm back. (I've managed to pay for my server that runs my IRC)18:04
Code_BleuAre you sure we need the set_password() in distros/openbsd.py ?  I just went through a complete clean up of everything, including resetting my pw and ssh keypair within CloudStack and rebooted my instance, and it actually set the password and the ssh key in authorized_keys.  I was able to ssh with the key, and i removed the key and the password worked too!18:04
meenaweird18:06
meenaCode_Bleu: it falls back to https://github.com/canonical/cloud-init/blob/main/cloudinit/distros/__init__.py#L897 and OpenBSD doesn't have chpasswd18:09
Code_Bleumeena: yeh, i was looking at this - https://github.com/canonical/cloud-init/commit/993f3e3e76e56266a83776a8f54dbb3ba59cfce718:10
-ubottu:#cloud-init- Commit 993f3e3 in canonical/cloud-init "set_passwords: avoid chpasswd on BSD (#268)"18:10
Code_BleuI'm soo close to getting a working cloud-init openbsd image...woo whoo.18:12
Code_Bleunext issue in log to look into: https://dpaste.com/DZX7E8QXW18:12
Code_Bleu^ that might not be a deal breaker for me right now, not sure.18:13
Code_BleuThe next real thing I'd like to test to see if it will work, is 1. resize disk? 2. figure out better way to use services instead of commands in /etc/rc.local.   *Note: I'll prob roll with /etc/rc.local unless you or someone else can help figure out the services better.18:15
meenaCode_Bleu: a lot has changed since that commit…18:16
meenaand for FreeBSD we have a working implementation but not for OpenBSD18:16
meenaoh no that boottime thing is my code :(18:16
meenayeah, OpenBSD doesn't have    libc.sysctlbyname()18:17
Code_Bleumeena: I get it needs to prob be better, but I'm kinda operating at a "if it works for me, i can get this image out there and help my customers be able to use OpenBSD image".  😄 18:17
meenabut at least it has kern.boottime lol18:17
Code_BleuI'd love to spend forever optimizing this with you 😄  , but I've got to get a working OpenBSD image so I can move on to other things...and still come back and help clean things up18:19
Code_Bleumeena: did you see my question above about the .pylintrc?  18:19
meenanope18:20
Code_Bleuholmanb: meena: Is there a reason we have linting disabled in the .pylintrc file, but then we are failing CI/CD jobs because of linting?  It would have been nice if this wasn't disabled for things like "unused imports" and I would have caught it in my editor before submitting a PR - https://github.com/canonical/cloud-init/blob/12bb6818a5ef5a7bd896ffffcc28093c9821967d/.pylintrc#L3018:22
Code_Bleuthat was it ^18:22
meenahrm, is it time to revert this: https://github.com/canonical/cloud-init/commit/7aa26486394f98dbc2bb3b61f9d49671e6d32af1 ?19:25
-ubottu:#cloud-init- Commit 7aa2648 in canonical/cloud-init "Use wget to fetch CloudStack passwords."19:25
Code_Bleuhrm19:40
Code_Bleuif you haven't searched it yourself, here is the link to the commit in Cloudstack that commit talks about - https://github.com/apache/cloudstack/commit/a72f14ea9cb832faaac946b3cf9f56856b50142a19:41
-ubottu:#cloud-init- Commit a72f14e in apache/cloudstack "Ensure the response is a proper http response."19:41
meenaI've got code to fix boottime20:10
Code_Bleumeena: cool!20:12
meenaCode_Bleu: https://github.com/canonical/cloud-init/pull/466720:19
-ubottu:#cloud-init- Pull 4667 in canonical/cloud-init "fix(util): Fix boottime to work on OpenBSD" [Open]20:19
meenanot tested on OpenBSD yet20:19
meenaand it'll need unit test fixes 20:20
Code_Bleumeena: I had put my PR in Draft mode, but am taking back out of Draft mode, as all linting is working and I think everything else should be good.20:24
meena👍20:27
=== kuraudo1 is now known as kuraudo
Code_Bleumeena: I tested with your updated boottime code and it seems to work.  I don't see that error anymore. - http://sprunge.us/iidhbs20:40
meenaCode_Bleu: but do you get the correct uptime in the logs? ;)20:41
Code_BleuI don't understand the cdrom errors at top though.  Why is/should it be checking cdrom?20:41
Code_Bleuthis?  Cloud-init v. 23.4 finished at Tue, 05 Dec 2023 20:37:32 +0000. Datasource DataSourceCloudStack.  Up 32.560216426849365 seconds20:42
Code_BleuI believe the UP before was '.....Up ?? seconds' if i 20:44
meenaand 32 seconds sounds realistic, though a bit slow, but we're all working on speeding it up20:49
meenaso it looks like we got all the pieces?20:49
meenads-identify / DMI will need unittest (fixes)20:50
Code_BleuI think so.  Other than the cdrom stuff I don't understand. 20:50
Code_BleuShould disk resize work with BSD?20:50
meenait only works with FreeBSD20:50
meenaand potentially NetBSD, when using ZFS20:51
meenaFreeBSD is the only BSD that has a UFS that can be resized online.20:51
Code_BleuOK, then if it's possible...then I'd like to see about getting this working for OpenBSD next then ;) 20:51
Code_Bleuoh...20:51
meenaso, that'd mean you'd need an initrd that boots before your OS and handles that20:51
meenaThere are standard procedures out there you can read up on, but I'm unfortunately not familar20:52
meenaThe only other UFS that I've had extensive exposure to was Solaris, they also added online resizing decades ago20:52
Code_Bleuinitrd for openbsd to do resize of disk before "switch root" to boot?20:52
meenabasically, yes20:53
Code_Bleuwhen I was looking into the ds-identify i did see unit tests needing updated, like you said.  I also saw that in the tests, It didn't have CloudStack as an option..so might be good to get that in there eventually, correct?20:54
meenahttps://unix.stackexchange.com/questions/527349/how-do-i-increase-root-partition#comment976383_52738320:54
meenaif there's a fast way to identify CloudStack, then, yes20:55
Code_Bleudoes sysctl hw.product not work?  it returns hw.product=CloudStack KVM Hypervisor20:57
meenawell, then we just need to add it!20:57
meenaCode_Bleu: i do see CloudStack in the list20:58
meena    dmi_product_name_matches "CloudStack*" && return $DS_FOUND                                                                         20:59
Code_BleuMaybe it was just in the unit tests I didn't see it.  I'll look again20:59
Code_BleuI was talking about the test_ds_identify.py.  No CloudStack there.21:00
meenaanyway, we need to figure out a hands-free setup for bsd.rd + growfs, and we need the port, then your work is pretty much complete, Code_Bleu 21:03
Code_BleuYup21:04
Code_Bleuand better service file handling at boot.  Until then, my PR only creates the service files, but I didn't have the build-on-openbsd add it to /etc/rc.local ...unless we want to do that for now, and then it can always be cleaned up later?21:06
holmanbminimal: your ifupdown-ng PR just landed21:06
meenaoh?21:08
Code_Bleumeena: the only 2 things I'm doing manually outside of my PR changes are these - https://dpaste.com/DMKEVTP9D21:11
meenaCode_Bleu: if cloud-init were a port, you'd put stuff into pkg_…something21:14
meenaAlso, i recommend overriding the main config in $etc/cloud/cloud.cfg.d/21:15
minimalholmanb: I'd forgotten about that lol (I added it as a patch to Alpine's package back in Jan)21:21
meenaminimal: isn't kaniini also an alpine dev?21:21
minimalnope, to busy with work (Chainguard)21:22
minimalmeena: well still seems to listed as maintainer for some packages but certainly stepped down from some roles due to work pressures21:25
meenaCode_Bleu: "Services installed from packages(7) may be started at boot time in the order specified by the pkg_scripts variable from rc.conf(8); the order will be reversed during shutdown. Services comprising OpenBSD base are started by rc(8)." there we go21:29
Code_BleuI kinda got the pkg_scripts working and running rcctl order command, but it would only run the first service "cloudinitlocal" and wouldn't do the rest.  I kinda thought for that to work it might have been expecting all of the services to be in a "running" state and somehow the next service needs to know it was complete to kick off the next service?????21:33
Code_Bleumeena: ^21:33
meenagood question. maybe a better question for #openbsd :)21:34
meenait'll try to get my unittests fixed, and we can see if we can get a port submitted21:34
meenaYou can volunteer as maintainer, sine you are more experienced with OpenBSD :P21:34
Code_Bleu💥 21:34
Code_Bleuyeh right21:35
Code_BleuI just started messing with BSD a few days ago.  I do run pfsense firewall which I believe is FreeBSD, but I mainly stay in the UI for that 😄 21:35
Code_BleuI'm going to try something.  I'm going to remove the REQUIRE in the service itself, because I think that might be looking for the other service to be running ( which it wont be ) and therefore it wont start itself.  I'm going to remove it from the service file and just depend on the pkg_scripts= to set the order.21:45
Code_Bleumeena: I decided to run ds-identify again after your recent changes and it appears to detect CloudStack! - https://dpaste.com/FED99P4P322:16
Code_Bleumeena: couple questions about that: 1. should we not have any ERRORS from running ds-identify?  that is the top of the dpaste link. 2. With this working, should ds-identify be a service as well, or is it called someother way?22:18
meenathe blkid stuff needs fixing22:19
Code_Bleuboard_name and chassis_asset_tag too?22:20
meenaI think we can ignore those22:26
Code_Bleuok22:30
meenafor now22:31
Code_Bleumeena: pinging the #openbsd channel again for service file stuff.  Hopefully I'll get some good info 😄  22:42
holmanb> should ds-identify be a service as well, or is it called someother way?22:46
holmanbit must be capable of disabling the other services, cloud-init's services don't call it directly22:46
holmanb@Code_Bleu22:46
Code_BleuI'm going to try setting the daemon_timeout=5 for each service.  Sucks, to have it wait 5 seconds for each service...but that might work.22:46
Code_Bleuholmanb: what calls ds-identify?22:47
holmanbCode_Bleu: on systemd, ds-identify gets invoked by a systemd-generator (before all other services)22:47
holmanbhttps://github.com/canonical/cloud-init/blob/main/systemd/cloud-init-generator.tmpl22:47
Code_Bleumeena: if you're still up, you can see the response in #openbsd. If not, i tried to capture it here - https://dpaste.com/BLBPF37KA22:49
holmanbCode_Bleu: that's a bunch of bash that basically does -> "if ds-identify discovers a cloud/datasource, then enable the cloud-init services, otherwise disable cloud-init services"22:49
Code_Bleuholmanb: ok, thanks.  I think the issue with OpenBSD is the services there are not typical to just execute and be done. Seems they expect to stay running. ( which is what I would have assumed for services as well ).  So, this is my current issue with "needing" to create services or just have the cloud-init commands ran from /etc/rc.local ( which seems to work in my testing )22:51
holmanbCode_Bleu: you're saying OpenBSD has no short-lived services?22:52
Code_Bleuholmanb: check out the dpaste above from what the peeps in OpenBSD are saying.22:54
holmanbCode_Bleu: did they offer an alternative?22:56
Code_Bleumeena: holmanb: I don't know.  The more and more I think about it with OpenBSD, I'm thinking the /etc/rc.local is the way to go 😄   Again, unless I'm missing something that would actually need it to be a service for some reason?22:57
meenaI think that's what Goneri does, too22:57
holmanbCode_Bleu: no clue what "service" and "rc.local" mean, /shrug22:57
holmanbCode_Bleu: sorry22:57
holmanbCode_Bleu: but from rc.8 "Normally, rc.local contains commands and daemons that are not part of the stock installation."22:58
Code_Bleuholmanb: basically in /etc/rc.local it is running the cloud-init commands and a wait.  That's it.22:58
holmanbCode_Bleu: so sounds like you're on the right track22:59
holmanbCode_Bleu: but also "rc.local is executed towards the end of rc"22:59
Code_Bleuholmanb: that is how I have it working currently...but thought I might have needed to have a bether "service" approach...but it's not looking promising 22:59
holmanbwhich makes it sound like maybe not all of the services should go there, since cloud-init needs to to be running before network is up to operate correctly23:00
meenayeah, in FreeBSD, we have a bunch of things that are just tasks, like clean_var, and we can still depend on them / their completion 23:00
holmanbCode_Bleu: most projects should never need to hijack the init system and hold it hostage until network configuration can be remotely gathered, but that's precisely what cloud-init does, so that it can have a network configuration ready on first boot23:01
meenabut FreeBSD's rc has diverted from NetBSD's massively. don't know if NetBSD supports that, or where OpenBSD's rc is from23:01
Code_BleuI believe OpenBSD is a fork of NetBSD23:02
meenaaren't we all23:02
meenaholmanb: i might have to rethink some ordering in FreeBSD… 23:02
holmanbmy lineage is traced from multics thank you :P23:03
Code_Bleuholmanb: but, the way i have it in the /etc/rc.local seems to work for me though.  So, i'm not really understanding the "hijack" part.23:03
holmanbCode_Bleu: I mean it might "work" in some senses, but parts would be broken23:04
meenaIn FreeBSD we run after networking setup right now, and still work fine23:05
holmanbCode_Bleu: "hijack" as in, cloud-init sets up an ephemeral network to grab a remote config with the intention of dropping configurations in place before services start23:06
holmanbCode_Bleu: the local stage should apply the networking configuration to the system before boot. However, if your OS's networking service does something reasonable with a default configuration (i.e bring up network with dhcp), and network configuration is not needed, then yeah it will "work"23:07
holmanbCode_Bleu: and lots of times no remote network configuration is required, so "just work" should work in those scenarios23:08
holmanbmeena: does network v1/v2 work for freebsd?23:10
holmanbmeena: if so, I think the network activator should be what makes that possible23:10
holmanbmeena: but that would require a networking restart iirc23:10
meenaholmanb: we haven't had an activator until Code_Bleu made one lol23:11
Code_Bleuholmanb: https://github.com/canonical/cloud-init/pull/4660/files23:12
meenabut, iirc, Config Drive uses one of those, and that worked out fine23:12
-ubottu:#cloud-init- Pull 4660 in canonical/cloud-init "fix(openbsd): services & build tool" [Open]23:12
meenaCode_Bleu: i know i approved this already, but i feel like this should be split into multiple commits 23:12
Code_Bleumeena: I was just pointing out the activator change to holmanb :) 23:13
holmanbdid network config work at all on freebsd? I assume not23:13
meenaholmanb: yeah it did23:19
holmanbhuh23:19
holmanbhow?23:19
meenaon FreeBSD we explicitly have no Activator. check the code. i think you might've written it23:20
holmanblol, maybe I did XD23:20
meenathe thing is, network Config on BSD is so dead simple, and there's no real difference between Config and bring up23:21
meenayou're literally just putting ifconfig and route directives into rc.conf23:22
holmanbahhhhh, freebsd has only a renderer23:26
holmanbbut it works because the renderer acts also as an activator23:26
holmanbso it's just restarting the networking service after writing the config23:28
holmanbwhich is no big deal sometimes I guess, but cloud-init is also capable of writing the config prior to ever starting networking -> so no network restart required23:29
meenathat would be neat, but not tonight23:30
holmanbheh, not tonight agreed23:30
holmanbit complicates things a bit23:31
* holmanb stops looking at renderers and activators in cloudinit/net/ and backs away slowly23:36

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