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

meena*nod*00:05
m-rahalHello guys : ), I need help with a bit of a chicken and egg problem I got with net config with cloud-init:13:07
m-rahalI want to set up a fixed IP address for my VMs using cloud-init network config, I'm using a "NoCloud" net datasource, and my data is accessible at http://192.168.1.100:8080/config. The configuration files are located at:13:07
m-rahal- http://192.168.1.100:8080/<vm_name>/user-data13:07
m-rahal- http://192.168.1.100:8080/<vm_name>/network-config13:07
m-rahalThe issue is that cloud-init needs to use DHCP to initially get an IP address before it can read the 'network-config' file, but I want it to read the data with the ip address I gave to it in 'network-config' file. Is there a way to do this? how do cloud providers like AWS or DigitalOcean configure the IP addresses of their machines?13:07
m-rahalThanks in advance13:07
gdamjanaws uses dhcp13:21
gdamjanm-rahal: what kind of virtualization do you use?13:22
m-rahaloh yeah, I use libvirt13:22
gdamjanwith qemu you can pass data to a VM with the smbios option too13:24
gdamjanor with the user-data in an iso image13:26
m-rahalI'm using libvirt XML instead to pass the datasourc option into simbios, i passed the url of the network datasource ds=nocloud;s=http://192.168.1.100:8080/config13:26
m-rahalthis ISO image would work here, but I want to know if it's possible without it13:26
m-rahalEverything works (user password, ssh keys config ...) except for network config13:28
acibam-rahal: does the following fit your use case? one can pass a base64 encoded yaml network config in the kernel command line using the network-config key: https://cloudinit.readthedocs.io/en/latest/reference/network-config.html#default-behaviour14:26
=== arif-ali_ is now known as arif-ali
minimalm-rahal: from my own previous testing of nocloud-net cloud-init does NOT fetch network-config via http/https, only metadata. user-data, and vendor-data15:32
minimalyou can however embed (a limited form of) network config info in the metadata content15:32
SchrostfutzHi! I'm experiencing some curious behavior I don't quite understand. I have a `virt-install` script that creates VMs based on a debian 12 cloud-init image. Previously, VMs created like this worked just fine, and used a default ENI network configuration. I just created another such VM where network wasn't working. In fact, neither `ifupdown` was installed, nor did the host get an IP. After manually adding the package via 15:40
Schrostfutzcloud-init, it was present, and it got an IP, but not due to ifupdown running (config is now present but empty), but rather because apparently systemd-networkd was socket activated. I changed neither the cloud-init base image nor the configuration compared to previous installations. Why did the behavior change?15:40
holmanb_Schrostfutz: hello o/15:49
holmanb_Schrostfutz: have you tried comparing the log files of these two images?15:49
holmanb_Schrostfutz: as for the change, I haven't checked for myself, but I heard that debian 12 moved to netplan for cloud images15:53
holmanb_Schrostfutz: https://blog.slyon.de/2023/07/10/netplan-and-systemd-networkd-on-debian-bookworm/15:53
Schrostfutzholmanb_, Ah, that will probably be the reason. I'm still confused how this changed without me updating the base image. Does cloud-init do an automated update to itself in the setup process?15:55
meenaholmanb, Code_Bleu: haven't fixed the commit message yet, and the python side is still missing, but here's a better fix for the /run issue: https://github.com/canonical/cloud-init/pull/467715:55
-ubottu:#cloud-init- Pull 4677 in canonical/cloud-init "hack(sysvinit): On *BSD, create /run as symlink" [Open]15:55
meenaaaaaaaand unittests are failing15:56
meenabut first: laundry15:56
Schrostfutzholmanb_: I'm looking into the logs but can't really find anything. The output of the cloud-init.service is quite short and looks comparable. In particular the versions match (22.4.2)15:56
holmanb_Schrostfutz: you want to be looking at /var/log/cloud-init.log16:20
holmanb_Schrostfutz: cloud-init has 4 services16:20
holmanb_Schrostfutz: and much more information ends up in the log than in the journal from that service16:20
Schrostfutzholmanb_: Ah, I see! I'll have a look at that16:23
holmanb_Schrostfutz: Look for tracebacks and ERROR/WARN messages first16:26
holmanb_Anythin that looks abnormal16:26
Schrostfutzholmanb_: No traces or errors. Everything seems plausible and save for minor differences in order, temporary names or filesizes die to changed parameterization they are identical...16:27
SchrostfutzJust in case this is of interest to you, the old and new installation logs (http://sprunge.us/gnJjdX, http://sprunge.us/k5wWjF). I just pruned out the time prefixes to make them diffable. The old installation is from 20.09, the new one from 13.12.16:30
minimalcheck for references to the network renderer used in both situations ("eni", "netplan", etc)16:30
holmanb_meena: I like the general approach in the PR16:31
holmanb_meena: good call preserving env variable override backwards compability16:31
meenaholmanb_: now to spend four hours finding out why the tests are falling17:21
holmanb_meena: :/17:22
meenaone of these days, I'll get really good at it. probably when we rewrite cloud-init to Ruby17:23
holmanb_meena: lol17:42
holmanb_most of the ruby I've ever written was vagrant VM launchers17:43
holmanb_I wrote a vagrant launcher that could set up multiple VMs on a network with ethernet and IB virtual devices connecting the cluster for testing a custom routing protocol based on ospf (that we wrote)17:45
holmanb_that was my most complex ruby thing17:45
holmanb_but it wasn't open source :.(17:46
holmanb_and I basically just reinvented a much crappier version of GNS317:47
holmanb_Schrostfutz: making any progress? 17:51
Schrostfutzholmanb_: Not really... I can't spot it. But I'm also considering just accepting that since the new approach now works as well17:53
iracomo funciona o cloud-init18:17
meenaira: Fala inglês ou alemão?18:21
holmanb_Schrostfutz: I think I missed that, what's the new approach18:22
iraeu falo só português do brasil18:22
meenaholmanb_: do we have translated documentation?18:24
meenadoesn't look like it18:25
holmanb_no translations that I'm aware of18:27
holmanb_ira: este tutorial ensina como funciona o cloud-init18:29
meenaira: O cloud-init é pré-instalado em uma imagem de VM. Em seguida, ele é inicializado em uma nuvem e faz toda a personalização necessária para começar a trabalhar nessa nuvem específica. Depois carrega os dados do utilizador e faz mais personalizações.18:29
holmanb_ira: https://cloudinit.readthedocs.io/en/latest/tutorial/qemu.html18:29
holmanb_ira: está apenas em inglês, infelizmente18:30
iraobrigado18:31
meenaPreciso aprender mais idiomas.18:38
irae eu o de vocês hehehe18:46
meenanext up, French: https://languagehat.com/how-africans-are-changing-french/18:50
Code_Bleumeena: since you're the BSD expert...and I'm still waiting for a reply in #openbsd...I was wondering if you knew of a way to scan for hardware changes?  I added a HD to a VM ( virtio ) and was wondering if I could detect it without rebooting?  Sorry for the not cloud-init related question.19:21
meenaCode_Bleu: if it doesn't show up in dmesg, then yes, you need to reboot19:22
Code_Bleumeena: it doesn't, but was just wondering if there might be some other app or setting I just didn't have set to allow this to happen?19:23
meenadevice initialization in OpenBSD only happens at startup19:25
ed_hey hey - what's the *right* way for populating LANGUAGE in locales?19:28
meenaed_: hey19:37
meenaed_: which distro?19:42
Schrostfutz_holmanb: well not approach, rather the new behavior that I've noticed. That being netplan configuring the network20:05
ed_meena: ubuntu, late commands seems to get overwritten20:11
holmanb_ed_: late commands? what are those?20:45
ed_holmanb_: https://ubuntu.com/server/docs/install/autoinstall-reference20:49
holmanb_ed_: ah, that's autoinstall not cloud-init20:53
holmanb_ed_: for autoinstall questions on irc, #ubuntu-server is your best bet21:05
ed_holmanb_: thanks - i got documentation blinded... not the first time :)21:23
holmanb_meena: regarding your crimes -> not pretty, but I assume it works? alternatively if we use a different command that has stderr output and a non-zero exit code that's more compatible across unix and linux that would work too21:31
holmanb_ed_: no problem, best of luck21:31
meenaholmanb_: yeah, i think that's probably a better idea21:32
meenaholmanb_: `cat /non-existent` looked promising, but looks different with busybox21:33
holmanb_meena: something like this maybe?21:33
holmanb_sh -c 'echo test 1>&2; exit 42'21:34
holmanb_meena: yeah, figure that posix shell should do the right thing everywhere21:34
meenathat shit better work, or something's really broken.21:34
* meena boots up openbsd21:34
meenaholmanb_: yeah. looks good.21:35
holmanb_meena: nice :)21:36
meenawant me to submit that, cuz I reckon you're a bit busy with 103230494 (rough estimate) other things 21:36
holmanb_meena: if you don't mind21:38
holmanb_thanks21:38
holmanb_heh21:38
meenaneed to rerun tests cuz I forgot which one was failing lol21:40
meenaholmanb_: https://github.com/canonical/cloud-init/pull/469221:56
-ubottu:#cloud-init- Pull 4692 in canonical/cloud-init "fix(tests): make cmd/devel/tests work on non-GNU" [Open]21:56
holmanbmeena, nice thanks22:16
meenanow to get back to figuring out why my other tests are failing22:16
meenamy ds-identify tests22:16
holmanbmerged 469222:19
meenapython needs Ruby's pry and pry-debug22:36
meenaaaah, grrrrrrrr  found the issue23:38
meenacfg_out = os.path.join(rootd, "run/cloud-init/cloud.cfg")23:39
meenathat file doesn't exist.23:39
meenait should be using… something else.23:39
meenaget_runpath?23:39
meenaanyway, too tired to fix this now. But I'm glad I've identified it.23:40
meenai think ds-identify is now in its final state, and it's just the tests that need fixing.23:42

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