/srv/irclogs.ubuntu.com/2017/03/28/#cloud-init.txt

bbabichHowdy all - A brief question if I may...08:54
bbabichUpdating config of interface linux OSes08:54
bbabichie, enabling inet6 auto08:55
bbabichIs the only way via a runcmd?08:55
bbabichAnything native that you guys have run into?08:55
bbabichHmm09:00
bbabichhttp://curtin.readthedocs.io/en/latest/topics/networking.html#subnet-ip09:00
smoserbbabich, so what you can do is put networking config with that inside13:51
smoserin the image.13:51
=== rangerpbzzzz is now known as rangerpb
smoserbbabich, see the 'example config' at https://launchpad.net/ubuntu/+source/curtin/0.1.0~bzr479-0ubuntu114:57
smoserbah14:57
smoserat14:57
smoserhttps://gist.github.com/smoser/45935e78bf1b21ee7696be083240aa0f14:57
smoserbut if you do use that, you have to know the name (or mac) of eth0.  the "fallback" config is more dynamic as cloud-init picks what it views as "the first network device".14:57
smoserutlemming, http://paste.ubuntu.com/24268424/15:45
smoserrharper, take a read of ^ and let me know if you disagree with the suggestion. i think that is what we agreed to yesterday.15:45
smoserits not idea.15:45
smoserideal15:45
utlemmingsmoser, rharper: that will result in the second nameserver overriding the first15:46
rharperyeah, resolvconf sucks15:47
utlemmingI dug in on resolvconf, and you'll see `dns-nameservers 10.0.0.1` as the final15:47
smoserwell, in that case we'd get both. if you declare all on all.15:47
rharperyeah, we need to combine dns_* entries from all subnets, and put them in the network_state 'dns_*' fields15:47
utlemmingokay, that's seems simple enough...but it feels icky15:48
smoserjust looking at resolvconf man page it looks like it sort of supports this, but it would expect ENI to run resolvconf with a different IFACE.PROG for each of those stanzas.15:48
rharpersmoser: the issue is resolvconf being called for each iface stanza, and collecting the dns- values and overwriting15:48
rharpersmoser: right, but when the hook runs, IFACE=eth0 for each stanza15:49
rharperwhich clobbers subsequent calls15:49
smoseri could imagine ENI being extended to either let you declare the name to go to resolvconf or consistently create one (as long as it could do the same on takedown)15:49
rharperthe best debugging is to dump the ENV that ifupdown sets when the 00resolvconf ifup hook it is called15:49
rharperthere maybe other information that we could use in the hook (before we call resolvconf -a )15:50
smoserit looks like it does *sort* of handle it.15:51
smoserit uses "ADDRFAM"15:51
smoserso it would seem that one ipv4 and one ipv6 would work15:51
smoserright ?15:52
utlemmingsmoser: that is how I read it15:52
utlemmingI'm wondering though if there is a simplier way, but I don't like it either: install a new parser in /etc/resolvconf/update-libc.d/ that handles it all15:53
utlemmingsmoser, rharper: what do you guys think of that approach?15:58
utlemmingif our problem is that resolvconf is being obtuse, adding a hook that renders it right might be the cleanest15:58
utlemmingboth DNSMasq and Avahi use hooks to do that15:59
rharperutlemming: indeed; I've not looked at the hook but something needs to know about the multiple stanzas and indicate that the configs should be merged;  not sure how to handle when it should know it should replace the value vs. append/merge16:00
smoserwell...16:01
smoserso here is one path.16:01
smoseri have a stanza like this:16:03
smoseriface eth0 inet6 dhcp16:03
smoser   smoser_name eth0_dhcp116:03
smoserifupdown puts 'smoser_name=<value>' into the environment of the hooks16:03
smosererr...16:04
smoserIF_SMOSER_NAME='eth0_dhcp1'16:04
smoserso we can just have resolvconf 'opt in' to honoring some variable to influence its name used in16:05
smoser /etc/network/if-{down,up}.d/*resolvconf16:05
rharpersmoser: heh16:05
smosernot joking.16:06
rharperin general, I think I'd like resolvconf to do the right thing without something like placeholder_for_resolvconf16:06
smoserwe then, as the oracle rendering ENI just have to put sane names16:06
rharperwhich name field does resolvconf look at ?16:06
smoserresolvconf_name=eth0_addr116:06
rharperIFACe16:06
rharperinteresting16:06
smoserright. currently16:06
smoserlook at /etc/network/if-up.d/000resolvconf16:07
smoserits fairly obvious16:07
smoserif we put somnething in there, then it gets into the environment at IF_<keyname>=<value>16:07
utlemmingthat's a lot cleaner16:08
rharperright, but this is a change to the resolvconf ifupdown hooks and requires coordination;16:09
smoseryes.16:09
smoserand SRU and such.16:09
rharperwe;ll need to define the IF key we want, document and push to upstream resolvconf16:09
smoserbut ends in something that can at least be made reliable16:09
smoserwhile what currently have is not16:09
rharperI think so, yes16:09
utlemmingdo we?16:09
utlemmingadd /etc/network/if-up.d/000cloudinit16:10
utlemmingand provide it in the cloud-init sru16:10
smosernah. we have to update resolvconf16:10
utlemmingwhich exports the name of the IFACE16:10
smoseryou dont have to export16:10
smoserifupdown does that already16:10
smoserany "option" in a given stanza16:10
smosergets exported as16:11
utlemmingwell, change the IFACE to the key that we want to use16:11
rharperhow will we handle upgrades for eni's already rendered without the key ?16:11
smoser IF_<option> with value VALUE16:11
smoserrharper, well, fixing it backwards is one thing. that isn't entirely required16:12
smoser(fwiw, this is a regression of us dropping the eth0:116:12
smoserin eni)16:12
rharperyes16:12
smoserwhich we did to fix anohter bug :)16:13
smoserbug 165794016:13
smosercommit 2de1c247e285cce0b25ab70abdc56ccd41019c2716:13
rharperindeed, ipv6 bonded bridged vlans and mixed v4 v6 are tons of fun16:14
smoseri never ceases to amaze me how unstable all of ENI is16:15
rharperheh, well, eni itself is stable, the ifupdown parsing/hooks are another story16:15
smoserwell, attempting to actually create non-trivial networking16:17
smosers/create/utilize/16:17
rharperbubblegum and string16:18
paulmeygood morning17:03
paulmeyI'm improving the udev rules in the Azure Linux agent (https://github.com/Azure/WALinuxAgent/pull/624)17:03
paulmeycloud-init has a similar set of udev rules that link the disks under /dev/disks/cloud/azure-*17:04
paulmeyI'm happy to update that, but I've gotten some feedback that it might be nice to 'unify' both so that the disks are in the same path, no matter if the distro uses only the agent or only cloud-init or a combination of both17:06
paulmeyIt would make Azure Linux documentation a lot more straightforward with regards to this point17:07
paulmeyThoughts?17:07
smoserrharper, utlemming https://code.launchpad.net/~smoser/ubuntu/+source/resolvconf/+git/resolvconf/+merge/32120317:15
smoserthats what i thikn that would look like17:15
smoseri dont like 'prog'17:15
smoserbut that is what resolvconf calls that.17:15
smoserpaulmey, i'm not sure what you're asking.17:19
utlemmingsmoser: that sane to me17:30
rharpersmoser: resolvconf changes look good17:37
smoseri NACK'd my own review17:40
smoser:)17:40
smosershould rename those things and document17:40
smoseri'd like someone on foundations to have a think also17:40
smoserutlemming, i think most of those "dangerous" comments in the debian wiki are probably garbage17:41
smoseri suspect its no less dangerous (== broken) than any other ifupdown method17:41
utlemmingprobably17:41
utlemmingI'll remove 'em17:42
rharperI think the most user-facing issue is muscle memory /docs on use of ifconfig;  however, the brave new world of iproute2 eventually needs to be embraced17:44
utlemmingsmoser: I'll get a MP to you this afternoon to implement this in CI later today17:55
paulmeysmoser, sorry about that17:58
paulmeycurrently, cloud-init create udev links /dev/disk/cloud/azure-*17:58
paulmeythe Azure linux agent creates links /dev/disk/azure/*17:59
paulmeycurrently, both create only links for the root and ephemeral resource disk17:59
paulmeymy PR for the agent adds data disks (extra attached disks)18:00
paulmeywith links like /dev/disk/azure/datadisks/lun9-part118:00
paulmey(Azure only lets you specify the LUN on which a disk is attached, hence the usefulness of these links)18:01
paulmeyThe question I'm asking is whether we would like the azure agent and cloud-init to create links in the same location18:02
paulmeyso that we can have simple documentation of where to easily identify data disks18:02
smoserrharper, https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/167518518:40
rharpery18:40
smoserwould it be acceptable to just do : if no 'apt', then just do nothing ?18:40
rharpernot by default, no ?18:41
rharpermy reading of the code was that apt_configure renders the template by default...18:41
smoserrharper, renders the  apt template18:41
smoserright?18:41
smoserapt sources.list18:41
smoserah.18:41
smoseri meant18:41
smoserif not util.which('apt'):18:42
rharperoh18:42
smoser   LOG.debug("Nothing to do")18:42
smoser    return True18:42
rharperyeah, that works too, as long as you do it before calling lsb_release18:42
rharpertoo18:42
smoseri cant think of a reason that you'd want cloud-init to configure apt if you didnt have apt in its path.18:43
rharperit kinda feels like the distro object could check that (apt available) and drop any of the apt/dpkg related config stages18:43
rharpersmoser: agreed18:43
smoserdebconf selections18:43
smoseris there too18:43
rharperutil.which('dpkg')18:43
rharperwould be helpful filter too18:43
smoseri'll see what i can do around that.18:46
rharpercool, thanks18:46
smoserrharper, dpkg is installed in snappy. as well as debconf-set-selections19:12
rharperhrm19:12
smoserso.. something else.19:12
rharperuc16 has dpkg ?19:12
rharperI wonder why when they purge the database19:13
rharperdebconf-set-selections also seems like an oversight if they purge the db19:13
rharper=(19:13
rharperyou can test for /var/lib/dpkg19:14
rharperraharper@uc16-c2:~$ test -e /var/lib/dpkg; echo $?19:14
rharper119:14
rharperbut that's not nice19:14
rharperand apt is present19:14
rharperbut it's warning wrapper19:14
rharperraharper@uc16-c2:~$ which apt19:15
rharper/usr/local/bin/apt19:15
rharperraharper@uc16-c2:~$ cat `which apt`19:15
rharper#!/bin/sh19:15
rharperecho "Ubuntu Core does not use apt-get, see 'snap --help'!"19:15
smoserhm..19:17
smoseri just ran a lxc image19:18
smoserlxc launch images:ubuntu-core/16 uc16-119:18
smoser$ lxc exec uc16-1 -- which apt-get || echo none19:18
smosernone19:18
rharperhrm19:28
rharperthis is in my UC16 image i built but I'm not adding those in19:28
rharperI;ll boot the release image on cdimage next19:28
rharperhttp://cdimage.ubuntu.com/ubuntu-core/16/stable/ubuntu-core-16-amd64.img.xz19:29
rharpersmoser: you can 'snap download --stable core'; sudo unsquashfs core*.snap; ls -al squash-rootfs/usr/local/bin/apt19:32
rharperI'm not sure what snap is in your lxc though19:32
smoserhttp://paste.ubuntu.com/24269663/19:34
smoserwhat pain19:34
rharperwhy is that different?19:52
rharperthe latest "stable" has core version 16-2, rev 1441; which is the same as what's in 'snap download --stable core'19:55
rharpersmoser: I think you want images:ubuntu-core/16/amd6419:57
smoserrharper, what did i get then ?20:02
rharpernot sure, what's the csum on the lxc image ?20:02
rharperI'm still downloading that one at 161kb/s20:03
rharperimages remote says it should be c4962bd2e706, and dated 20170318_19:0120:03
rharperI forget what lxd magic they do20:03
rharperbut clearly what you loaded is really old20:04
powersjwhen I tried the lxd core16 images last Friday they seemed very old as well, even using -edge and -beta20:06
smoser:-(20:13
rharperI asked in #lxd20:13
rharperand thanks to my vpn, I'm getting the uk mirror20:13
smoserah. i just asked in #lxc-dev20:14
smoserwell that stinnks.20:15
* rharper hopes it finishes before I have to unplug and relocate20:15
smoseri just assumed that would be a very useful way to use it.20:15
rharperRetrieving image: 88% (147.33kB/s)20:15
rharpertry snap refresh core20:16
rharperit should download the latest core snap20:16
rharperthen you can reboot20:16
rharperfor profit20:16
smoserdownloading at 10+M/s20:16
smoser:)20:16
rharperrub it in20:17
rharpervpn needs more speed20:17
smoserhttp://paste.ubuntu.com/24269896/20:17
rharpery20:17
rharpernow check apt20:17
smoseri have the button clicked that says "use vpn only for vpn traffic"20:17
rharperI do to20:17
smoserhm.20:18
rharperbut the dns hijack20:18
rharperis how they check20:18
smoserstill have dpkg20:18
smoserdont kjnow why20:18
smoseroh.20:18
smoserthen i get by due to a proxy20:18
smoseri have lxd set to proxy20:18
rharperbbiab20:19
smoseri'll try to check in later, but i'm probably afk when you do20:20
smoserwhile i think it does make sense to not use apt if no apt-get or apt installed, i dont know that that iwll work. i think just disable that thingon is-snappy20:30
rharpersmoser: so, looks like we'll need to deal with the older release w.r.t apt check20:35
rharpersmoser: /var/lib/dpkg is missing in the release and the updated core snap20:36
smoserwell, rpbably not20:38
smoseras cloud-init will never be installed into an old version20:38
rharpersmoser: it may be reasonable to just allow it to be disabled via config; http://paste.ubuntu.com/24269987/20:38
rharpercloud-init is most definitly installed20:38
rharperjust disabled by default (/etc/cloud/cloud-init.disabled)20:38
rharpersomeone could possible not want to use that config module and not want to modify the stage module list in /etc/cloud/cloud.cfg20:39
rharperI've also thought about implementing a config stage filter so one could say dont-run-the-following-modules: apt-pipieline, apt-configure, etc20:39
smoserright.20:40
smoseri dont want to do disable via config without a generic20:40
smoserhttps://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/32121820:40
smoseri have to run now. but that should work, right?20:40
smoser(note that apply_debconf_selections is inert by default)20:41
rharperthat's foing to fail20:41
rharperpkgs_installed = util.get_installed_packages(target)20:41
rharperthat's in apply_debconf_selections20:41
rharperwe've no apt20:41
smoserit only does that if you gave it ifo20:41
smoser    selsets = cfg.get('debconf_selections')20:42
smoser    if not selsets:20:42
smoser        LOG.debug("debconf_selections was not set in config")20:42
smoser        return20:42
smoseri've got to go.20:42
smoserlater.20:42
=== rangerpb is now known as rangerpbzzzz

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