/srv/irclogs.ubuntu.com/2020/10/27/#cloud-init.txt

=== cpaelzer__ is now known as cpaelzer
minimalcould someone review PR 626 please?13:54
meenaminimal: well,uhm. yeah, not much i can do today14:55
smoserminimal: well i helpfully made a bikeshed whitespace comment :-(14:58
smoserthe thing generally looks fine to me... in that your tests are present, but i didnt do a thoughtful review14:58
* meena is all over the place… since… at least a few… months?15:01
staplesHi 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
staplesContent-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
staplesopenssh-serverwrite_files:15:05
staplesthis is my script. Can anyone help me here?15:06
staplesI also tried with bash script with no luck. It seems to me that user data never executes on the machine.15:07
paridehttps://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
parideOdd_Bloke, smoser ^^15:08
staplesI 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 image15:10
minimalparide: 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
parideminimal, that's exactly what that PR is for :)15:11
minimalparide: a cool, I'd mentioned it to Odd_Bloke last week so he'd said he'd ask about. Thanks!15:12
parideminimal, yep we decided to cut a new release after your ping about it15:13
minimalcool. 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:14
AscIII 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:20
AscIIProof via https://code.launchpad.net/~lp-markusschade/cloud-init/+git/cloud-init/+ref/migrate-lp-to-github15:21
AscIII have seen that smoser has moved dmi functions out of util15:22
AscIISo I guess depending on when it is merge I would have to rebase https://github.com/canonical/cloud-init/pull/63015:22
meenaevery damn time i update a bug on Launchpad and get an email about it, i'm like: OH! SOMEONE UPDATED MY BUG?!15:25
paridemeena, I think you can disable that. https://launchpad.net/~minagalic/+edit should have a "Send me bug notifications for changes I make" setting16:47
Hawk_XHello 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:21
Hawk_XI want to autoconfigure with cloud-init a KVM VM ran locally with the CDROM ISO mechanism and the documentation is not clear...18:22
Hawk_XOn if it is the same as running the user-data file from the ISO or directly on a cloud instance.18:22
Hawk_XOf course this is a rookie question, hopefully it doesn't have a not too obvious answer...18:23
Hawk_XThanks for any answer! :-)18:26
rharperHawk_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:29
Odd_Blokerharper: I've updated https://github.com/canonical/cloud-init/pull/609/ with a fresh approach (and some tests), FYI.18:35
rharperok18:35
Odd_Blokeblackboxsw: falcojr: ^ is the update I mentioned was coming in stand-up.18:36
Hawk_XYou are right rharper Thanks!18:39
Hawk_XNow the next obvious question is, what is the best repository of examples for documentation on cloud init for ubuntu 20 instance?18:40
Hawk_XI 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:40
Hawk_XAnd 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:41
Hawk_XI 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:42
rharperHawk_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 service18:43
Hawk_Xyes, so I can't supply network-config from the meta-data file over an ISO file.18:45
rharperHawk_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: <some passwd>\nchpasswd: { expire: False}\nssh_pwauth: True;   and I can ssh in and enter a password (though typically I import an ssh public key18:45
rharperHawk_X: in network-config, not meta-data18:45
Hawk_XAnd I can't supply network-config over the ISO or can I?18:45
rharperyou can, depends on your Datasource18:45
Hawk_XI couldn't find any doc that tells me that is supported.18:46
rharperthe 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
Hawk_XI hope and not saying something stupid but it is a nocluod environment running on KVM in ubuntu 20.0418:46
rharperhttps://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html18:47
rharperNetwork 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:47
rharperthat could use some re-wording to make it more obvious18:48
Hawk_XNice. rharper that last part is what I needed to read18:48
Hawk_XYes, it isn't quite clear. Let me give it a go as I have the environment ready.18:48
Hawk_XREgarding the ssh_pwauth I will try the file you've wrote as I want to create a customer user.18:49
Hawk_XAnd user pwauth for it and for the love of me it doesn't works...18:49
Hawk_XThis is what I am using:18:49
rharperhttps://paste.ubuntu.com/18:50
rharperHawk_X: ^ if you want to share user-data;18:50
Hawk_XThanks rharper18:51
Hawk_Xhttps://paste.ubuntu.com/p/BXSn5WxJnD/18:51
Hawk_XI install the vm with virt-install and connect using SSH and the password is not accepted. The ssh key does.18:53
Hawk_XI looked at the /var/log/cloud-init.log file and I searched for "ssh_pwauth" and nothing match18:54
rharperI don't see anything wrong with that;  does the log show any other errors?19:01
rharperHawk_X: look for: 2020-10-27 19:01:09,324 - ssh_util.py[DEBUG]: line 58: option PasswordAuthentication updated no -> yes19:01
rharper 19:01
rharpernow 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
Hawk_XThat I can look for. I am spinning up the instance19:02
Hawk_XMuch appreciated!19:08
Hawk_Xrharper, it says "yes"19:22
rharpercool, so ssh pwauth worked (it changes sshd config to allow password login over ssh)19:26
rharperso 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 user19:27
meenaparide: but then nobody will mail me :P19:37
Hawk_XYes, but for some reason the network-config file config is not being accepted by cloudinit19:57
Hawk_XSo the interface is brought up but not configured.19:57
Hawk_XI am looking at the logs now.19:57
Hawk_XStill looking...20:10
rharperHawk_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:18
meenasmoser: i made the executive decision to resolve this comment: https://github.com/canonical/cloud-init/pull/625#discussion_r51229603520:46
smoserwhat does resolve mean in that scenario?21:00
meenasmoser: i clicked the resolve conversation button, after explaining that Puppet Facter also calls jails `jail` and not `bsd-jail`21:01
smoseroh. i see.21:02
meenai could look at chef and salt and ansible for other clues21:02
smosernever mind.21:02
smoserthats fine.21:02
Odd_BlokeAnhVoMSFT: 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
ubot5Ubuntu bug 1901011 in cloud-init "Azure temporary disk not present for instance type" [Undecided,New]21:05
Hawk_XThanks to rharper for the assist.21:46
Hawk_XUnfortunately, the network-config is not being accepted by ubuntu. Here's the pastebin: https://paste.ubuntu.com/p/b6F2j8xhpH/21:46
Hawk_XI 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:46
Hawk_XEither way, it doesn't recognize the network config and the instance boots without IP :-(21:47
Hawk_XThe 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:48
meenaeh?21:49
meenayou have no (virtual) serial console access to the machine?21:50
meenaHawk_X: worst case, you could post a screenshot21:51
rharperHawk_X: your nameservers is incorrect format, it's namesevers: addresses: [1.1.1.1]22:03
Hawk_XThanks!22:18
Hawk_XI have virtual console access22:18
Hawk_XApologies, I thought I would be receiving an answer soon. Much appreciated.22:36
Hawk_XSpinning a new instance now. BRB22:36
Hawk_XLadies 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 morning23:17
Hawk_XThanks again for all your assistance!23:17
johnsonshiOdd_Bloke: I'm taking a look at https://bugs.launchpad.net/cloud-init/+bug/1901011 now23:22
ubot5Ubuntu bug 1901011 in cloud-init "Azure temporary disk not present for instance type" [Undecided,New]23:22
johnsonshiYes indeed, there are new instance types that don't have ephemeral resource disks. We're discussing internally about this issue.23:24

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