/srv/irclogs.ubuntu.com/2021/10/26/#cloud-init.txt

dngray[m]1does anyone have an example of passing in a directory with 9p like a home directory?00:38
dngray[m]1for some reason i can't find one anywhere00:38
dngray[m]1maybe these have to be defined in my virsh xml file instead.00:40
dngray[m]1https://pcocc.readthedocs.io/en/latest/manpages/man7/9pmount-tutorial.html02:09
dngray[m]1i'm confused, it looks like you can specify 9p mounts02:10
dngray[m]1though i didn't see it mentioned on https://cloudinit.readthedocs.io/en/latest/topics/modules.html#mounts02:10
dngray[m]1sudo mount -t 9p works02:11
GurjeetHi @all,04:01
GurjeetHi @all, I am trying to run a shell script using cloud-init, but unable to do so for an offline system04:02
GurjeetWill you please help me in this, thanks in advance.04:03
GurjeetHi all,06:26
GurjeetI am trying to run a shell script using cloud-config for modifying a ubuntu-iso, but that is not working for me. Will you please help me in this06:27
Gurjeetd06:28
minimalcould PRs #1081, #1082, and #1083 be considered for the 21.4 release? they are each minor changes13:52
ubottuBug 1081 in zope-cmfplone (Ubuntu) "Can't install plone-site" [Medium, Invalid] https://launchpad.net/bugs/108113:52
ubottuBug 1083 in seahorse (Ubuntu) "encryption not included in nautilus" [Medium, Fix Released] https://launchpad.net/bugs/108313:52
ubottuBug 1082 in safecat (Ubuntu) "Can't execute safecat" [Medium, Fix Released] https://launchpad.net/bugs/108213:52
minimalhmm, the ubottu bot doesn't map references to cloud-init PRs13:53
falcojrminimal: I'll try to get them in this week, though I'll probably have some questions on the PRs themselves14:18
minimalfalcojr: no panic, if they don't make the release its not the end of the world :-) I've submitted these simple ones to reduce any potential impact on the release, I'll keep more complicated PRs until after the release14:20
dngray[m]1hey, so i'm trying to pass in a home directory from my host14:23
dngray[m]1is 9p the right thing to do that? I'm using kvm/libvirtd14:23
dngray[m]1i'm using a filesystem declaration like so https://clbin.com/tiuJ614:24
dngray[m]1this goes in my file so when i do "virsh -c qemu:///system define vm.xml" it is available14:25
minimaldngray: that's not really a cloud-init question though? more a libvirtd one14:25
dngray[m]1i've got a fairly simple cloud-init14:26
dngray[m]1https://clbin.com/Zm4EU14:26
dngray[m]1if i type "mount -t 9p dngray /home/dngray/somefolder" it does mount, so 9p is working14:27
dngray[m]1but i am actually just passing wanting to pass the home directories in14:27
dngray[m]1i figured "no_create_home" would be appropriate, as i don't want to create a homedirectory14:28
dngray[m]1well it is i'm trying to get cloud init to mount it on boot14:28
dngray[m]1what i am saying is i've verified it works when defining/mounting manually, but that's not really what i want, i want to pass in my home directory14:29
dngray[m]1so t hat when i spool up a new vm, my home directory is always the same14:29
minimaldngray: this is alpine, right?14:29
dngray[m]1the line that seems to be not working is14:29
dngray[m]1mounts:14:29
dngray[m]1  - [ dngray, /home/dngray, 9p, 'trans=virtio,version=9p2000.L,msize=262144,nofail', '0', '0']14:29
cpaelzerdngray[m]1: if you can use modern host consider using virtiofsd instead of 9p14:30
dngray[m]1i can't find much documentation, on someone using 9p to mount their home directory inside a vm created with cloud-init14:30
minimaldngray[m]1: this is an Alpine VM, right?14:31
cpaelzerhttps://virtio-fs.gitlab.io/ + https://libvirt.org/kbase/virtiofs.html if you want to look at virtiofsd14:31
dngray[m]1minimal: host is alpine, guest is archlinux14:36
dngray[m]1cpaelzer: oh maybe i shouldn't use 9p then. i just thought that was what i needed.14:37
dngray[m]1oh i was already doing that i think14:37
dngray[m]1except i didn't set <driver type='virtiofs'/>14:38
minimaldngray[m]1: ok, so that probably rules out busybox mount command (on alpine by default busybox provides mount command which has some limitations)14:38
cpaelzerdngray[m]1: it is quite similar to configure, but if the host is new enough to have all you need for virtiofsd then IMHO it is preferable14:38
dngray[m]1it certainly should be the host is alpine linux 3.14.214:39
minimaldngray[m]1: did you try manually doing "mount -t 9p dngray -o trans=virtio,version=9p2000.L,msize=262144,nofail /home/dngray/somefolder" to verify the full command that cloud-init will try14:40
dngray[m]1i didn't manually do the whole command no, i just did "mount -t 9p dngray /home/dngray/directory"14:40
dngray[m]1so maybe that's the issue.14:40
dngray[m]1i kinda copied that from somewhere else i guess i shouldn't have14:40
dngray[m]1i'll try to use virtiofsd though if that's newer and preferable14:41
minimalright, so perhaps the command is not correct in the first place...14:41
dngray[m]1quite possibly.14:41
minimalas for your earlier VLAN issue with alpine, I tried to point out to you earlier on IRC that cloud-init specifically depends on ifupdown-ng which has the VLAN support - speaking as the Alpine maintainer for the cloud-init package :-)14:42
dngray[m]1oh yeah, i fixed that one by installing ifupdown-ng14:43
dngray[m]1and removing the ifupdown, that actually fixed the issue, and yes cloud-init does depend on ifupdown-ng in alpinelinux14:43
dngray[m]1when you use ifupdown-ng you don't actually need the old "vlan" package, that has a script that must be included in ifupdown-ng14:44
dngray[m]1oh yeah, so basically what you said, i figured out haha by trying it14:44
minimaldngray[m]1: my point was you shouldn't have needed to install ifupdown-ng as cloud-init depends on it already14:44
dngray[m]1oh yeah for sure, but it was conflicting with the vlan package, so i had to remove that first14:44
minimalI'm guessing perhaps you had upgraded prior to then and maybe didn't do an "apk -a upgrade" to have an up-to-date deps list14:46
dngray[m]1maybe.14:47
minimaldngray[m]1: one last thing, if you are intending to build cloud-init enabled Alpine images you might be interested in my script for this: https://github.com/dermotbradley/create-alpine-disk-image14:47
dngray[m]1i'll take a look, because i might in the future14:48
dngray[m]1i certainly do like alpine linux, but sometimes i want to use arch14:48
dngray[m]1mostly when im so lazy i want rolling release lol14:48
minimalI'm welcome to any feedback to improve cloud-init on Alpine14:49
minimalfalcojr: I just had a failure in Travis CI for PR #1084 and it doesn't look like its anything to do with my PR.14:52
ubottuBug 1084 in thunderbird (Ubuntu) "Turn on full headers or long To: list and there is no scroll bar" [Medium, Fix Released] https://launchpad.net/bugs/108414:52
minimalfalcojr: seems to be a Sphinx issue14:53
mNanternHello 👋. I'm not sure that I'm in the right place but I have a question about cloud-init.15:05
mNanternI want to update my hostname on EC2 (to the instance_id) by using jinja templating. It works well when I pass the template as a `user_data` but not at all when set as a file in `/etc/cloud/cloud.cfg.d/15_hostname.cfg`. I'm on Debian 10 Buster with cloud-init version 20.215:07
blackboxswmNantern: 20.2 should have jinja template support. Do you have example raw user_data (be careful if you have passwds in it)15:08
blackboxswBTW: this is the right place15:08
mNanternThanks :pra15:09
mNanternThe file: https://pastebin.com/25G4diBa15:09
blackboxswmNantern: you can see the user-data that cloud-init sees on the vm with: `sudo cloud-init query userdata`15:10
blackboxswahh sorry, backing up, you tried provided that ## template: jinja in the file named `/etc/cloud/cloud.cfg.d/15_hostname.cfg ?15:11
mNanternYes ! I shouldn't have?15:11
blackboxswnormally jinja template renderers are applied to user-data block which is provided to the system at launch time. I think it doesn't apply during rendering of the consolidated system config which is on disk in /etc/cloud/cloud.cfg and /etc/cloud/cloud.cfg.d/*.     I'm double checking that now though. I believe this is a desirable feature for cloud-init, but I think it isn't currently implemented. Again, I need to double check that now 15:13
blackboxswto confirm15:13
mNanternThanks! According to the doc (https://cloudinit.readthedocs.io/en/latest/topics/instancedata.html#using-instance-data) it should have worked, no? "Both user-data scripts and #cloud-config data support jinja template rendering. When the first line of the provided user-data begins with, ## template: jinja cloud-init will use jinja to render that file. " 15:15
blackboxswmNantern: correct, thought I think that needs to be clearer in docs. The files that are delivered in an image on disk are considered merged system config which basically sets opinionated image configuration defaults. `sudo cloud-init query merged_cfg` would show you on your system what the merged config from disk looks like. user-data though is a separate configuration blob that can contain #cloud-config or user-data scripts etc. 15:20
blackboxswThat user-data is assumed to override any existed merged_cfg config defaults, cloud instance meta-data or cloud instance vendor-data.15:20
blackboxswall said, the user-data processing handlers I think are the only ones that are jinja aware.  We could extend the merged config handling from disk to be jinja template aware. but I don't think that is there yet.15:21
mNanternAlright, thanks for the verification! I will use my config in user_data in this case ! 15:23
falcojrblackboxsw: another CI dep issue... https://github.com/canonical/cloud-init/pull/108518:12
ubottuPull 1085 in canonical/cloud-init "Add max version to docutils" [Open]18:12
minimalfalcojr: I assume you mean https://github.com/canonical/cloud-init/pull/108418:23
ubottuPull 1084 in canonical/cloud-init "hosts.alpine.tmpl: rearrange the order of short and long hostnames" [Open]18:23
falcojrminimal: yes, it's a fix for that18:35
minimalok, thanks18:47
Xedoes ssh_import_id work with modern cloud_init?19:53
Xethe examples claim it does but i cannot observe it working19:53
falcojrXe: it does. Do you get any errors in your /var/log/cloud-init.log ? How are you specifying it?20:19

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