=== cpaelzer__ is now known as cpaelzer [13:54] could someone review PR 626 please? [14:55] minimal: well,uhm. yeah, not much i can do today [14:58] minimal: well i helpfully made a bikeshed whitespace comment :-( [14:58] the thing generally looks fine to me... in that your tests are present, but i didnt do a thoughtful review [15:01] * meena is all over the place… since… at least a few… months? [15:05] Hi all, I am struggling with running cloud-init for custom-built AMI (Ubuntu 18.04 based) in AWS ec2 user data section. Essentially, it appears that cloud_final_modules (scripts_user and write_files) is not triggering. [15:05] Content-Type: multipart/mixed; boundary="//"MIME-Version: 1.0--//Content-Type: text/cloud-config; charset="us-ascii"MIME-Version: 1.0Content-Transfer-Encoding: 7bitContent-Disposition: attachment; filename="cloud-config.txt"#cloud-configcloud_final_modules:- [scripts_user, always]- [write_files, always]apt_update: trueapt_upgrade: truepackages: - [15:05] openssh-serverwrite_files: [15:06] this is my script. Can anyone help me here? [15:07] I also tried with bash script with no luck. It seems to me that user data never executes on the machine. [15:08] https://github.com/canonical/cloud-utils/pull/19 changelog update for cloud-utils 0.32 (from `git log | log2dch, as I think the previous entries were generated) [15:08] Odd_Bloke, smoser ^^ [15:10] I suspect that it does not do it because it is custom AMI and because original /etc/cloud/cloud.cfg does not have these modules that I try to run with user data. Unfortunately, there is no option to rebake the image [15:11] paride: As you're here, any chance of a cloud-utils release soon? The last one was a long time ago and since then growpart has added LVM support which is something useful for cloud-init. [15:11] minimal, that's exactly what that PR is for :) [15:12] paride: a cool, I'd mentioned it to Odd_Bloke last week so he'd said he'd ask about. Thanks! [15:13] minimal, yep we decided to cut a new release after your ping about it [15:14] cool. I'm the cloud-utils (and cloud-init) maintainer for Alpine Linux so I'll be ready to package it up as soon as its out ;-) [15:20] I signed the CLA on LP when I added the Hetzner Cloud DS. Is this sufficient for https://github.com/canonical/cloud-init/pull/629 ? [15:21] Proof via https://code.launchpad.net/~lp-markusschade/cloud-init/+git/cloud-init/+ref/migrate-lp-to-github [15:22] I have seen that smoser has moved dmi functions out of util [15:22] So I guess depending on when it is merge I would have to rebase https://github.com/canonical/cloud-init/pull/630 [15:25] every damn time i update a bug on Launchpad and get an email about it, i'm like: OH! SOMEONE UPDATED MY BUG?! [16:47] meena, I think you can disable that. https://launchpad.net/~minagalic/+edit should have a "Send me bug notifications for changes I make" setting [18:21] Hello to all! I guess it is a recurrent question. I couldn't find an answer on the FAQ. What would be the best reference documentation on how to use "locally" user-data? [18:22] I want to autoconfigure with cloud-init a KVM VM ran locally with the CDROM ISO mechanism and the documentation is not clear... [18:22] On if it is the same as running the user-data file from the ISO or directly on a cloud instance. [18:23] Of course this is a rookie question, hopefully it doesn't have a not too obvious answer... [18:26] Thanks for any answer! :-) [18:29] Hawk_X: user-data should behave the same whether it comes from cdrom NoCloud datasource, or if the user-data comes from EC2's meta-data service; I *think* that was what you were asking; [18:35] rharper: I've updated https://github.com/canonical/cloud-init/pull/609/ with a fresh approach (and some tests), FYI. [18:35] ok [18:36] blackboxsw: falcojr: ^ is the update I mentioned was coming in stand-up. [18:39] You are right rharper Thanks! [18:40] Now the next obvious question is, what is the best repository of examples for documentation on cloud init for ubuntu 20 instance? [18:40] I know, it is obvious for many people but I really can't find how to set an static IP on user-data, from what I read it is part of meta-data but I can't get it to work with the ISO file. [18:41] And also, from the website: https://cloudinit.readthedocs.io/en/latest/topics/examples.html it appears that the option to use pwauth over SSH is now gone. [18:42] I have a user-data file that I ran on Ubuntu 16.04 that did work with ssh pw auth that is not working now on Ubuntu 20.04 Instance... [18:43] Hawk_X: you cannot supply network-config via user-data as network config must be applied before cloud-init fetches user-data; some datasources, like NoCloud or ConfigDrive can accept network-config separately from user-data; on clouds, network-config typically comes from the instance metadata service [18:45] yes, so I can't supply network-config from the meta-data file over an ISO file. [18:45] Hawk_X: re: ssh pwauth, not clear what you mean; do you have a user-data file with the example config that's not working? I routinely launch with: #cloud-config\npassword: \nchpasswd: { expire: False}\nssh_pwauth: True; and I can ssh in and enter a password (though typically I import an ssh public key [18:45] Hawk_X: in network-config, not meta-data [18:45] And I can't supply network-config over the ISO or can I? [18:45] you can, depends on your Datasource [18:46] I couldn't find any doc that tells me that is supported. [18:46] the NoCloud datasource, reads meta-data, user-data, network-config files; the ConfigDrive datasource has a different directory structure, it reads a network-config file (which is in ifupdown format) and a network-data.json format (which is what openstack metadata service provides) [18:46] I hope and not saying something stupid but it is a nocluod environment running on KVM in ubuntu 20.04 [18:47] https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html [18:47] Network configuration can also be provided to cloud-init in either Networking Config Version 1 or Networking Config Version 2 by providing that yaml formatted data in a file named network-config. If found, this file will override a network-interfaces file. [18:48] that could use some re-wording to make it more obvious [18:48] Nice. rharper that last part is what I needed to read [18:48] Yes, it isn't quite clear. Let me give it a go as I have the environment ready. [18:49] REgarding the ssh_pwauth I will try the file you've wrote as I want to create a customer user. [18:49] And user pwauth for it and for the love of me it doesn't works... [18:49] This is what I am using: [18:50] https://paste.ubuntu.com/ [18:50] Hawk_X: ^ if you want to share user-data; [18:51] Thanks rharper [18:51] https://paste.ubuntu.com/p/BXSn5WxJnD/ [18:53] I install the vm with virt-install and connect using SSH and the password is not accepted. The ssh key does. [18:54] I looked at the /var/log/cloud-init.log file and I searched for "ssh_pwauth" and nothing match [19:01] I don't see anything wrong with that; does the log show any other errors? [19:01] Hawk_X: look for: 2020-10-27 19:01:09,324 - ssh_util.py[DEBUG]: line 58: option PasswordAuthentication updated no -> yes [19:01] [19:02] now for your user login, look for cloudinit.config.cc_users_groups in the log, should see what it's doing , like Running hidden command to protect sensitive input/output logstring: ['useradd', 'rharper', '--shell', '/bin/bash', '-m'] [19:02] That I can look for. I am spinning up the instance [19:08] Much appreciated! [19:22] rharper, it says "yes" [19:26] cool, so ssh pwauth worked (it changes sshd config to allow password login over ssh) [19:27] so your remaining issue is your new user and the password; I suggest importing an ssh key for the default user; and then login as the default user to help debug the secondary user [19:37] paride: but then nobody will mail me :P [19:57] Yes, but for some reason the network-config file config is not being accepted by cloudinit [19:57] So the interface is brought up but not configured. [19:57] I am looking at the logs now. [20:10] Still looking... [20:18] Hawk_X: you can paste me your network-config file from the nocloud iso; the cloud-init log file is usually pretty verbose about network config it applies and writes; [20:46] smoser: i made the executive decision to resolve this comment: https://github.com/canonical/cloud-init/pull/625#discussion_r512296035 [21:00] what does resolve mean in that scenario? [21:01] smoser: i clicked the resolve conversation button, after explaining that Puppet Facter also calls jails `jail` and not `bsd-jail` [21:02] oh. i see. [21:02] i could look at chef and salt and ansible for other clues [21:02] never mind. [21:02] thats fine. [21:05] AnhVoMSFT: Would you be able to take a look at https://bugs.launchpad.net/cloud-init/+bug/1901011? It relates to new Azure instance types that seem to be causing some issues with the Azure DS. [21:05] Ubuntu bug 1901011 in cloud-init "Azure temporary disk not present for instance type" [Undecided,New] [21:46] Thanks to rharper for the assist. [21:46] Unfortunately, the network-config is not being accepted by ubuntu. Here's the pastebin: https://paste.ubuntu.com/p/b6F2j8xhpH/ [21:46] I tried with the match and no match option for the MAC. Which it doesn't make sense to me as I do not know the MAC address to match it... [21:47] Either way, it doesn't recognize the network config and the instance boots without IP :-( [21:48] The cloud-init.log complains about some parameters but as I can't put an IP on the instance I can't paste the exact error here. [21:49] eh? [21:50] you have no (virtual) serial console access to the machine? [21:51] Hawk_X: worst case, you could post a screenshot [22:03] Hawk_X: your nameservers is incorrect format, it's namesevers: addresses: [1.1.1.1] [22:18] Thanks! [22:18] I have virtual console access [22:36] Apologies, I thought I would be receiving an answer soon. Much appreciated. [22:36] Spinning a new instance now. BRB [23:17] Ladies and Gentlemen unfortunately, the day caught up with me. I didn't have the time to spin the other instance. I will try to do it later tonight or tomorrow morning [23:17] Thanks again for all your assistance! [23:22] Odd_Bloke: I'm taking a look at https://bugs.launchpad.net/cloud-init/+bug/1901011 now [23:22] Ubuntu bug 1901011 in cloud-init "Azure temporary disk not present for instance type" [Undecided,New] [23:24] Yes indeed, there are new instance types that don't have ephemeral resource disks. We're discussing internally about this issue.