/srv/irclogs.ubuntu.com/2024/01/12/#cloud-init.txt

=== orndorffgrant3 is now known as orndorffgrant
=== Night0wl37 is now known as Night0wl3
holmanbOdd_Bloke/falcojr/minimal/meena: another big reason for a non-bash language is to have a proper yaml parser in ds-identfy19:20
holmanbwe likely have lots of hidden bugs related to this hacky parsing we do19:20
holmanbI just came across one19:20
falcojryes, it would definitely be nice to have real yaml parsing19:21
falcojrholmanb: are you saying https://stackoverflow.com/a/21189044 isn't good enough ;)19:22
holmanbheh19:23
holmanblets say you want a single cloud.cfg that descibes behavior on multiple clouds - you configure maas and ec2, for example: https://dpaste.org/e9JJh19:23
holmanboops, now ds-identify identifies MAAS as your datasource19:24
holmanband ds-identify produces a /run/cloud-init/cloud.cfg with the following:19:25
holmanbdatasource_list: [ MAAS, LXD, None ]19:25
holmanb(tested on lxd obviously)19:25
minimalsilly question, how does one test that ds-identify is actually working? (beyond looking at /run/cloud-init/dsidentify.log)19:30
holmanbminimal: good question, the answer isn't pretty19:31
holmanbminimal: tests/unittests/test_ds_identify.py19:31
holmanbthat is our unit test suite19:31
minimalwas playing "spot the difference" when looking at "with ds-identify" and "without ds-identify" cloud-init.log files19:31
holmanbminimal: the big different is going to be that /run/cloud-init/cloud.cfg will exist, which contains a datasource_list that overrides the one in /etc/cloud/cloud.cfg19:32
holmanbminimal: ds-identify will usually cut the list in cloud.cfg down to just one datasource (and None)19:34
minimalok, but if my datasource_list is "[ NoCloud, None ]" and cloud.cfg also has "[ NoCloud, None ]" then how do I *know*/prove the decision came from ds-identify and not the existing config file? ;-)19:34
minimalin that scenario boottime is actually slightly slower as ds-identify is being run lol19:35
holmanbminimal: do you want to know that for testing / validation? or is there some reason at runtime that you would want to know that?19:36
holmanbminimal: right, ds-identify running is going to add time over it not running (especially on not-systemd)19:36
minimalI'm testing my proposed changes in a VM and was expecting to see some evidence in the cloud-init.log19:37
minimali.e. some logline showing it using /run/cloud-init/cloud.cfg19:37
holmanbds-identify also leave behind /run/cloud-init/.ds-identify.result, which is like a "persistent" return code of ds-identify19:38
holmanb*leaves19:38
minimalok, just about to test a "generic" VM, i.e. where the datasource_list has a whole lot of entries compared to the NoCloud-only VM I've been testing so far19:40
holmanbI don't know whether anything will show up in cloud-init.log19:40
holmanbmaybe something about config merging, if that code logs which files it is merging19:40
minimalok, I just assumed something would appear there19:40
holmanbminimal: yeah I don't think you would see this line in cloud-init.log without ds-identify:19:43
holmanbReading from /run/cloud-init/cloud.cfg19:43
holmanbit isn't obvious 19:44
minimalside question: should "None" be specified any more in a datasources_list? I got lost with various changes related to this over the past few months19:52
minimalI mean in any datasources_list that I might put into a config file19:52
minimalholmanb: ok, tried with "generic" VM and yes cloud-init.log shows "NoCloud" is determined/used which I guess comes from ds-identify20:16
minimalcloud-init-local however still runs blkid on the cdrom device to check its label, fs type etc even though /run/cloud-init/ds-identify.log contains ISO9660_DEVS=/dev/sr0=cidata20:18
minimalFS_LABELS=cidata,alpine-root, got_label=cidata etc20:18
minimalshould'nt cloud-init-local use this info provided by ds-identify rather than search for a NoCloud YAML source?20:19
minimalholmanb: another unrelated question, I'm adding a new shell script to tools/ that is installed to /usr/lib/cloud-init/ during c-i install, however it is not executable. I guess I could do a chmod +x BEFORE I add that new script to the git repo but I'd really expect the c-i install to be able to specifically make it executable. It added the script to setup.py's data_files section next to "tools/ds-identify"21:45
minimali.e. I don't expect the PR I'm planning to raise to add this would "flag" the execute permission for the file newly added to git main...21:48

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