/srv/irclogs.ubuntu.com/2020/04/09/#cloud-init.txt

=== logan_ is now known as logan-
=== tds7 is now known as tds
kqkq95hi all ! i use Cloud-init with foreman, I have a vmware template under Centos 8, and when my vm starts my network interfaces are disconnected, I use open-vm-tools-10.3.10-3.el8 and cloud-init v18.5-7.el8, and when I delete the cloud-init package from my template it works fine, I have been looking for several hours but nothing09:13
kqkq95?11:11
=== vrubiolo1 is now known as vrubiolo
=== hggdh is now known as hggdh-msft
kqkq95nobody uses cloud-init and open-vm-tools ?13:19
Odd_Blokejohnsonshi: tox does attempt to detect when declared dependencies have changed and automatically recreate, but it isn't always perfect (as you now know ;).13:28
Odd_Blokekqkq95: The cloud-init core team are all based in US timezones, so we're only just coming online now.  There are ongoing issues with VMWare and cloud-init, which the cloud-init core team don't have the expertise to address.  We work with the VMWare developers who contribute to cloud-init, but as we don't have a depth of VMWare knowledge (or access to different environments etc.), there's only so much we13:32
Odd_Blokecan do independent of them.13:32
Odd_Blokekqkq95: All that said, if you could run `cloud-init collect-logs` in a failing instance and make that tarball available somewhere, then I can see if there's anything obvious going on. :)13:33
apollo13kqkq95: did you get guest customizations to work with a golden image against vmware?13:40
apollo13I always fail because vmware won't detect that the open-vm-tools are installed till I start the vm the first time13:41
apollo13which I especially do not want to do because it is a clean template13:41
kqkq95hi all13:41
kqkq95yes i use a vmware template under Centos 8, I do not know too much comment configure cloud-init with the value: disable_vmware_customization: false13:44
kqkq95because i configure my static network with foreman who use open-vm-tools13:45
apollo13kqkq95: curious, if you do not mind, how did you create the template? and does vmware detect guest customizations in the template without ever starting the template on vmware?13:46
kqkq95the template was created with the official CentOS ISO13:47
kqkq95everything works fine without cloud-init :(13:48
kqkq95ok i follow this : https://kb.vmware.com/s/article/5955714:10
kqkq95the network is now good :)14:10
kqkq95but i have error in log : https://pastebin.com/X92rReed14:11
kqkq95why eth0 show nothing while my network is good "ip address list" is ok14:14
apollo13kqkq95: so you created the template by installing it on vmware and then convert to template?14:16
apollo13Odd_Bloke: are you around by any chance and can help me with an ubuntu cloud image? I am trying to get rid of the console changes they do for grub14:17
kqkq95appollo13: yes14:17
kqkq95apollo13: yep14:17
apollo13kqkq95: ah okay, how do you clean the system up afterwards?14:17
apollo13although I guess you might just rely on cloud-init to set machine-id to something new etc14:18
kqkq95apollo13: iarf14:18
apollo13I went another way and used virt-sysprep to pregenerate clean images but then vmware won't realize that they include guest tools *shrug*14:18
kqkq95apollo13: I don't clean...14:18
kqkq95apollo13: is there a procedure or script to put on the model ?14:19
apollo13na I scripted it myself with packer from hashicorp to automate the install and then cleaned it with virt-sysprep and generated an ova that I could import in vmware14:20
kqkq95i can use : cloud-init clean14:24
apollo13interesting, didn't know of that one :)14:24
kqkq95ok cloud-init show all my interfaces when i run cloud-init init :)14:26
kqkq95but why he says "Did not find any data source, search classes"14:26
kqkq95i setup a file name 10_foreman.cfg in directory /etc/cloud/cloud.cfg.d/14:27
Odd_Blokeapollo13: Sure, what's up?14:27
apollo13Odd_Bloke: so ubuntu cloud-init images inject console=tty1 console=ttyS0 into grub.cfg14:28
apollo13somewhere very early, I am trying to find out were so I can remove that14:28
Odd_BlokeI believe it's in the shipped image.14:28
apollo13not exactly sure why one would want a serial console :)14:28
apollo13yes, but where :)14:28
apollo13I am remastering the image with guestfish and I'd like to get rid of that14:28
Odd_BlokeOh, I see, you're asking where it's configured in the image?14:29
apollo13debian had it in /etc/default/grub, ubuntu has it (after boot) in /etc/default/grub.d/50-cloudinit-settings.cfg14:29
Odd_Bloke/etc/default/grub.d/50-cloudimg-settings.cfg14:29
apollo13but the latter only exists after first boot?14:29
Odd_BlokeI don't think so, I think it's in the shipped image.14:30
apollo13let me recheck14:30
Odd_Bloke(As an aside, the Ubuntu cloud images are designed to boot in as many scenarios as possible, and some places need a serial console for that.)14:30
apollo13openstack I presume?14:31
apollo13you might be right, I just checked the sha on my image and it doesn't match the one from https://cloud-images.ubuntu.com/focal/current/SHA1SUMS -- maybe I deleted it already14:32
apollo13let me redownload that14:32
Odd_BlokeI'm not sure off-hand which scenarios require it, but given how configurable OpenStack is, I'm sure there are OpenStacks that require it, yeah. :p14:33
apollo13the funny thing is that by requiring a serial console it doesn't work on proxmox etc by default14:33
apollo13or rather then I have to switch to serial and I rather have spice displays14:33
apollo13Odd_Bloke: perfect the file is there, thank you.14:35
Odd_BlokeOK, phew. :)14:37
Odd_Blokerharper: blackboxsw: openssh now (in focal since February) supports .d directories for ssh_config and sshd_config.  I've filed two bugs related to this (basically, one for reading, one for writing): https://bugs.launchpad.net/cloud-init/+bug/1871858 https://bugs.launchpad.net/cloud-init/+bug/187185914:38
ubot5Ubuntu bug 1871858 in cloud-init "cloud-init should support parsing ssh_config/sshd_config files with Include directives" [Undecided,New]14:38
ubot5Ubuntu bug 1871859 in cloud-init "cloud-init should write ssh_config.d/sshd_config.d snippets (when supported) instead of modifying config files" [Undecided,New]14:38
Odd_BlokeThese seem like good candidates for our roadmap for next cycle to me.14:39
Odd_Blokepowersj: rick_h_: ^ FYI.14:39
rick_h_Odd_Bloke:  cool ty14:40
rharperOdd_Bloke: ok14:50
=== cpaelzer__ is now known as cpaelzer
andras-kovacsHi! Is there a way to disable cloud-init to write in the root users's authorized-keys file?15:35
Odd_Blokeandras-kovacs: What is currently being written in there that you would prefer wasn't?15:59
andras-kovacsOdd_Bloke:  no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"myusername\" rather than the user \"root\".';echo;sleep 10" + my pubkey16:01
andras-kovacsNothing, I decided to remove the whole file in the end with runcmd.16:01
kqkq95ok I have made good progress in my problem, my configuration seems good, but it seems that the client cannot reach foreman, the flows are however very open16:04
kqkq95error here : https://pastebin.com/hqnMrZFy16:04
andras-kovacskqkq95: what OS do you have exactly?16:09
andras-kovacswhat does systemctl status cloud-init.target says?16:11
blackboxswandras-kovacs: I think you are looking at #cloud-config`disable_root` and `disable_root_opts` settings16:11
blackboxsw    disable_root: <true/false>16:11
blackboxsw    disable_root_opts: <disable root options string>16:11
blackboxswhttps://cloudinit.readthedocs.io/en/latest/topics/modules.html#authorized-keys16:11
blackboxswyou should be able to provide disable_root: false to avoid adding that to /root/.ssh/authorized_keys file16:12
blackboxswandras-kovacs: or alternately you could provide a different set of opts than the default .... no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command16:13
blackboxswby setting disable_root_opts: 'something else'16:13
andras-kovacsthank you! and what about the ssh pubkey?16:13
andras-kovacsI get it from a datastore but it would be enough if the default user would get it.16:14
kqkq95andras-kovacs: CentOS 816:15
andras-kovacskqkq95: if cloud-init services are enabled, no file or kernel parameter which disables it, try:16:16
andras-kovacsmv /etc/systemd/system/cloud-init.target.wants/cloud-* /etc/systemd/system/multi-user.target.wants/16:16
andras-kovacscloud-init clean --reboot16:16
blackboxswandras-kovacs: ssh_import_id: [gh:<youruser]   or [lp:<youruser>]   or ssh_authorized_keys per https://cloudinit.readthedocs.io/en/latest/topics/examples.html#configure-instances-ssh-keys16:16
blackboxswany of those keys get assigned to the default user16:17
kqkq95andras-kovacs: why mv ?16:17
andras-kovacsThere was a significant change with cloud-init in RHEL. Previously all these services were wanted by the multiuser.target16:18
andras-kovacsnow it moved to it's custom, cloud-init.target16:18
andras-kovacsIt's not working for me either in RHEL 7.816:18
andras-kovacshttps://bugzilla.redhat.com/show_bug.cgi?id=182054016:18
ubot5bugzilla.redhat.com bug 1820540 in cloud-init "cloud-init package broken post 7.8 upgrade" [Medium,Assigned]16:18
andras-kovacsI know the mv part is dirty, but it is the easiest way to test it IMHO16:19
kqkq95my unit vloud* is already on multi-user.target.wants16:19
kqkq95*cloud16:19
Odd_BlokeMoving units around is very heavyweight (and could cause upgrade problems), it would be better to add additional dependencies IMO.16:21
kqkq95andras-kovacs: cloud-init target does not exist, I have cloud-config.service, cloud-final.service, cloud-init-local.service and cloud-init.service16:21
andras-kovacswhich version of cloud-init do you have there? :O16:21
kqkq9518.5-7.el816:22
andras-kovacsOdd_Bloke: these are not the units just the symlinks :) Easy to revert/disable them.16:22
Odd_BlokeAha, right.  Still, better to express a dependency on cloud-init.target, probably?16:23
andras-kovacswith systemctl edit yes16:25
andras-kovacsbut it was the shortest and fastest idea to test it16:25
andras-kovacsbut cloud-init.target is not there16:25
kqkq95yes16:25
apollo13ha I have the same question as andras-kovacs, disable_root: false and ssh_authorized_keys still writes to root as well as the configured user16:27
apollo13just tested on ubuntu focal16:28
andras-kovacsruncmd:16:28
andras-kovacs - rm -f /root/.ssh/authorized_keys16:28
andras-kovacsit will be fine for me16:28
apollo13that will work, but if my user actually set root as the default user I'd remove that again…16:28
* apollo13 checks cloud-init source16:29
andras-kovacsoh you are right :S16:29
andras-kovacsbut the funny thing is runcmd doesn't work if there is LVM on the server (which is sick in cloud env, I know I know.. .but still a requirement)16:29
andras-kovacsAnd there is no info in the logs about it why :(16:29
andras-kovacsat the end of the day I made a custom systemd unit which replaces the runcmd part and destroys itself16:30
apollo13looking at current master of cloud-init: https://dpaste.org/zi5J/raw16:30
andras-kovacsand noone should use the root user as the default one16:30
apollo13doesn't look as if there were __any__ way to disable setting the key for root16:31
andras-kovacsopenssh is not bulletproof (nothing is)16:31
blackboxswapollo13:/andras-kovacs hrm right disable_root is actually saying any configured ssh keys are put in both root and <default_user> because we expect users may have accidentally tried to login as root and we steer them to the actual default user instead with a printed message breadcrumb.16:31
rharperandras-kovacs: there's no interesection between lvm and runcmd ...     are you seeing an error in cloud-init status or cloud-init.log ?    or expecting output from runcmd to be somewhere on the filesystem and it's not ?16:31
apollo13blackboxsw: yeah I'd like to prevent that because it leaks user information16:31
blackboxswso apollo13 andras-kovacs is the feature, that you want cloud-init to avoid touching root at all?16:31
blackboxswand only setup default_user16:32
kqkq95andras-kovacs: no idea for me :(16:32
andras-kovacsyes16:32
apollo13blackboxsw: if use X is configured as default_user I do not want the ssh keys applied to root16:32
apollo13yes16:32
apollo13if user X *16:32
andras-kovacsblackboxsw: I totally got your point and I was thinking previously like how smart was it.16:33
apollo13andras-kovacs: funny though that we have the same problem the same day :D and I am pretty sure I do not know you16:33
andras-kovacsto think about this scenario16:33
blackboxswI know there is a way to avoid dropping keys in root && default_user. just trying to think it through.16:33
andras-kovacsset an immutable flag on it (but cloud-init would probably fail?)16:34
apollo13blackboxsw: looking at the link I just posted from cloud-init master I doubt it16:34
andras-kovacsI'll remove it at the end, that should be ok.16:34
apollo13andras-kovacs: setting immutable would work, but that also means you have to generate .ssh/authorized_keys in the first place since it's not there by default16:35
andras-kovacsapollo13: yes and I have a feeling cloud-init would fail (maybe silently) if it can't write there16:37
andras-kovacsso I'll remove the file in the runcmd part at the end16:37
apollo13is there any way to allow password logins?16:38
apollo13and yes I know it's insecure, but it is just to allow initial login on the box and easy testing, our cfg mgmt will forbid it globally anyways16:39
rharperssh_pwauth: True16:39
rharperpassword: XXXXXX16:39
apollo13ah thx16:39
rharperchpasswd: { expire: False }16:40
rharperthat's in my debugging user-data16:40
blackboxswandras-kovacs: apollo13 yeah looks like a feature request for cloud-init to avoid reflecting/disabled keys into 'root' user's authorized_keys file.16:41
blackboxswas you mentioned.16:41
blackboxswa bug would be nice for that and upstream can discuss whether this is a feature is something that we will be tackling in short term.16:42
apollo13rharper: mhm, I am having a hard time finding what "password" does16:42
apollo13ah it's from the default user, nevermind16:43
apollo13the docs are confusing sometimes16:43
apollo13interesting enough proxmox sets chpasswd.expire: false but not ssh_pwauth :D16:44
rharperapollo13: yeah;  some of this config is quite old so it's not well scoped under which module uses it;16:45
apollo13blackboxsw: https://bugs.launchpad.net/cloud-init/+filebug ?16:46
blackboxswyes please apollo1316:46
blackboxswjust describe the feature and we'll triage it and determine how best to address it.16:47
apollo13ffs I tried searching if such a bug already exists but timeout error on search16:47
apollo13so might be a dupe :/16:47
blackboxswno worries, can check that.16:52
blackboxswthanks16:52
apollo13blackboxsw: https://bugs.launchpad.net/cloud-init/+bug/1871879 -- not the end of the world for me, but would be nice if there were an option to disable it. Thanks for caring!16:54
ubot5Ubuntu bug 1871879 in cloud-init "Configuring a user should not configure root's authorized_keys" [Undecided,New]16:54
blackboxswOdd_Bloke: rharper I have updated the branching/cherry-pick process spec https://hackmd.io/VbmtcZLyR4650aqqmfMMYg  to reflect yesterday's conversation and I have updated tooling to codify that.18:25
blackboxswI'm about to push up doc changes to uss-tableflip PR#45 and cloud-init PR 308 with the steps to fix daily build recipe18:26
blackboxswok rharper Odd_Bloke I've closed 308  in favor of manual PR https://github.com/canonical/cloud-init/pull/312 for fixing ubuntu daily build recipe19:35
blackboxswthanks for the discussions yesterday about the best approach for branch management to avoid push/pop of cpicks in the ubuntu/series branches19:36
rharperblackboxsw: ok ... I'll try to look;  grinding through some more curtin bits first19:40
=== tds7 is now known as tds
blackboxswrharper: responded to the big question https://github.com/CanonicalLtd/uss-tableflip/pull/45#discussion_r40650531622:50
blackboxswand updated that I misread your 2nd question there22:52
blackboxswI think I may have missed the point of your question about 'only needing the commit' from ubuntu/devel in ubuntu/daily/devel in order to revert.23:10
blackboxswso I think on rereading the 3rd time yoy may have meant that ubuntu/daily/devel could actually just 'git cherry-pick cpick_commit_from_ubuntu_devel; git revert cpick_commit_from_ubuntu_devel' ? maybe23:11
blackboxswthe issue with just git cherry-picking a single commit into ubuntu/daily/devel and reverting it is that ubuntu/daily/devel is essentially a downstream, so that revert we'd perform there is on a comittish that is local only do ubuntu/daily/devel branch, so it won't revert the parent's commitish.23:22
blackboxsw... when we merge back ubuntu/daily/devel into ubuntu/devel for daily recipe builds23:22

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