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

jnamdarHey everyone, is there anything planned to support adding DNF repositories from cloud-init config ? I saw in the doc there was a module to add YUM ones, but since RHEL 8 I think the default package manager is dnf.00:28
holmanbjnamdar: Just use the yum config module. It should work for dnf too.05:32
holmanbjnamdar: dnf still just uses repo files in /etc/yum.repos.d/, so unless they changed the format or something that module should continue to work05:33
holmanbI guess they left, but if anyone feels like verifying dnf support and updating docs to mention support, that would be a easy task for someone's first cloud-init contribution.05:42
* holmanb looks forward to a future with github issues to categorize issues like this for new contributors05:43
=== esv_ is now known as esv
emma14hi, I'm trying to use cloud-init to configure my kvm-based VM. I'm mounting an ISO with a `user-data.txt` file in it, and it doesn't appear to be getting picked up when the VM boots after running `virt-sysprep` against the VM's disk - any suggestions?15:37
minimalemma: did you also create a meta-data file in the ISO? it is required15:57
minimalemma14: https://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.html#file-formats15:58
minimal"Both files must be present for it to be considered a valid seed ISO."15:58
emma14Ah, right on, will give that a try15:58
emma14Doesn't seem to actually run anything I've specified. I'm generating a file `seed.iso` containing 3 files: `meta-data`, `user-data`, `network-config` which is a valid netplan schema. Mounting it through virt-manager as `SATA CDROM 1` with raw storage format. In-between each attempt I'm running `cloud-init clean --logs` to reset the16:24
emma14`/var/lib/cloud/`-directory16:24
emma14If I mount the ISO and run `$ cloud-init schema --config-file /mnt/cidata/user-data` it says it's valid as well16:25
minimalnothing related appeared in /var/log/cloud-init.log?16:26
emma14Hmm, I don't see anything particularly relevant. E.g. I don't see any mention of my user-data script or16:32
emma14This is just ubuntu20.04 server16:32
emma14Checking this ~ https://cloudinit.readthedocs.io/en/latest/reference/faq.html#where-are-the-logs ~ looks like /run/cloud-init/status.json indicates that the datasource is DataSourceNone16:38
emma14Do I need to manually specify the datasource somewhere?16:38
minimalthere is a default list, that basically includes all the DataSources, with 'None' as the last one16:39
emma14I see16:39
minimalunless a specific DS or list of DS has been set somehow in /etc/cloud/cloud.cfg or in /etc/cloud/cloud.cfg.d/16:39
minimallook for a "datasource_list" entry16:40
minimalis the ISO labelled correctly?16:41
zaphod_bhiya lads; I'm trying to enable cloud-init on a regular ubuntu18 live-server image; my first attempts are failing, and I take it the presence of `/etc/cloud/cloud-init.disabled` is the culprit here16:42
zaphod_bso my question is, is there a way to override this with an option on the kernel command line for example ?16:42
minimalzaphod_b: why not use a Ubuntu cloud image?16:43
zaphod_bwell this is for booting off metal; I had considered that at first, but could not find a way to get the hardware boot off any of the cloud images that I'd found16:44
zaphod_bbut would love to learn otherwise :)16:44
minimalI *think* Live Server is using Subiquity16:44
minimalwhich then uses cloud-init16:45
zaphod_bwell as far as I've understood, subiquity is a recent thing and probably was not yet around in 201816:45
zaphod_bnot quite sure about that16:45
zaphod_bhow would subiquity be helpful ?16:45
minimalUbuntu Server 18.04 uses Subiquity16:46
emma14> is the ISO labelled correctly? ~ from isoinfo - Volume id: cidata16:46
minimalwell what I mean is that using Subquity (which uses cloud-init) is not exactly the same as using cloud-init "proper", 16:47
zaphod_byes indeed; the scripts have written so far work fine with u20.04 and u22.0416:47
minimalemma14: the DS selection doesn't show much, if anything, in cloud-init.log unless you enable debug, then it shows exactly what is going on16:48
emma14Ah that's super helpful16:48
emma14I'll try that16:48
minimalemma14: then it will log the list of DSes it will check, you should see it looking for a fs labelled cidata, etc16:48
minimalzaphod_b: my point was that Live Server appears to use Subiquity for installing. So are you trying to install Ubuntu?16:51
emma14Following this ~ https://gist.github.com/RagedUnicorn/a70f8540c68e0a41e3e097a2e29130f1#logs16:51
zaphod_bnot installing, running live16:52
zaphod_band using cloud-init for setting ssh keys16:52
minimalzaphod_b: I don't think Live Server is designed for that16:53
zaphod_bwell, clearly not, but with a little help the 20 and 22 versions have been willing to comply ;-)16:55
zaphod_bplus, that's called liver server, right ?16:55
zaphod_bplus, that's called live server, right ?16:55
minimalbut does the cloud-init services run in sequence when you boot Live Server?17:05
minimalI'd expect not and that subiquity would run instead17:05
zaphod_bwith u20 and u22, yes17:05
minimalhmm? you said you have a cloud-init.disabled file so then how can the c-i services run?17:06
minimalemma14: that guide does not mention increasing loglevel, only moving where the logfile is placed17:08
zaphod_bthat file is present on the u18 image only17:08
minimalzaphod_b: right, seems things were changed in Ubunto 20: https://discourse.ubuntu.com/t/cloud-init-and-the-live-server-installer/1459717:10
zaphod_bminimal: thanks, this is helpful17:17
blackboxswzaphod_b: minimal right. Just a  drive by comment from me. The live server installer is subiquity-based for the installation dialogs etc. I just launched the bionic live server iso the installer. Ubuntu 18 was a special case that does disable cloud-init intentionally within the ephemeral/installed environment. What I think this means is that you won't be able to provide any custom cmdline options to 'enable' cloud-init because most of 17:18
blackboxswwhat I'd tell you would be something akin to ...17:18
minimalblackboxsw: yeah I wasn't sure what would happen if "cloud-init=enabled" was passed on cmdline17:20
blackboxswmanipulating the kernel params to send something like autoinstall ds=nocloud-net;s=http://SOME_IP:8000/'   where you host a user-data/meta-data file to remove said /etc/cloud/cloud-init.disabled file. But, chicken and egg problem here. cloud-init is disabled in this stage on bionic 18.04 so it doesn't receive those directies to override and remove the disable flag file17:20
zaphod_byeah that's what I'm about to conclude too despite several attempts17:20
blackboxswI recall that the live installer puts in layers of files in the ephemeral environment, I'll see if there is a kernel param switch that can be provided to disalllow disabling cloud-init (I think it unlikely but i'll poke around)17:21
zaphod_bblackboxsw: thank you that would be very helpful indeed17:22
minimalblackboxsw: isn't that the cmdline value I posted?17:24
zaphod_bI'm already messing with the grub options; I guess my next option along that pass would be to override the squashfs to remove the disabling file, but that's another step further and I was really hoping I would be able to avoid that...17:24
minimalzaphod_b: trying to install bare metal from a cloud/vm image would depend on whether that image happened to include drivers and firmware for your bare metal host's network, storage, etc devices17:25
minimalI'm not familiar with the Ubunut cloud images so not sure, but assume the NoCloud VM tailored images must have at least some physical devices drivers17:26
zaphod_byes, and that's the reason why I'd discarded that idea at first as it does not souond quite right17:27
emma14Okay I think I may see why I wasn't getting the results I expected. When I ran `cloud-id` it said `none`, so I checked the contents of /etc/cloud/cloud.cfg.d/* and sure enough, it specified `none`. Led me to this answer - https://bugs.launchpad.net/subiquity/+bug/1958377/comments/11 - which led me to download a cloud image from -17:28
emma14https://cloud-images.ubuntu.com/ - and now I'm seeing debuggable output in `/var/log/cloud-init-*` and `cloud-id` is showing nocloud. Makes sense17:28
-ubottu:#cloud-init- Launchpad bug 1958377 in cloud-init (Ubuntu) "cloud-init does not apply network configuration from NoCloud resource" [High, Incomplete]17:28
blackboxswminimal nice on `cloud-init=enabled` Yeah. zaphod_b minimal looks like providing the extended kernel params after --- cloud-init=enabled will enable cloud-init in BIonic's ephemeral boot stage I can see it camping out trying to discover a datasource in the KVM console 17:40
blackboxsws/camping out/spinning/17:40
blackboxswthis is with stock 18.04.6 bionic live server ISO17:41
NightMonkeyHowdy. I'm having a heck of a time getting cloud-init clean to have its expected effect on Ubuntu 22.04. What is the proper way to prep a "golden image" template.17:48
NightMonkey?17:48
zaphod_bblackboxsw: indeed, this is awesome !17:48
zaphod_bthank you blackboxsw minimal for all the help !17:49
meenaNightMonkey: which of your expectations aren't met?17:49
NightMonkeymeena: I would like cloud-init to run on the next boot after the os image is cloned. 17:51
jnamdarHi all, is there any doc to add dnf repositories ? I found the doc for yum repos, but those are outdated on Fedora/RHEL 817:51
meenajnamdar: dnf uses rpm repositories, so the yum module should just work17:52
NightMonkeyWhat I'm seeing, however, is that cloud-init doesnt even run.17:52
meenaNightMonkey: anything in the logs as to why?17:52
blackboxswNightMonkey `cloud-init status --long` may tell you what gives (also could check /run/cloud-init/ds-identify.log)17:52
minimalNightMonkey: which version of Ubuntu is this with? cloud image? Ubuntu server?17:52
jnamdarmeena yeah but i'm afraid if the module writed in /etc/yum.repos.d/, the dnf command will probably not pick them up17:53
jnamdarwrites*17:53
blackboxswzaphod_b: just cofirmed I can run `python3 -m http.server 8000` with a directory containing `user-data` file with my #cloud-config and an empty meta-data  file and I can 'install ubuntu' on the live server 18.04 image passing the following kernel cmdline params:  `--- cloud-init=enabled ds=nocloud-net;s=http://_gateway:8000/' and it honors my #cloud-config17:54
meenatry it out and tell us about it, if it doesn't work, we'll fix it17:54
blackboxswzaphod_b: note as well that the #cloud-config user-data provided is manipulating the ephemeral boot stage, not the target system across reboot17:55
zaphod_bblackboxsw that's fine as I only intend to run in live mode, so not leaving the ephemeral boot stage17:57
blackboxswzaphod_b:  For what it's worth we're working on getting a architecture diagram and examples together as this is a big pain point and confusion for lots of people (ephemeral interaction vs target system interaction) given that cloud-init is active in both boots17:59
zaphod_bindeed the whole business can be a headache ;-)18:05
NightMonkeymeena: That's part of the problem. I see no logs from cloud-init.18:08
meenais it enabled? is logging enabled?18:09
NightMonkeyIn case it is a local misconfiguration, I'll ask this: does anyone here make golden images with Ubuntu 22.04 and see cloud-init run after running "cloud-init clean"? :)18:09
NightMonkeymeena: I see it as a unit in systemd, but it is "inactive/dead".18:10
NightMonkeyI also see a file in /etc/rsyslog.d/ that disables cloud-init logging, but I disabled that file. :/18:11
blackboxswNightMonkey: yes, but what platform are you trying to launch that golden image in after creating it?    cloud-init status --long should tell you why cloud-init is disabled.18:11
NightMonkey@blackboxsw: Ah, I'll try that on Monday. Thank you.18:12
blackboxswNightMonkey: +1 cloud-init status --long and read /run/cloud-init/ds-identify.log18:12
blackboxsw ds-identify.log is the first entry point for cloud-init and decides whether the platform looks compatible with cloud-init18:13
blackboxswds-identify will deactivate all systemd units if it doesn't look like a viable datasource for cloud-init exists18:13
blackboxswok ... I really need to file my taxes. catch you all later. thanks!18:13
NightMonkeyOh, awesome, thanks a bunch!18:15

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