/srv/irclogs.ubuntu.com/2019/08/06/#cloud-init.txt

otubopowersj, hey! First time attending cloud-init summit this year. Just wanted to understand the format of the event. Should I (can I?) prepare some slides to talk about cloud-init and Red Hat?12:47
rharperrobjo: here now15:02
robjorharper: in a meeting will ping you after, thanks15:03
rharpersure15:03
tribaalOdd_Bloke: I think I addressed all of your reviews points, if you have some time to have another look :)15:05
Odd_Bloketribaal: Sure thing!  Today's looking pretty busy (meetings and catch-up after a public holiday yesterday), so it may be tomorrow before I get to it, FYI.15:10
amansi26I am trying to install cloud-init v19.1 on Ubuntu16.04. I get install with status: done. But when I check logs for the cloud-final.service, it says http://paste.openstack.org/show/755571/. I tried doing live capturing and deploy another VM on the image, it get assigned with the earlier VM IP. Can someone please suggest something to resolve?15:11
Odd_Blokeamansi26: cloud-init comes installed in the Ubuntu cloud images by default; when you say "trying to install", can you clarify what you mean?15:12
Odd_Bloke(I'm heading in to a block of meetings in a couple of minutes, FYI, so I won't be as responsive here.)15:13
amansi26I added some custom module and made a debian package. Then I install that package on a Ubuntu machine15:14
amansi26The same version works fine for RHEL.15:15
tribaalOdd_Bloke: no worries, thanks for your time!15:20
Odd_Blokeamansi26: I would suggest you file a cloud-init bug (the link is in the topic) describing the issue in detail, and ensuring to attach the tarball generated by `cloud-init collect-logs` to it. :)15:50
blackboxswrharper: only blocker to shifting generate_fallback_config from speaking network v1 to network v2 seems to be that when generating driver/device_id udev rules by NetworkState, the  driver parameters are lost in a couple of cases. So, the rules get emitted like this:          DRIVERS=="?*"   instead of 'DRIVERS=="hv_netsvc".   I'm gonna track that down now15:51
amansi26Odd_Bloke:Sure15:51
blackboxswamansi26: good to hear of people packagin custom plugin modules. I wasn't sure how often that 'feature' of cloud-init was used15:52
rharperblackboxsw: yes, that sounds right;  I think we need a way to hang that in the NetworkState so that a v2 -> eni does the right thing;  for v2 -> v2; that should be converted to match: {'device_driver': 'hv_netscv'}15:53
blackboxswrharper: +1 though I thought the match section had 'driver' and 'device_id' keys. I'll double check.. maybe that's my misunderstanding due to cloudinit/net/__init__.py :extract_physdevs._version_215:55
* blackboxsw checks netplan.io examples15:55
cyphermoxonly driver, mac, or name15:56
rharperdriver works15:56
rharperthat's what we want15:56
rharperthe azure code wants to explicitly ignore than mlx4_core devices; and the dhcp should apply only to the devices with driver=hv_netscv15:56
blackboxswhttps://netplan.io/reference#common-properties-for-physical-device-types15:56
blackboxswroger15:56
rharperso, we should be able to match with both driver and mac15:56
blackboxsw+115:57
blackboxswrharper: the reference for netplan doesn't say anything about device_id property in match. (only driver). Should v2 emit a device_id 0x3(or whatever?) or is there another reference that might document that15:58
rharperdriver is fine15:59
rharperdoes the device_id even show up in the udev rule ?15:59
blackboxswdon't think so SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:11:22:33:44:55", NAME="eth1"16:00
rharperright16:00
blackboxswok omitting16:00
rharperright, azure only calls into fallback with the driver name to blacklist16:00
blackboxswagreed16:01
rharperI think the fallback just stuffed the device_id in there because it was part of the device_driver() return16:01
blackboxswyeah and if we don't need/use it, then no need to call device_devid() anymore either16:08
blackboxswcyphermox: thanks for the confirmation on !devicE_id16:09
cyphermoxI'm not against adding new matching ways, but it largely depends on what networkd can realistically do, and that's a bit of a pain16:09
blackboxsw+1, I don't think we have a use case that currently requires device_id. If we do we'll file a bug/feature request16:10
cyphermoxack16:10
robjorharper: still have to get back to the other network issue, but something new popped up yesterday16:25
rharperrefresh my mind on other issues16:25
robjoopenstack setup in "dual stack mode, i.e. ipv4 & 6"16:26
rharperthis is the new one16:26
robjothe metadatada server produces:16:26
robjocurl http://169.254.169.254/openstack/2018-08-27/network_data.json16:26
robjo{"services": [], "networks": [{"network_id": "4aae8709-b4e6-4cf7-84f7-b7cbddfe3ecb", "link": "tapc48a243a-e6", "type": "ipv4_dhcp", "id": "network0"}, {"network_id": "4aae8709-b4e6-4cf7-84f7-b7cbddfe3ecb", "type": "ipv6_slaac", "services": [], "netmask": "ffff:ffff:ffff:ffff::", "link": "tapc48a243a-e6", "routes": [{"netmask": "::", "network": "::", "gateway": "fd29:c112:2871::1"}], "ip_address": "fd29:c112:2871:0:f816:3eff:fe64:b0d616:26
robjo", "id": "network1"}], "links": [{"ethernet_mac_address": "fa:16:3e:64:b0:d6", "mtu": 1450, "type": "ovs", "id": "tapc48a243a-e6", "vif_id": "c48a243a-e623-4ef6-a363-98564e59fade"}]}16:26
robjothe openstack helper then produces:16:26
robjo2019-08-05 14:14:10,631 - stages.py[DEBUG]: applying net config names for {'version': 1, 'config': [{'mtu': 1450, 'type': 'physical', 'subnets': [{'type': 'dhcp4'}, {'type': 'static', 'netmask': 'ffff:ffff:ffff:ffff::', 'routes': [{'netmask': '::', 'network': '::', 'gateway': 'fd29:c112:2871::1'}], 'address': 'fd29:c112:2871:0:f816:3eff:fe64:b0d6'}], 'mac_address': 'fa:16:3e:64:b0:d6', 'name': 'eth0'}]}16:27
robjoso we have a "static" and a "dynamic" subnet on the same interface16:27
robjothese get processed in order and so the renderer clobbers "bootproto=dhcp" with "bootproto=static"16:28
robjothat of course breaks ipv4 access to the system16:28
robjoone fix is to declare dhcp the winner in the rendered, i.e.:16:29
rharperis it ?16:29
robjoyes because ifcfg-eth0 will have "bootproto=static" which menas the dhcp client to request an IP address will not staart and thus the instance only has the static IPv6 address16:30
rharperbut dhcp will allow static ip assignment in addition to dhcp ?16:30
robjoyes, but the interface is configured as "static" therefore no dhcp request will be issued16:31
rharperok, is that consistent on rhel/suse ?16:31
robjothe fix is to pick dhcp as the winner, i.e. in the renderer it should be:16:32
robjoelif subnet_type == 'static':16:32
robjo    if iface_cfg['BOOTPROTO'] != 'dhcp':16:32
robjo        iface_cfg['BOOTPROTO'] = 'static'16:32
robjoit's on openSUSE/SLES, but I would be surprised if RHEL behaves differently in this case16:33
rharperhttps://paste.ubuntu.com/p/drPGpmW8KT/16:34
rharperI can't reproduce with cloud-init master16:34
rharperboth suse/centos hav bootproto=dhcp16:34
rharperrobjo: the dual_stack.yaml is the v1 config you pasted from the log16:38
robjoOK, looking at the code, the issue was reported with 18.516:38
robjomaster produces the expected results, I agree16:39
robjogoing fishing through the code .....be back in a bit16:39
rharperrobjo: in your 18.5 branch, I think you can just repeat the net-convert command like I did and see if it renders differently16:41
robjoOK, that's weird the 18.5 renderer does not set bootproto to static either, more digging required, thanks for the help16:47
rharperrobjo: sure16:50
blackboxswrharper: just force pushed generate_fallback_config -> talking network v2 to https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/370970 for azure v2 support17:15
rharpercool17:16
AnhVoMSFTHi folks, I'm seeing this error from one customer's deployment18:00
AnhVoMSFT2019-07-31 17:09:16,279 - util.py[DEBUG]: Failed mount of '/dev/sr0' as 'auto': Unexpected error while running command.Command: ['mount', '-o', 'ro', '-t', 'auto', '/dev/sr0', '/run/cloud-init/tmp/tmphmsab0y2']Exit code: 32Reason: -Stdout: Stderr: mount: /dev/sr0 is already mounted or /run/cloud-init/tmp/tmphmsab0y2 busy18:01
AnhVoMSFTlooks like the command took about 2s and then failed18:01
AnhVoMSFTthere was a dump of /proc/mounts earlier but /dev/sr0 wasn't on there, so definitely it wasn't "already mounted" scenario, so likely /run/cloud-init/tmp/... was busy - that was created with "with temp_utils.tempdir() as tmpd:" in mount_cb , how can it be busy ?18:02
Odd_BlokeAnhVoMSFT: Are you able to file a bug with `collect-logs` attached?18:06
AnhVoMSFTwhat logs do collect-logs get? We have cloud-init-output log and cloud-init log, kernel log. The instance was deleted though18:07
smoserif it said 'already mounted', then i'd think the most likely scenario is that it was already mounted.18:09
smosercollect-logs will also get /run/cloud-init which is useful.18:09
Odd_BlokeIf that's what we have, that'll probably do.  I'd recommend doing a `collect-logs` in future if possible, though, because it gathers a bunch of useful stuff.18:09
smoserlack of /dev/sr0 in /proc/mounts that is dumped could be a race. cloud-init tried mount, failed, and then unmounted.18:09
AnhVoMSFTno, the dump of /proc/mounts is part of util.py mounting code, it checks before trying to mount. While there is potential race issue it's unlikely because other than cloud-init nothing else is mounting /dev/sr0 during init-local phase18:11
AnhVoMSFT(which is quite early in the boot process)18:11
ahosmanMSFT3.1418:26
blackboxswrharper: Odd_Bloke powersj, just published tip of cloud-init to eoan. should be seeing tip in cloud images tomorrow20:01
Odd_Bloke\o/20:04
blackboxsw cloud-init 19.2-5-g496aaa94-0ubuntu1 (Accepted)20:17
rharpernice20:19
blackboxswrharper: if I'm parsing IMDS in azure and the vm has 3 nics, should I think about adding dhcp4-overrides: route-metric: 100 * <intf_num> so the larger the interface number, the higher the metric? or should all non-primary be 200?20:37
blackboxswpowersj: I'm going to validate that eoan-proposed systemd=243~rc1-0ubuntu1 fixes Azure multi-ip on primary nic20:44
powersjexcellent20:44
blackboxswI expect it will.20:44
blackboxswbut that'll tie off azure multi-ip primary nic support20:45
djhaskin987If i run a `reboot` command as part of a runcmd, then I have subsequent commands after it, do all commands get run?21:39
djhaskin987example:21:39
djhaskin987```21:39
djhaskin987`runcmd:`21:39
djhaskin987`  - echo 'hi' | tee /tmp/a-file`21:39
djhaskin987`  - reboot`21:40
djhaskin987`  - echo 'hee hee' | tee -a /tmp/a-file`21:40
djhaskin987I want both `hi` and `hee hee` to be written to the file `/tmp/a-file` across reboot. Is this possible?21:40
rharperdjhaskin987: no, the reboot is going to run and the remainder of your commands won't be run again; it defaults to running command once per instance;21:47
Odd_Blokerharper: https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/370927 <-- ready for re-review21:49
djhaskin987rharper thanks for the info, very helpful.21:51
rharperdjhaskin987: https://cloudinit.readthedocs.io/en/latest/topics/examples.html#reboot-poweroff-when-finished   will allow you to take the reboot out, and I would suggest that you write a script with write_files to /var/lib/cloud/scripts/per-boot/XXXX ; that script will be called on every boot; and in your script, you can check for some marker file that your firstboot runcmd would touch;21:54
rharperOdd_Bloke: ok21:54
djhaskin987rharper sounds good thanks21:54
djhaskin987i'll do that21:55
blackboxswrharper and Odd_Bloke, also Azure support for route-metrics on secondary nics is up https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/37097021:57
blackboxswjust pushed changes. (I think I have lints to fix)21:58
rharperblackboxsw: nice22:00
rharperblackboxsw: so that one 'driver: hv_netsvc' ; that's in the example comment for the method right ? It's hard to see from the diff22:05
blackboxswrharper: right yeah, I just extended the docstring on a method22:16
blackboxswto represent expected method/function input22:16
kbZWhat about things?23:22
kbZWho knows about things23:23
kbZI have some questions23:27
rharperask away23:27
kbZin this path, cloud-init/cloudinit/sources23:28
kbZI'm looking to add a new source23:28
rharperyes!23:28
kbZbut I am pure dog scientist23:28
kbZif I wanted to query a metadata URL, does it have to be via IP or will I be able rock'n'roll with a domain?23:29
rharperyou can use a dns name,  DataSourceGCE.py for example uses that23:29
kbZso it does, thanks, will look there23:30
kbZI've never used Launchpad before :|23:30
kbZand uhh, I mean, I can barely write python, so this should be fun23:30
rharperhttps://cloudinit.readthedocs.io/en/latest/topics/hacking.html23:30
rharperthat should have most of the steps you can use to get started on a contribution23:31
kbZwhy spend ten minutes in the docs when I can spend ten hours toiling away?23:31
* kbZ looks23:31
kbZ>It assumes you have a Launchpad account23:31
kbZassumptions already, yikes23:31
rharperwell, at least it told you23:32
kbZlol, thanks :D23:32
kbZin Launchpad's defense, I usually only end up here angry and at the end of a bug23:32
kbZso we kinda got off on the wrong foot23:32
rharperfair enough23:32
kbZone thing I noticed23:37
kbZDataSourceAzure.py has different permissions than the rest23:37
kbZ-rwxr-xr-x vs -rw-r--r--23:37
kbZI want to make jokes23:38
kbZMicrosoft bully you into this? (the joke)23:38
rharperhehe23:38
kbZis that an accident? if I'm in here fixing things?23:39
rharperthe execute bit isn't needed on the Datasource, so sure, send in a fix23:39
kbZcool23:39
kbZwell, apparently I have been an Ubuntu One member for a long time23:40
kbZMember since:    2005-11-0423:40
kbZawe23:40
rharpernice23:40
kbZsomeone sent my real Ubuntu 6 CDs in the mail a long time ago23:40
rharperI've a few of those23:40
kbZlets see if I can slip in this chmod thing and then I'll try taking a crack at the bigger issue23:41
kbZ>To contribute, you must sign the Canonical contributor license agreement23:42
kbZwho gets my first born?23:42
rharperup to you =)23:44

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