/srv/irclogs.ubuntu.com/2023/10/02/#cloud-init.txt

=== esv__ is now known as esv
dchcloudinit identifies datasource as OpenStack on 23.3 instead of Ec217:34
dchthis is FreeBSD so there may be other differences17:34
dchhttps://www.irccloud.com/pastebin/MWxQ1bGc/cloud.cfg17:35
dchhttps://www.irccloud.com/pastebin/8OBlUpcr/ds-identify17:36
dchat least from command line can I force the datasource? 17:36
dchthis is what I'd expected `datasource_list: ['Ec2']` to do, which is what was previously relied upon17:37
dchcc meena 17:39
meenadch: yes, but I think also need, 'None' to terminate the list for good17:47
dchmeena: just tried that, same result17:48
meenadch: you can also disable the ds-identify service to disable the feature17:48
dchI just say this "no datasource_list found, using default: MAAS ConfigDrive... etc17:48
meenaand by disable, i mean, delete17:49
meenalemme get my laptop, might make writing easier17:49
dchmeena: only if you have the time, its not urgent17:50
dch22.4-28-gaecdcbf8 was the previous version17:51
meenaactually, it's bedtime, and i have to put kiddo ti bed now, dch, so anywhere between half an hour, and two hours when I'm actually getting back to my laptop17:53
dchmeena: similar story here, how about I keep debugging and you can drop in later to throw some peanuts at me?17:55
dchor popcorn, I'm easy17:55
meenawe got monkey nuts for the crows 17:56
=== dbungert1 is now known as dbungert
minimaldch: this is a physical machine (Supermicro) ?18:20
minimaldch: a physical machine won't "look" like AWS (i.e. the DMI values) and so it makes sense that Ec2 is not chosen. There was a change made to the OpenStack DS a while to support physical machines (as well as VMs/Cloud) and I expect that is why ds-identify decides "maybe"18:27
minimallook at the likes of the ec2_identify_platform in ds-identify to see its' logic18:29
dchminimal: yep, all real tin18:50
dchthis btw works under 22.x so I'm trying to find how to address this18:50
dchexploring /etc/cloud/ds-identify.cfg to disable it18:51
dchmeena: where do you want me to log some bugs for this? /etc/cloud/ds-identify.cfg should look in %PREFIX%/etc/cloud/ds-identify.cfg IM(H)O but it doesn't 19:02
dchand even if that is set, I see `DSNAME=Ec2 DSLIST=Ec2 in ds-identify log, but this doesn't appear to change the DS as seen by cloudinit itself19:04
dchso I shall dig into that next19:04
dchhttps://www.irccloud.com/pastebin/elrefaG2/ds-identify19:05
meenadch: to disable it, you literally just `rm %PREFIX%/etc/rc.d/ds-identify`19:15
dchmeena: thanks, let me try that.19:15
dchbut every time I get pkg update, this will re-appear I guess19:16
dch. is there any way to disable it by config, rather than chainsaw?19:16
meenai should probably introduce a variable to disable only that thing, eh?19:16
meenadch: do you wanna open up a bug?19:17
dchmeena: sure, on cloudinit repo?19:17
dchmmm19:17
dchI think the nicest way / easiest way is to add a cloudinit_dsidentify_enable=NO var 19:18
meenayeah, i don't have access to mail rn, so bugzilla is kinda meh19:18
dchIn the bigger picture I would like to understand why there appears to be no obvious way to hard-wire this, using the parameters that worked happily under 22.x.19:19
meenadch: lots of code changes since then19:19
dchindeed I skimmed the changelog19:20
dch1 datasources returned maybe: OpenStack19:21
meenayeah, i wonder if you can say no maybes19:22
dchso.19:23
dchthat alone isn't sufficient, it insists on picking openstack19:23
dchI think I need to remove /run/cloud-init/* as well as /var/lib/cloud/* /var/log/cloud* to clean up19:52
dchok that looks better19:59
dch|`->no network data found from DataSourceEc2 @01.04000s +125.16800s`20:28
dchif I read this right, despite locking Datasource=Ec2 this still takes over 2 minutes to fetch the metadata?20:28
dchthat seems longer than expected20:28
dchI wonder if this is 2x 60s metadata server timeouts20:36
meenasome services have 5 minutes timeouts20:38
dchI think the instance just takes ~ 2 minutes before its allowed to connect to the network20:44
dchmeena: did the rc.d/dsidentify only get added in 23.3 ? I think this the case21:25
meenadch: yes21:25
minimaldch: so you have something on your local network emulating a Ec2 metadata server?21:26
dchminimal: yes, although its not actually mine, so I don't get to change it21:26
minimalso is it providing network config info?21:27
dchminimal: not network info, because thats pre-injected (as its complicated), but the rest - ssh keys, userdata scripts, the usual21:27
minimaldch: pre-injected? but you're trying to use the Ec2 DataSource in which case the Ec2 metadata server is expected to provide network config21:28
dch`network: {config: disabled}` in cloud.cfg prevents that21:28
dchi.e. the images are deployed with the requisite network config injected during ipxe stage21:28
dchbefore OS is started21:29
minimaldch: so you don't really want a "proper" Ec2 DS then?21:29
dchthe rest is (largely) user configurable21:29
dchminimal: TBH all I really want is for cloud-config to have a schema for its config files, that is largely consistent and stable across versions21:30
minimalwith a "real" Ec2 datasource cloud-init brings up a temporary network config in order to contact the metadata server to then obtain the "real" network config so that it can configure the OS accordingly21:30
dchminimal: right, in this case we skip the first bit21:30
minimalbut if you skip that then you don't really want "real" Ec2 then...21:30
dchits a bit hard for me to introspect it from the outside, but I think ~ 2 minutes is waiting for something (networking, routing idk) to "come up" and let traffic flow21:31
dchminimal: true, we also have `strict_id: false` for the ec2 config21:31
dchagain, that bit is not my network so it is what it is21:31
minimalso if you don't want "real" EC2 then why don't use use another DS, like NoCloud-Net?21:31
dchminimal: did it exist 4-5 years ago? that would be the main reason its done this particular way21:33
dchI skimmed https://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.html and its not clear to me whether the network-fetched metadata like ssh-keys and stuff would still work the same way (from same url etc)21:34
minimalI didn't think cloud-init supported FreeBSD 405 years ago...21:34
minimals/405/4-5/21:34
dchminimal: you'd be surprised what FreeBSD people hack on when we think nobody's looking21:35
dchit was first added in 2014 to FreeBSD ports, and works tolerably well apart from the slow drifts of time and config changes21:36
minimaldch: "is for cloud-config to have a schema for its config files, that is largely consistent and stable across versions" - cloud-init *does* have a schema for cloud-config, indeed the provided user-data is validated during boot. However regarding stable across versions, when things are changed the old version is marked depricated in the schema and still supported for a period of time21:36
dchI wonder if there's a way for me to validate our configs externally perhaps?21:37
dchlike, in CI when I build the images?21:37
minimalactually you referred to cloud-init as "files" - cloud-init is one particular type of user-data21:37
dchtrue21:37
minimalnetwork config and meta data are NOT cloud-config21:38
minimalthe cloud-init cli can validate cloud-config files21:38
dchso the "data" that are fetched from www servers which may or may not be, or end up, as files, ...21:39
dchdo these follow a schema from cloud-config? or is this actually the DataSource provider, that owns this?21:39
minimalno, the specific cloud-config user data i.e. a YAML file with first line "#cloud-config", not metadata or network config files/documents21:40
minimalrecent releases of cloud-init have added a schema for network v2 config but I think that is a work-in-progress21:40
minimalaciba90 also recently wrote a server for validating cloud-config docs: https://github.com/aciba90/cloud-config-validator21:42
minimaldch: cloud-config schema is independent of DataSource21:43
minimaldch: "network-fetched metadata like ssh-keys and stuff would still work the same way (from same url etc)" - ssh-keys etc are NOT metadata and NoCloud-Net fetches from multiple URLs relative to the same base-url (i.e. meta-data, network-config, vendor-config, and user-data appended to the base url)21:45
minimaloops, forget "network-config", it's not relevant for NoCloud-Net21:48
dchok I think I got to the bottom of all of this22:11
dch- on FreeBSD, stuff live in /usr/local/etc/cloud/... not /etc/cloud22:12
dch- ds-identify script doesn't accommodate that yet, so:22:12
dchthus:22:12
dch- it looks for the default cloud.cfg in /etc/cloud/cloud.cfg22:12
dch- fails to find the `datasource_list: ...` parameters22:12
dch- falls back on OpenStack22:13
dchif the default cloudinit path is fixed, this seems to work again22:13
dchmeena: catch you tomorrow I'll add an issue for this too with22:19
DarkenedGentlemaI'm having an issue I just can't seam to figure out.  I've got cloud-init installed on a disk image that is booted by Xen (virtualization).  The OS is almalinux8 and it boots as it should however it for some reason cloud-init doesn't run on boot.23:52
DarkenedGentlemaI've used systemctl to enable cloud-init, cloud-init-local, cloud-config, and cloud-final.23:52
DarkenedGentlemaStill wont run.  cloudinit clean doesn't seam to change anything either.23:54
DarkenedGentlemacloud-init init will actually run as it should.23:55
minimalnothing in /var/log/cloud-init.log?23:58

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