/srv/irclogs.ubuntu.com/2017/09/12/#cloud-init.txt

gotenscript placed in /etc/cloud/cloud.cfg.d/my_script.cfg is not executed during boot up. Did not find any useful info in /var/log/cloud-init.log, is other places I can look for more info? Or what is the best way to troubleshoot this?05:34
=== smoser changed the topic of #cloud-init to: reviews: http://bit.ly/ci-reviews | mail: http://bit.ly/ci-mail-archive | docs: http://cloudinit.readthedocs.io/en/latest/ | next meeting Tue, 12 Sep 2017 16:30:00 +0000
powersjjust to have them in here: these are my two MPs for KVM15:17
powersjcommands as strings: https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/33053515:17
powersjadd xkvm: https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/33053615:17
dpb1xkvm?15:32
powersjwrapper around qemu command15:44
powersjrharper/smoser created for curtin's use15:44
naccsince qemu's parameters make little/no sense to most people, dpb1 :)15:45
dpb1people who aren't cpaelzer15:45
dpb1powersj: TIL, thx15:46
smoserrharper, https://blueprints.launchpad.net/nova/+spec/virt-device-tagged-attach-detach16:05
smoserthat is what i think i remember.16:06
rharper\o/16:06
=== smoser changed the topic of #cloud-init to: reviews: http://bit.ly/ci-reviews | mail: http://bit.ly/ci-mail-archive | docs: http://cloudinit.readthedocs.io/en/latest/ | next meeting Mon, 18 Sep 2017 16:00:00 +0000
rharpersmoser: in that spec, it mentions the qemu firmware exposing metadata path;  we have support for that now, right?  the nocloud from smbios?  do you think that's the same?17:33
rharper"Outside the scope of the Nova work, a simple tool will be created that can parse this metadata file and set tags against devices in the udev database. It is anticipated that cloud-init would trigger this tool. "17:34
smoserrharper, ?17:49
smoseri dont follow17:49
rharperI know we added some dmi path to getting datasource, or user-data, right ?17:50
rharperthe DMI NoCloud mode ?17:50
rharperI was wondering if that was what the spec was referring to w.r.t qemu exposing metadata via firmware to instances;    the spec has a general concern about providing network-based metadata to instances which may not have network configuration (the writers were unaware of how cloud-init handles this in other network-based datasources)17:51
rharperand the second quote was just an interesting tidbit;  the use-case of 'tagging' devices for service discovery (sdc is for 'oracledb') and wanted to provide a more "General" way for applications to discover the tagging without forcing the app to learn "openstack device tagging json schema"; and suggested udev tags/attrs as such a method17:52
smoserwell, the dmi nocloud stuff is not related to the openstack stuff for sure.17:53
rharperbut it17:53
rharperbut it was provided by qemu (aka firmware)17:54
smoserwe just now support reading nocloud info from dmi17:54
smoseryeah17:54
rharperI wonder if it could be a ConfigDrive style support if they could stuff enough info in there17:54
rharperI guess it's only useful during boot;17:55
rharperhence NoCloud;  I don't suppose qemu has an interface to update values in the dmi table dynamically17:55
smoserpowersj, you just replaced my mp ?17:56
smoserhttps://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/330459 -> https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/33053517:57
powersjBased on your comment it seemed like you wanted a seperate MP. So we can merge yours and then put mine on top to change the other strings.17:57
smoseroh i see you added some of the string changes too17:57
powersjyeah17:57
smoserpowersj, i'm sorry.18:34
powersj?18:34
powersjsmoser: I assume the sorry is for the review?18:38
smoseryeah18:42
powersjsmoser: for KVM when we execute SSH expects a string, and mount-image-callback expect a string18:50
powersjshould I then do the opposite as LXD, in that if it detects it is a of type array, convert it to a string?18:50
smoserpowersj, mount-image-callback doesn't expect a string. it has a sane interface.19:08
smoserssh interface sucks19:08
smoserit shoves you through sh (or rather the user's shell) more for security reasons than anything else.19:09
smoserthat way the platform can manage what your user can do by setting the shell differently.19:09
powersjsmoser: the way I was calling MIC https://paste.ubuntu.com/25522742/19:10
smoserto fix ssh, you can do this:19:10
smoser https://gist.github.com/smoser/88a5a77ab0debf268b945d46314ea44719:10
smoseryou have to be creative.19:10
smoser(that does insert a dependency on 'base64', which i dont have a good way to work around)19:10
powersjsigh19:12
powersjsmoser: I guess I'm not sure I understand why the usage of the python library doesn't work19:13
smoserthat is basically what we use in tools/run-centos : inside_as19:14
smoserwhat python library ? i'ms orry.19:14
powersjthe integration tests are in python19:14
powersjI am using paramiko to call ssh19:14
powersjfrom what you are saying you want me to get rid of that to call your ussh shell script19:14
smoserpowersj, no. using paramiko is fine19:24
smoserwe just wrap it sanely.19:24
powersjsmoser: define wrapping sanely :) outside of your base64 encoded strings this is a new to me19:26
smoser:)19:26
smoseri want to provide an interface '.execute()' that takes a list. not a string.19:26
smoser(just like subprocess.call() does... its not a crazy idea)19:27
dpb1powersj: you are familiar with pep8, right?19:27
dpb1the pep, not the tool19:27
powersjdpb1: of course19:27
dpb1ok19:27
powersjsmoser: you are choosing to pass a list to replicate the behavior or because you feel passing the list is a more design decision?19:31
powersjis a better design decision*19:31
smoseri think it is a better design decision. because in the end for doing anything complex you fight the shell more than it helps you.19:45
smoserand... as shown if you want to invoke a shell, that is easy.19:45
powersjsmoser: ok that is fair and makes sense when using subprocess calls, what I am trying to grawk is how to take that decision and apply it to my use cases.19:47
powersj1) the use of the python ssh library which expects a string19:48
powersj2) how I call MIC: https://paste.ubuntu.com/25522742/19:48
smoserwell you can just call mic with a list19:49
smosermount-image-callback image -- command19:49
smosermount-image-callback image -- command arg1 arg219:49
smoserso 2 is pretty easy19:49
powersjwell, that's not so clear to me19:50
powersjI can't append a list to it, so I have to process the list more than simply ' '.join(list) right?19:50
powersjor append the list to the whole command, meaning something like: ['mic', 'image', '--'] + command19:51
smoserpowersj, right.20:05
powersjsmoser: https://paste.ubuntu.com/25523087/ that is where I get stuck20:08
smoseryour /bin/sh is the problem there20:10
smoserchroot _MOUNTPOINT_ /bin/sh dpkg-query20:10
smoseryou're telling /bin/sh to execute something named 'dpkg-query'20:10
smoserwhich is not a file20:10
powersjand sure enough that works20:11
smoserso you just have to say:20:11
smoser if command_is_a_string:20:11
smoser     command = ["sh", "-c", command]20:12
smoserwhere 'command_is_a_string' is syntax to do that idea20:12
powersjok, do you even want to allow strings at this point then?20:12
smoserwe can allow them.20:13
powersjyou mentioned in only certain places in the last review20:13
smoserits just that they're scary to me20:13
powersj"lets only fix strings where we were already using sh (via sh -c)."20:13
smoserright20:13
powersjso if using sh -c --> convert to string and remove sh -c from it20:13
smoserso the places where we *were* doing 'sh', '-c'20:13
smoserit makes sense to just drop the sh -c20:14
smoserand pass the thing in as a string20:14
smoserand let the "do the right thing for strings" logic take over20:14
powersjif we were not doing that, then use as a list20:14
smoseryeah.20:14
smoserthe one you have theere in that paste has a bug.20:14
smoser--showformat='${Version}'20:14
smoserwe really wanted20:14
smoser --showformat=${Version}20:14
powersjI'm not so sure those quotes are a bug ;)20:15
powersjthat is getting the version to print it in the logs20:15
smoserits getting the version with '' around it20:15
powersjok so yes not part of the version20:15
powersjbut made the output look nice ;)20:15
powersjok one more question to let me get going on this20:16
powersjyou said this command is easily fixed into sh20:16
powersjcmd = ('for ((i=0;i<{time};i++)); do {test} && exit 0; sleep 1; done; exit 1;'20:16
smoserthe for() is bash syntax.20:20
smosercmd = ('i=0; while [ $i -lt {time} ] && i=$(($i+1)); do {test} && exit 0; sleep 1; done')20:21
powersjah20:21
smoserexit 1 at the end.20:21
powersjok I'll get these into a new merge for you to look at in the morning20:21
powersjthen we need to talk about SSH20:21
smoseryeah.20:22
smoserit is doable20:22
powersjsmoser: thx20:23
smoserpowersj, http://paste.ubuntu.com/25523267/20:45
powersjsmoser: interesting20:50
smoserhttp://paste.ubuntu.com/25523299/20:51
smoserpowersj, so whatever you were going to pass to paramiko to execute20:51
smoserjust pass paramiko.execute(shell_pack(cmd))20:52
powersjsmoser: but I can't pass a list20:52
powersj;) so convert list to string?20:52
powersjor add another isinstance(cmd, list) and run that20:53
smoseryou can pass shell_pack() a list or a string. or you can change it to only take a list20:53
smoserand then do the isinstance business elsewhere.20:53
smoserto be nice, we can wrap paramiko.execute() with a try/except and then lie about the commadn that we executed20:56
smoserso that the command that is printed looks like what was executed, rather than20:56
smosereval set -- "$(echo J2VjaG8nICcoIGhpIHBvd2Vyc2ogKSc= | base64 --decode)" && exec "$@"20:57
powersjheh yeah...20:59
dpb1bad memories there21:01
powersjone of my biggest complaints is debugging failed commands, especially when they look like lists21:01
dpb1in my last last job, we had a windows service that did something like this on every incoming ssh attempt.21:01
powersjso to get a base64 encoding string is even worse21:01
powersjhaha21:02
dpb1in our case, it was an improvment21:02
dpb1at least then you could cut and paste a string out21:02
dpb1instead of a random mix of ASCII and non-ascii characters that windows programs would decide to show you21:02
dpb1especially quotes21:02
smoserhttp://docs.paramiko.org/en/2.2/api/client.html21:04
smoserthat is odd21:04
smoserit returns a file-like object representing stdin, stdout, stderr21:04
smoserhow does it return stdin ?21:04
rharpersmoser:  https://bugs.launchpad.net/cloud-init/+bug/171677321:08
ubot5Ubuntu bug 1716773 in cloud-init "cloud-init doesn't cache network_config property in cache" [Undecided,New]21:08
* powersj loves the faster unit tests21:24
powersjthx blackboxsw21:24
blackboxswhopefully as we get more that continues to be the case21:25
powersjsmoser: should the shell pack be a separate merge?21:44
powersjworking quite nice so far21:44
powersjsmoser: string merge is ready https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/33053521:51
=== dhill__ is now known as dhill_
blackboxswgrr smoser https://bugs.launchpad.net/cloud-init/+bug/1691489 I just saw this on zesty on my nth redeployment iteration with our SRU candidate22:25
ubot5Ubuntu bug 1691489 in cloud-init (Ubuntu Yakkety) "fstab entries written by cloud-config may not be mounted" [Medium,Confirmed]22:25
blackboxswubuntu@zesty1:~$ grep reformat /var/log/cloud-init.log 2017-09-12 22:23:52,316 - DataSourceAzure.py[DEBUG]: reformattable=True: partition 1 (/dev/sdb1) on device /dev/disk/cloud/azure_resource was ntfs formatted and had no important files. Safe for reformatting.22:25
blackboxswthis message came up with a reformated disk on an instance that I had already created22:25
blackboxswcloud-init0.7.9-233-ge586fe35-0ubuntu1~17.04.122:25
blackboxswhrm reproduced multiple times on zesty. not sure what we do w/ that bug then. the "fix" didn't fully resolve  it, but it didn't break cloud-init either.22:34
blackboxswahh nevermind. even though reformatting happens /mnt is still formatted an no errors in cloud-init.log (per the original bug)22:41
blackboxswI was taking the ephemeral reformat log as a symptom of failure, but it's an ephemeral disk, reformatting it is okay. Not mounting it is not okay22:42
blackboxswok gotta run22:42
=== caphrim007 is now known as caphrim007_
=== caphrim007_ is now known as caphrim00_
=== caphrim00_ is now known as caphrim007

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