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

blackboxswthank smoser00:37
smoserblackboxsw, tox && git pushing now00:37
smoserthen i'll upload again00:38
smoserblackboxsw, ok. that is uploaded. i go away for the night now.00:46
smoserblackboxsw, https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/33095400:49
smoserand now i really *am* gone.00:49
smoserlater.00:49
smoseruploaded00:50
rharpersmoser: do we know if any public cloud where we can test DataSourceOVF ?16:13
smoserwell you can test it locally16:14
smoserby providing an ovf iso. doc shows how to create one16:14
rharperok16:15
smosersankaradita has one16:15
rharperok16:16
rharperhttps://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/330995    this is what I'm going to test;  I think it's a good cleanup w.r.t reducing the number of devices we actually probe (and re-using blkid cache)16:17
dpb1rharper: for a workaround for the case?  or a medium term fix?16:18
rharperlong term16:18
dpb1k16:19
rharperit's only looking for devices with iso9660 filesystem, blkid can do that quite quickly (and cloud-init respects the blkid cache); ds-identify will probe this early16:19
rharperso, this should speed up OVF probing dramatically for systems with more than just one block device16:19
smoserrharper, i'm pretty sure the mounting we're doing in the default case is doing a mount -t iso966016:27
smoserwhich i'd think would fail unless youhad iso966016:27
smoserso i'm not sure how this would cause races with other mounts.16:27
smosernot sure why we're failing https://code.launchpad.net/~cloud-init-dev/+recipe/cloud-init-daily-xenial16:34
blackboxswtest_openstack_on_non_intel_is_maybe   hmm16:36
blackboxswchecking maybe it's a leaked mock thing?16:36
blackboxswor unmocked leak I mean16:36
smoseryeah. thats all i can think of.16:40
smoseri can't reproduce it on the branch (ubuntu/xenial) though16:41
smosereven with patches applied16:41
smoserso trying in a container16:41
smoserblackboxsw, https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/33101218:32
seven-elevenhi18:50
seven-elevenhow can i run something after cloud-init is done?18:50
seven-elevenbasically i want my custom systemd unit file "openvpn2.service" run after cloud-init setup the hostname18:50
blackboxswsmoser: approved18:51
seven-elevenwhat i tried and didn't work: (1) appending After=cloud-init.target to openvpn2.service, (2) supplying user-data via droplets **user-data kwargs "systemctl daemon-reload; systemctl restart openvpn2"18:54
blackboxswseven-eleven: :n18:55
blackboxswseven-eleven: sorry I'm looking now. I thought systemd chaining would do that for you. but I'm checking which service you need to be after18:56
seven-elevenmaybe i can tell cloud-init in /etc/cloud/cloud.cfg   @ cloud_final_modules:  to restart my openvpn2, so it grabs the new hostname :]18:56
seven-elevenblackboxsw, let me paste my service18:56
seven-elevenblackboxsw, my customized openvpn2.service unit http://dpaste.com/1YF2AV0 which uses %H for hostname18:57
seven-elevenit's actually starting my service fine, but when i want to restart the service i have to run `systemctl daemon-reload`, else it fails. i can leave it like that, but it's not perfect :-)19:15
seven-elevenit fails with the error "Failed to start OpenVPN connection to bus1." and bus1 is the hostname of the vm i created the snapshot from19:16
rharpersmoser: re mount -t iso9660, we passed mtype to the util.mount_cb, all this does is change the list of candidate devices from os.listdir(dev)  to blkid -odevice -tTYPE=iso9660;  we still pass mtype into mount_cb;19:18
blackboxswseven-eleven: not sure if this helps, but what about After=cloud-final.service19:19
blackboxswthat's the last stage to run19:19
blackboxswhttp://cloudinit.readthedocs.io/en/latest/topics/boot.html#final19:19
blackboxswseven-eleven: you could also add a runcmd: ['systemctl daemon-restart <yourservice>']   and that should be run in final stage19:20
smoserrharper, right.19:20
smoserbut two things i was suggesting19:20
seven-elevenblackboxsw, let me try. i was also thinking to maybe add Before= to cloud-final19:21
smosera.) you can/should further limit th results through the regex that was already being done. otherwise you risk extending the breadth inadvertantly.19:21
smoserb.) the fact that we were passing '-t iso9660' makes me think that this was not actually the bug19:21
smoserbecause there is basically no way that 'mount -t iso9660' was going to work on any of the entries in the fstab provided.19:22
smoserso i dont know how it would have caused issues.19:22
rharpera) already limits to block devices with iso9660; the regex is likely too narrow but practically I see you point;  if there were possibly a block device that's outside of the regex, OVF claims to not want to look at it even if it has an iso9660;  that's debatable but certainly increased the "scope" however unlikely19:23
rharperb) is more interesting;  I wonder if mount's -t opens and peeks at the filesystem type19:24
rharperif that's done via exclusive-open, it could race with a .mount unit19:25
rharperwhich expects an exclusive-open19:25
smoserright. so we should just avoid inadvertantly extending the scope.19:25
smoser(and by doing so actually further *limit* this questionable search, which is good)19:25
rharpersmoser: yes; I can add the regex check back into the search;19:25
rharperpratically it won't matter but it's certainly possible19:25
smoserso yeah, it could be doing a exclusive open and a read-check for the fs magic19:25
smoserbut that'd seem *so* fast19:26
smoserthat i cant imagine we'd actually hit the issue19:26
smoseropen; read(4096); check; close()19:26
smoserthat is really really really fast19:26
rharperraces are races, however small19:26
rharperthe block device can be slow to respond19:26
smoserbut you woudlnt have seen someone report this19:26
smoseror if you did, they couldnt reproduce19:26
smoserthats my feeling.19:27
rharperright, and19:27
smoseri dont deny that it *could* happen19:27
rharperits mostly only reproducible with large sets of mounts19:27
rharperagreed19:27
smoserjust very unlikely that it is the source of the bug if i understand it right.19:27
rharperthe data from wolsen was that after disabling OVF datasource, some multi-hundred reboots never reproduces, where with OVF in, it reproduces every 3 or so19:28
rharperthis on a contrived instrance with like 26 ebs volumes19:28
smoserthat sounds plausible19:30
smoserrharper, also limiting the mount-callbac-umount19:33
smoserwe are also passing -o ro19:33
rharperit was also doing util.peek19:35
rharperwhich does an open and a read19:35
rharperwell, filtering the set of devices we poke to zero (unless they have an iso9660) will surely work19:35
rharperI generally expect that OVF run much faster that we're not checking all that regex devices, opening/read and also mount_cb each one19:36
smoserrharper, well, blkid is going to also do an open19:38
smoserfwiw19:38
rharperno19:38
rharperit's cached19:38
rharperds-identify runs blkid first19:38
rharperthen we just read the cache19:38
smoseri'm not sure that is the case19:38
rharperwhy do you think not?19:39
smoserwe do call find_devs_with with no_cache=False. but i have never actually been able to determine what blkid does wrt its cache.19:39
smoserwhen it determines something is valid and when not19:39
smoserrun:19:40
smosersudo strace -o /tmp/out blkid19:40
smoserand then run it again19:40
rharperwith -c/dev/null19:40
smoserwe only pass -c/dev/null if no_cache == true19:41
smoserie, thats supposed to be the "re-read everything"19:41
smoserit should re-use its cache if *not* given that19:41
rharperright, I just meant to compare the syscalls19:41
rharperso you can see what the cache buys you19:41
rharperw.r.t the cost;  for the instance with 26 volumes or so,  we have a total of 1.5 seconds time spent do 1) read /proc/mounts 2) regex match 3) peek file  4) mount_cb;19:43
rharperthats about 60 ms per device;  the filtering helps eliminate all of those;  that's pretty nice;19:43
smoserso i just never really understood what -c/dev/null does19:47
smoserit seems to still do stuff19:47
rharper-c means to ignore the cache; I suspect it depends on the query to some degree,19:49
rharpersmoser: around?  have time for a ho on the mount race?  I've got some questions I wanted to bounce off you if you're available21:00
smoserquick. yeah. i got 10 minutes21:03
rharperk21:05
rharpersmoser: https://hangouts.google.com/hangouts/_/canonical.com/cloud-init?authuser=121:05
smoserin21:06
seven-elevenblackboxsw, sorry i was afk and could test only now. After=cloud-final.service didn't help. but by using run_cmd it worked. I used digitalocean's API and provided run_cmd through the user_data attribute: http://dpaste.com/29JDA2Z21:24
akikfirewall-cmd --reload on centos 7 eats DOCKER-USER iptables chain. is that a problem?21:39
akiksorry wrong channel21:39
blackboxsw:)21:51
=== blackboxsw changed the topic of #cloud-init to: Reviews: http://bit.ly/ci-reviews | Next status meeting: Monday 10/2 14:00 UTC
=== blackboxsw changed the topic of #cloud-init to: Reviews: http://bit.ly/ci-reviews | Meeting minutes: https://goo.gl/Ts2k8t | Next status meeting: Monday 10/2 14:00 UTC
=== blackboxsw changed the topic of #cloud-init to: Reviews: http://bit.ly/ci-reviews | Meeting minutes: https://goo.gl/mrHdaj | Next status meeting: Monday 10/2 14:00 UTC
blackboxswseven-eleven: good work!22:20

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