[06:03] Hi All we are trying to customize VM on azure platform,each time install custom packages and run scripts on that VM we get different behaviour. [06:05] It seems cloud-init is messing with some of the processes of VM on First-boot. Is there a way that we can check if that VM is properly booted and then we can trigger cloud-init ? [06:11] Anyone there ? [06:28] ? [07:05] is there some better way to debug why my cloud-init setup in vSphere isn't working reliably? About 1 out of 3 times it looks like none of my user-data gets executed at all. not even something as simple as the hostname [07:06] But neither cloud-init.log nor cloud-init-output.log exhibit any obvious errors or failures [07:06] I have the failed vm up and running now, so if anyone wants me to run some commands against it to figure out why it's in sthis state LMK [07:07] I've confirmed for example that the userdadta is there (after the fact) with vmware-rpctool "info-get guestinfo.userdata" | base64 -d [07:08] I basically have a shell script at the moment that destroys, and re-creates the VM from a template with cloud-init userdata and it fails about 1/3 in this weird state [07:46] mk88: how, exactly, is cloud-init messing with your setup? [07:47] prologic: how does it fail? do you have debugging enabled so the logs are full of… well, debugging info [07:48] it doesn't run any of the user-data at all [07:48] is there a bit of config I can add to /etc/cloud/cloud.cfg to increase verbose/debug logging? [07:52] I'm a bit more interested in debugging this failed VM that didn't run any of the cloud-init userdata though [07:52] So any helpful suggestions there would be nice, happy to poke around with some guidenace, I'm alll out of ideas myself :/ [07:52] Like what possible reasons would none of the userdata ever run (at all) without ovbious errors 1 out of 3 times? [07:53] but work perfectly the other 2 times [08:04] e.g: cloud-init status reports "done" and not "error" in this case [08:16] @meena So we have some processes that run on firstboot like db creation and other things hat we need to do. Also we have a requirement to call ansible after the firstboot completes. So we are using the cloud-init to do the ansible invocation.But what is happening on each VM creation we get different behavior though there are no script level [08:16] changes. [08:24] prologic: usually, the reason is that the meta data service cannot be reached, often caused by some kind of race between the VM and the service [08:24] @meena so there any way that we can keep it disabled till first boot completes and then enable it later when firstboot completes to make ansible invocation ? [08:26] mk88: there probably is, but then you'd run in different trouble [08:28] prologic: we usually have an example config file for logging or debugging, it's in /etc/cloud.cfg.d (i think) [08:29] in /etc/cloud/cloud.cfg.d/ [08:29] meena this is my thoughts too, a 'race" of some kind [08:29] let me see what's in there right now... [08:29] This is based off an Ubuntu 20.04 image [08:29] depending on the distro that config is disabled (in FreeBSD for instance) [08:30] I see [08:30] i haven't used Linux since the start of the pandemic lol [08:30] I assume you mean 05_logging.cfg ? [08:30] hahah! [08:30] yes [08:31] it would appear DEBUG level logging is already enabled here [08:31] if I'm reading thie weird looking .ini config right :) [08:31] but is the file enabled in cloud.cfg? [08:32] ahh [08:32] there's an include directive in there [08:32] or there should be [08:33] hmm [08:33] there is not that I can see [08:33] yeah, there's not, it happens automatically [08:34] ahh okay [08:34] so, if debug logging is enabled, how come you don't see any logs [08:34] so I should have debug logging [08:34] you should [08:34] so what could I look for to determine if we're seeing a race betwene the metadata service and the vm? [08:35] maybe syslog has info? [08:35] as to why we're not even logging [08:35] I no I see logs, but I don't see anything to explain what I'm seeing [08:36] I basically need some help (I think) in understanding what to look for [08:36] the logs I do see don't explain this weird behaviour [08:36] then you have to paste your logs somewhere, and wait until someone more experienced wakes up here to look at them [08:36] I'm also just in my phone,while chasing a toddler [08:37] so that's quite an impediment [09:07] will the tarball of cloud-init collect-logs be enough? [09:13] most likely, given that that is all relevant logs and some other stuff [09:27] kk [09:27] I wish I could figure this out myself :D [09:28] just nothing in there I can identify as :oh!" === apollo13_ is now known as apollo13 === waxfire2 is now known as waxfire === falcojr6 is now known as falcojr === shalok_ is now known as shalok [14:24] prologic: did you file a bug ? [15:19] btw, who creates the /etc/cloud/cloud.cfg.d/90_dpkg.cfg file in Ubuntu? cloud-init itself or some package script? [15:19] not included in the package atleast, but can't seem to find anything related to it [15:19] besides some test [15:24] ajmyyra: It's generated from a debconf prompt, so it's populated on package installation. [15:24] (Which happens at image build time in ~all official Ubuntu images. :) === powersj_ is now known as powersj [18:59] anyone able to land https://github.com/canonical/cloud-init/pull/837 [18:59] i'mhappy with it, but i'm not up to speed on how to adjust user comment or cpy and paste the commit message.... [20:27] hi, I am trying to install ubuntu with cloud-init for the first time on a qemu image. The installation fails when running systemd-cat with exit status 3. There is a log in /var/crash but how I do not know how to retrieve it. Is it possible? [20:32] dam_: What installation media are you using? [20:34] I use an iso. [20:35] I use the following command line to start installation: [20:35] kvm -no-reboot -m 1024 -smbios type=0,uefi=on -drive file=image.img,format=raw,cache=none,if=virtio -drive file=seed.img,format=raw,cache=none,if=virtio -cdrom ~/ubuntu-cloud-init/ubuntu-20.04.2-live-server-amd64.iso [20:35] [20:41] I also use curtin to define partitions. [20:53] smoser no not yet, I'm not even sure where/who the bug is with. [20:53] So far it just smells like "racy" behaviour [20:53] destroy/recreate a vm 10 times, and 3 of those times none of the cloud-init userdata gets run at all [21:26] dam_: Aha, OK, I think you're hitting an error during a subiquity install? Or are you specifically passing in cloud-init configuration that isn't working for you? [21:33] I got an error during subiquity install but I do not know why. If I use default config, the install succeed but not when I specify storage. [21:41] Does ubuntu-20.04.2-live-server-amd64.iso supports uefi boot? [21:44] dam_: This isn't the best channel to get subiquity support, I'm afraid: cloud-init is only one component of the whole installer; you'll likely have more success in the #ubuntu-server channel. [21:49] OK. I am not familiar with cloud-init, subiquity and the like. [21:51] The documentation of cloud-init mentions that it supports "Bare metal installs". Does it depends on subiquity? [21:56] dam_: cloud-init supports running as part of bare metal installs, but it runs inside the booted system: you still need something else to arrange the image for you and pass the configuration into the system. subiquity does that for Ubuntu installs (so it's more accurate to say that subiquity depends on cloud-init.) [21:58] In the meantime I fixed my issue. I had to create partition for grub so it seems that I was not able to do a uefi install. [21:58] anyway thank you for your support [22:40] Hello, struggling with a few points in case any one can help pls? [22:40] 1. write_files is not suitable for creating files in user directories as makes the users home dir owned by root  and runs before create users (on AWS at least) so owner can't be set to the user. Is that right? [22:40] 2. I'm try to use curl in runcmd, I've set proxy variables but can't make a connection. It works just fine as a regular user. Any ideas? [22:40] 3. Is there away to make sure a script runs after runcmd is finished? [22:40] Thanks! [22:49] dave_the_rave: 1. is correct, you're running into https://bugs.launchpad.net/cloud-init/+bug/1486113. See #2 for background on why things are the way they are, and #13 for our recommended workarounds in the meantime. [22:49] Ubuntu bug 1486113 in cloud-init "write_files runs before users/groups, renders "owner" useless" [Medium,Triaged] [22:51] dave_the_rave: For 2., I'm not sure: how are you setting the proxy variables? [22:56] Odd_Bloke Thanks, that's helpful. /etc/skel is the answer for me. on 2. I was setting them via source /etc/environment and then later in desperation exporting them in the runcmd script but to no avail. I was wondering if there is something that would stop curl working.. I couldn't connect on 443 to github.com. === ivo_cavalcante_ is now known as ivo_cavalcante [23:06] dave_the_rave: It might be worth replacing your curl command with `env`; that output should go to /var/log/cloud-init-output.log, then you can double-check that your environment variables are getting through. [23:07] dave_the_rave: And for 3., what do you mean by "a script"? Could you just add it as the final runcmd entry? [23:12] Can I link someone (privately) a cloud-init.tar.gz (from cloud-init collect-logs) to help me figure out why I'm having so much trouble getting my userdata to run reliably? If I destroy/re-create my VM, about 1/3 times it fails with no evidence that it ran any of my userdata, the other 2 times it works perfectly. Environment is Packer built image spun up with Terraform on a vSphere hypervisor.