/srv/irclogs.ubuntu.com/2022/10/05/#cloud-init.txt

=== janitha72 is now known as janitha7
=== janitha73 is now known as janitha7
meenaaciba: thanks for the review12:29
acibameena: it's a pleasure12:36
* meena wonders why holman wants her to remove that # vi: line…12:36
lioyerarhello everyone, I have a question on module frequency once-per-instance, how cloud-init knows a module with that frequency is already launched? where the information is stored. Thanks14:11
lioyerarOk, i find a usefull link14:38
lioyerarhttps://cloudinit.readthedocs.io/en/latest/topics/dir_layout.html14:38
acibalioyerar: https://cloudinit.readthedocs.io/en/latest/topics/boot.html#first-boot-determination14:39
meenaGoneri: heya! I'll be writing lots of code… and probably rewriting lots of your code ;)15:14
Goneri@meena go ahead, ping me if you want me to test your changes.15:15
meenaGoneri: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266847 soon easier to test15:15
ubottubugs.freebsd.org bug 266847 in Ports & Packages "[newport] net/cloud-init-devel" [Affects Only Me, New]15:15
meenaalso, need to do that for NetBSD and OpenBSD, but, baby steps15:15
meenaOpenBSD folks were upset that make test doesn't (even almost) pass15:16
meenaand both, NetBSD and OpenBSD have their own cloudy thing, which does some very few basics…15:16
=== janitha73 is now known as janitha7
GoneriI've got my script that I use for bsd-cloud-image.org, they are all public, but yeah an up to date port is important.15:17
GoneriCloudy thing?15:17
meenaGoneri: http://ports.su/sysutils/cloud-agent for OpenBSD, and ec2_init for NetBSD: https://nxr.netbsd.org/xref/src/distrib/utils/embedded/files/ec2_init15:20
=== janitha72 is now known as janitha7
shivayahi folks, is there a way to have cloud-init (user-data) create raid 1 root disk? i was going through the docs and was unable to find any info on that16:34
meenashivaya: unless you do it as a bootcmd, and it doesn't destroy the existing root disk16:47
shivayameena: how do you mean? let's say I have 2 blank disks and I wanted to have cloud-init make them into mdraid and install the OS on it16:58
meenashivaya: that's not what cloud-init does. you usually put an image onto a machine, and cloud-init fits it properly17:40
shivayameena: so cloud-init is not supposed to be used as a replacement to the old preseed automated install? 17:58
holmanmeena: no need, you don't have to remove that line18:04
holmanmeena: I don't see the value in having it in every file (we don't switch format per-file), and only some of the files have that line so for consistency I've been dropping it when I see it.18:05
meenaholman: aye, I can drop it, no problem18:06
meenaholman: it's not like we don't have an auto formatter18:06
holmanmeena: right18:06
* meena goes to get laptop18:07
holmanmeena:  that's a pattern I've seen in other older codebases, but it seems a bit dated and I've never gotten a straight explanation on it (why not just mention [neo]vi[m] format expected in a dev doc)18:08
meenaholman: dropped it, will follow that in the future with other files18:12
holmanmmeena: sounds good :)18:12
holmanshivaya: "old preseed automated install" sounds like you're talking about subiquity's autoinstall usage of cloud-init18:13
shivayaholman: yes, i was under the impression that cloud-init is THE new autoinstall method 18:18
shivayanow i am confused, can't figure out the difference :)18:18
holmanshivaya: Subiquity is an OS installer (which happens to use cloud-init). 18:18
holmanshivaya: cloud-init: inits cloud images18:19
shivayapardon my ignorance, what is supposed to be used as autoinstall with subiquity? something like kickstart on RHEL or d-i on debian 18:20
holmanshivaya: I don't follow the question18:20
holmansubiquity is the autoinstaller18:21
shivayaah not the ubiquty :). say i want to have pxe boot ubuntu iso and run automated install. looking around i figured cloud-init was the way to kick off the automated install like that. sounds like i was on the wrong path 18:22
meenayeah, no18:22
meenacloud-init is not a replacement for kick-start or d-i or similar18:23
meenaonce you're done installing stuff, you create a (golden) image, and go from there18:24
holmanAh, just noticed that the autoinstall docs describe their config as "cloud-init config", which is not actually a valid cloud-init config. That's unfortunate :/18:24
meenathis might be less useful for hardware, unless you're provisioning loads of the same hardware18:25
shivayai thought i read somewhere that ubuntu is dropping the support for preseed unattended install (d-i) in favor of cloud-init autoinstall 18:25
shivayaso what is the preferred way of doing the unattended install these days do you know? 18:25
shivayatbh cloud-init works fine for me for what i need it except the mdraid on root disk 18:26
shivayahttps://discourse.ubuntu.com/t/server-installer-plans-for-20-04-lts/13631 - this is what i ran across 18:26
holmanshivaya: yeah, again unfortunate wording by docs of a different project (which causes confusion like this)18:30
holmanlooks like this maybe -> https://ubuntu.com/server/docs/install/autoinstall18:31
holmanjust realize that where it says "cloud-init config" it's talking about its own yaml-based config that isn't actually a valid cloud-init config18:32
shivayathanks for clearing things up, i thought the yaml IS the cloud-init config 18:32
holmanthat's what is says, doesn't it :/18:32
holmanit's not18:32
shivayagotcha, sorry for the noise on the channel! 18:33
holmanshivaya: No problem at all, you came to logical conclusions. Sorry I can't help more.18:34
shivayayou helped plenty, thanks again! 18:34
meenaholman: what needs to happen for my two PRs to be merged?18:54
holmanmeena: me to look at them, sorry one sec18:54
falcojrholman: and for us to fix integration tests on main... :/18:56
holmanerr, that too18:56
* meena wonders how hard it would be to fix make check to run on not-Linux18:57
falcojrholman: I'll get on that18:57
holmanfalcojr: thanks! let me know if/how I can help18:57
holman(happy to review)18:58
meenawho broke then anyway?18:58
falcojra change to cloud-images19:00
meena🎶 who are the cookies from the cookie jar 🎶 19:01
falcojrit's an LXD related change that we use in our integration tests19:01
=== janitha73 is now known as janitha7
* meena builds a VM to to … make check…19:39
falcojrblackboxsw: did we apply the diff here somewhere? https://github.com/canonical/cloud-init/pull/173419:44
ubottuPull 1734 in canonical/cloud-init "testing: focal lxd datasource discovery (SC-1256)" [Merged]19:44
falcojrI could swear I did, but I'm not seeing the change on main19:44
falcojrthe diff in the comment, not the actual PR changeset19:44
blackboxswahh no falcojr thanks for redirecting me to something useful.19:46
blackboxswI had said I'd look over the failing integration tests, and my supplemental 'fix' was partway toward that end19:46
falcojrgotcha, I'm currently fixing CI, so was going to steal that19:46
blackboxswok thank you19:47
blackboxswsteal away.19:47
blackboxswI was distracted by openstack multi-nic rendering questions19:47
falcojr"fix your cloud"19:47
falcojrbut I have wondered if we should allow a way to override network config in userdata after the fact19:48
blackboxswhah. historical reference point: James+119:48
blackboxswyou mean a network_deferred key?19:49
blackboxswit would be a cloud-platform generic way to do that if folks really want to override/augment network config beyond what the cloud IMDS or static seed files present to the instance.19:50
blackboxswand folks wouldn't have to generate custom images and relaunch them, or provide runcmd hacks to regenerate and apply network config after the fact19:50
falcojryeah, something like that19:51
blackboxswbut there's a lot of potential thrashing... and corner cases. potential of 1. other systemd units/services getting blocked or interrupted when they thing final network config is done, and 2. what does cloud-init do across reboot if network scope is rendered `Event.PER_BOOT` is set does it continue to reapply supplemental user-data config if IMDS base network config changes etc19:52
blackboxsw*when they think final network config is done*19:53
blackboxswan interesting idea we could spike to see get broader feedback and see possible failure paths. Given the # of requests or attempts for setting network-config in user-data it might be a somewhat applicable use-case for folks who can't control the network metdata surfaced from IMDS and don't want to generate custom images19:54
blackboxswsince you are on CI failures, I'm reviewing PRs. 19:55
falcojrhttps://github.com/canonical/cloud-init/pull/1776 ready for review20:49
ubottuPull 1776 in canonical/cloud-init "tests: Use LXD metadata to determine NoCloud status" [Open]20:49
blackboxswfalcojr: running it through bionic/focal VM/container now20:53
blackboxswalmost complete on your doc Pr20:53
blackboxswreally nice work on that btw.20:53
falcojroh whoops...sorry if you were still looking at the LXD one, I took your comment and Brett's +1 as good to go21:02
meenawhat makes cloud-init decide I need to fetch data from some URL, after reading an instance-id from a locally mounted meta-data?21:04
blackboxswfalcojr: all good, just letting the integration test run out on VM and container, I don't expect a problem, but wanted to see it before our daily jenkins runners see it21:04
blackboxswmeena: generally yes. if instance-id changes from what was cached down in /var/lib/cloud/data/previous-instance-id it'll determine that metadata configuration needs to be reapplied21:06
meenablackboxsw: but I did a cloud-init clean -slr, and I don't think cloud-init ran before21:06
blackboxswmeena: but each cloud platform may surface instance-id changes differently, and each cloud may also force a retry of get_data per boot because the datasource supports  EventType.BOOT, network config (Azure, Ec2, OpenStack, Rbxcloud):n21:08
meenablackboxsw: https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html so, how misleading is it to create meta-data here?21:10
blackboxswmeena: I didn't follow.21:10
meenablackboxsw: if cloud-init boots, and discovers no-cloud then reads meta-data, and decides to ignore the user-data and fetch it from somewhere else, isn't it… wrong to set meta-data?21:12
blackboxswstill don't follow the train of thought. If you create metadata in /var/lib/cloud/seed/nocloud(-net)?/meta-data and launch any instance on any cloud, NoCloud datasource will get detected even before the cloud-platform (because of /etc/cloud/cloud.cfg.d/*.cfg "datasource_list" key which defines priority order of datasource and metadata discovery.21:12
meenaI should check the logs where this goes wrong then21:13
blackboxswIf cloud-init sees nocloud meta-data and user-data files in a seed directory (both are             "required": ["user-data", "meta-data"]) to detect nocloud datasource, then cloud-init should be bound to only use NoCloud datasource seed files for the life of cloud-init on that instance/config. It shouldn't also source other user-data sections or IMDS from other clouds.21:14
blackboxsw+121:14
meenahttps://im.eena.me/uploads/553f0e1cba8d0628/cloud-init.tar.gz ← collect-logs21:15
blackboxswyeah the comment "and fetch it from somewhere else" threw me for a loop as once a datasource is discovered, cloud-init doesn't try to merge any other datasource config sources. Just user-data/meta-data/network-config/vendor-data for NoCloud21:16
meenalet's see.21:16
blackboxswfrom cloud-init-output logs looks like no ds-identify available because cloud-init is trying all the datasources instead of a subset of viable datasources detected by /usr/lib/cloud-init/ds-identify, assume BSD (and it's you :) ).21:18
blackboxswpython code looks to be trying to detect the right priority order of datasources `2022-10-05 21:02:02,432 - __init__.py[DEBUG]: Looking for data source in: ['NoCloud', 'ConfigDrive', 'Azure', 'OpenStack', 'Ec2'],`21:19
blackboxswmeena: looks like that image doesn't actually have nocloud seed files in /var/lib/cloud/seed/nocloud/user-data/var/lib/cloud/seed/nocloud/user-data or /var/lib/cloud/seed/nocloud-net/user-data. So it says, Nope! " ` SUCCESS: no local data found from DataSourceNoCloud`21:21
blackboxswnote if cloud-init did find non-empty nocloud seed files in /var/lib/cloud/seed/* it would have logged the number of bytes read for those file reads21:22
meenablackboxsw: i have an cd9660 image attached21:22
meenait's not being mounted21:22
blackboxswmeena: is `util.find_devs_with("TYPE=iso9660")` returning anything for you?21:30
meenablackboxsw: i think i have a typo in my image name 😬21:31
meenai dunno how, but that typo might have also created a 20 GB image…21:33
meenacan I alter the "default" user's shell?21:35
blackboxswI think you may be able to provide this:21:40
blackboxsw#cloud-config21:40
blackboxswsystem_info:21:40
blackboxsw  default_user:21:40
blackboxsw     name: bsduser21:40
blackboxsw     shell: <something_else>21:40
* meena needs fish as shell, but fish needs installing…21:41
blackboxswthis is 'off the beaten path' otherwise you could modify the config in /etc/cloud/cloud.cfg on the image to set system_info: default_user: shell: there in the base/system config21:41
meenablackboxsw: everything i do is off the beaten path…21:43
* meena grew on Solaris and FreeBSD… in a Linux world.21:44
meenarunning gmake check on FreeBSD 14.0-CURRENT now… 21:45
meena========================== 146 failed, 3908 passed, 10 skipped, 240 warnings, 419 errors in 85.07s (0:01:25) ==========================21:46
meenafirst round21:46
meenanow let's see how it fares with bash installed :D21:47
holmanmeena: I remember now that chkconfig on/off is how the sysv init systems I used to use enabled/disabled services21:47
meenaholman: oh, right! I remember that too!21:47
holmanI forgot that el6 actually did use sysv21:48
meena========================== 124 failed, 3930 passed, 10 skipped, 240 warnings, 419 errors in 83.89s (0:01:23) ==========================21:48
meenathat's not too bad.21:48
holmanNice :)21:50
meenanow with pytest-cov and pytest-mock installed: ================================ 127 failed, 4346 passed, 10 skipped, 243 warnings in 86.72s (0:01:26) ================================22:00
meenaso, just 1 signed byte to fix.22:00
meenaE           AttributeError: module 'socket' has no attribute 'AF_NETLINK'22:01
holmana _very_ linux attribute right there22:01
meenamight be one of those cases where we just add @skip on not-Linux.22:02
holmanthat's used in Azure's _wait_for_all_nics_ready()22:03
meenaaye22:04
meenai think that's enough for tonight tho22:04
holmanseeya o/22:05
meenajust to write this down, before i forget: to get tests running on FreeBSD, install: python3, gmake, py39-pytest, py39-responses, py39-pytest-mock, py39-pytest-cov, bash. (the py39- probably varies, and I need to find out how to do better)22:08
meenadevel/py-pytest devel/py-pytest-cov devel/py-pytest-mock devel/py-responses22:10
meenao/~ good night now22:10
blackboxsw\o22:20
meenafrom bed: https://github.com/canonical/cloud-init/pull/1773    green!23:11
ubottuPull 1773 in canonical/cloud-init "OpenBSD: remove pkg_cmd_environ function" [Open]23:11
meenaholman: alpine uses open-rc, which has a service wrapper, but the enable/disable work differently. i talked to minimal about this, and they have a different view on whether to provide such things to begin with23:13

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