/srv/irclogs.ubuntu.com/2020/10/20/#cloud-init.txt

smosercan we please get the comment linter back.02:38
smosers/comment/commit message/02:38
otuboI want to set IPV6_AUTOCONF=NO on a link local ipv6 interface on a instance. Do I need to add a special support for it on the code, or just set it on the cloud-init configuration file? I'm not really sure after reading the code.11:18
minimalotubo: on a related vein I've wondered how to configure privext (IPv6 Privacy Extensions) on an interface11:20
minimalFolks, I believe there's an issue with MAC address handling for both v1 and v2 network config files - but I'm confused how then any of the testcases that specify MAC addresses then pass. Basically when I specify a MAC address if I don't quote the value it gets "mangled" (as seen in debug output) whereas when quoted it works as expected.11:24
minimalotubo: in tests/unittests/test_net.py there's a network config v1 example that specifies the following for a bridge (I assume same would work for a physical device):11:40
minimal                  ipv6_conf:11:40
minimal                      autoconf: 111:40
minimal                      disable_ipv6: 111:40
minimal                      use_tempaddr: 111:40
minimal                      forwarding: 111:40
vijayendraotubo, ping. This is vijayendra11:51
otubovijayendra: pong11:54
otubominimal: nice catch. Perhaps vijayendra could give this a try on his tests.11:55
minimalotubo: Looking further I don't see any sign of actual code using these settings...11:56
vijayendraotubo, minimal Probably I missed some info here. Joined late. Let me check in history11:56
otuboI have a thousand of meeting starting now, I'll probably join the office hours to ask this to maintainers11:57
minimalOdd_Bloke: any thoughts on the MAC address issue?11:58
Odd_Blokesmoser: Not particularly easily on GitHub, unfortunately, no: there's no structured place to put a commit message except at merge time.  We have talked about using https://bors.tech/ which does have support for using the first portion of the PR description as the commit message (because it handles the squashing) but I don't know if it has commit message linting support.13:09
Odd_BlokeSo I think we'd need to modify the linter to be able to parse out the commit message, and then run it as a GH action?  (Or maybe a Travis job: as our project is public we can _probably_ just hit GitHub's API from over there instead.)13:11
Odd_Blokeminimal: Testing locally, it looks like MAC addresses that aren't all-digits are interpreted as strings as I would expect: https://paste.ubuntu.com/p/PKTvCJggvh/13:11
Odd_Bloke(Apologies if these aren't in YAML and I've completely missed the point; my pot of coffee is still brewing. ;)13:12
Odd_BlokeSo if you're referencing unit tests, most of them will be passing around Python dicts, which don't have this issue (because they don't pass through YAML parsing to get mangled).13:14
minimalOdd_Bloke: what I'm seeing in the logs is the following:13:50
minimalnetworking.py[DEBUG]: net: waiting for expected net devices: {41135085296}13:50
minimalwhere "41135085296" is mangled from 52:54:00:12:34:5613:50
minimalI'm using NoCloud and have tested both v1 and v2 network config YAML files with the same behaviour13:51
minimalso I'd assumed that MAC addresses should always be quoted and was going to raise a PR to update docs and testcases accordingly - but some testcases fail it I quote their MAC addresses13:54
Odd_BlokeMAC addresses must always be strings; `52:54:00:12:34:56` is, I think, interpreted as a timestamp in YAML (41135085296 seconds since 1970) whereas `"52:54:00:12:34:56"` is a string.13:59
minimaldue to this risk of misintepretation I'd expect the docs to mandate quotes around MAC addresses to avoid the issue completely14:00
Odd_BlokeYeah, agreed; probably worth a `.. note::` or `.. warning::` in the network docs.14:02
minimalOdd_Bloke: the thing is I'd changed the docs in a PR as well as any YAML in testcases that specified MACs to quote then but multiple testcases then failed.14:03
Odd_BlokeAha, right, I see the PR now, apologies.  Let me take a look.14:03
minimalah, that PR doesn't have the MAC changes, I pulled it from that PR when I spotted the test failures14:04
Odd_BlokeOh, or maybe you've pulled that chang... yep.14:04
Odd_BlokeIf you could pastebin the diff of that commit, I can see if I can see anything. :)14:04
minimalthere were a lot of failures in tests/unittests/test_net.py as the expected results (the quoted MACs) didn't match the actual results (non-quoted MACs)14:05
Odd_Blokeminimal: Ah yeah, it looks like some of the tests are expecting the input YAML to successfully roundtrip back out to YAML.14:11
Odd_BlokeBut because the quotes aren't _necessary_ for most MAC addresses, they aren't included in the dumped YAML.14:11
Odd_BlokeAnd so our input quotes disappear and we have a mismatch.14:11
minimalexactly14:13
minimalso to use a horrible phrase, "how do we square this circle"? ;-)14:13
amansi26smoser:Hi smoser, I would to like to thanks for constantly reviewing my code and recommend changes to my PR https://github.com/canonical/cloud-init/pull/584 . I think we came a long way with it. I addressed all the comments on PR  . It will be great if you can review the changes once you get some time. So that any new changes recommended. I will go and addressed them quickly. Thanks14:13
Odd_Blokeminimal: So I'm not particularly concerned about those test failures: they aren't indicating that you've actually broken anything, they're just somewhat brittle tests.  So I would suggest that in a first pass, we could just not quote the specific MAC addresses in `test_net.py` that cause the failures.14:17
Odd_BlokeIn terms of fixing those tests, the problem is that they expect the YAML input to be "normalised" as it were, and your change means that the input is no longer normalised.  We could address that by round-tripping the input through a dump/load before using it as the basis of comparison.14:19
minimalOdd_Bloke: hmm, ok I can have another go at figuring out which ones can safely be quoted. Do you agree the docs should be updated to effectively mandate quotes around MACs? That would avoid this sort of confusion. Think of people using the likes of Ansible and Terraform to create network config files where their code shouldn't have to have the smarts to know when to add or not add quotes14:19
Odd_BlokeIf they're using a (spec-compliant) YAML library to dump some sort of datastructure, they should be fine: this isn't a bug in our YAML handling code, it's a weird corner of the spec.  But, yeah, there are plenty of cases where this could cause confusion/problems, so I agree the docs should be updated to help people avoid it.14:22
minimalOdd_Bloke: Ok I'll put something together in a PR for this. You mentioned you'd noticed PR 618 which I raised for the users and power_state quoting.14:24
minimalyou'll be seeing more PRs from me in the near future as I've fixed "wakeonlan" to actually work for ENI and I've spotted an issue with static routes in ENI which I'm investigating as well.14:24
Odd_BlokeGreat!14:39
minimalOdd_Bloke: I think as I'm using cloud-init in non-typical ways (mainly bootstrapping physical RPIs and x86_86 machines) that's why I'm spotting various little issues14:41
Odd_Blokeminimal: We certainly appreciate you feeding back what you're finding to us, both in terms of bugs filed and code. :)14:42
meenacool14:48
Odd_Blokeotubo: #586 landed. :)16:05
otuboOdd_Bloke: thanks a lot!16:06
Odd_BlokeThanks for the PR!16:07
* otubo waiting for office hours16:16
otuboOdd_Bloke: do we have office hours today?16:19
otuboblackboxsw: ^ :-)16:20
Odd_Blokeotubo: I don't think we're going to have a Discourse post up today, but you can consider office hours officially open. :)16:24
otuboOdd_Bloke: I just have two quick questions :-)16:24
otuboOdd_Bloke: I want to set IPV6_AUTOCONF=NO on a link local ipv6 interface on a instance. Do I need to add a special support for it on the code, or just set it on the cloud-init configuration16:25
otubofile? I'm not really sure after reading the code.16:25
otuboOdd_Bloke: and here I'm talking about RHEL/Fedora/CentOS family with NetworkManager :-)16:26
Odd_Blokeotubo: What does your current configuration look like?16:32
otuboOdd_Bloke: I don't have one yet. I was going to start adding support for it, but reading the code I didn't know for sure I needed.16:34
otuboOdd_Bloke: earlier today minimal pointed to tests/unittests/test_net.py which specifies tests for bridges:16:35
otuboipv6_conf:16:36
otubo    autoconf: 116:36
otubo    disable_ipv6: 116:36
otubo    use_tempaddr: 116:36
otubo    forwarding: 116:36
otubo(ah, sorry for the paste)16:36
otuboWanted to confirm I can use this configurtion for phyisical interfaces too.16:36
Odd_Blokeotubo: I'm looking, having to familiarise myself with a lot of this code.16:42
Odd_Blokeotubo: I can't find anything in the code that reads those `ipv[46]_conf` keys, and the tests still pass if I remove them: I infer that they aren't used, but I can't be sure.16:49
otuboOdd_Bloke: ok, looks like I'm gonna have some fun tomorrow debugging this :-)16:51
otuboSo I'll probably need to add some support for it.16:52
Odd_BlokeAs for setting IPV6_AUTOCONF=no, it looks to me like it's unconditionally set to True for `ipv6_dhcpv6-stateless` and `ipc6_slaac`: https://github.com/canonical/cloud-init/blob/master/cloudinit/net/sysconfig.py#L411 and https://github.com/canonical/cloud-init/blob/master/cloudinit/net/sysconfig.py#L42816:54
Odd_Blokeotubo: Yeah, it looks that way to me, at least.16:54
Odd_Bloke(If rharper is around, he may be able to help out a bit more.)16:54
otuboOdd_Bloke: would you think it's reasonable to override the default if user set "ipv6_autoconf: no" on configuration file?16:56
rharperOdd_Bloke: sorta;  otubo I think it would be good to understand  what IPV6_AUTOCONF means for sysconfig systems, and what NetworkManager does it it;  it's just not clear to me documentation wise;  I don't have a strong opinion on this.16:59
rharperotubo:  I think there is some common definition w.r.t autoconf between eni and sysconfig;  but I think we should collect what happens on distros to understand changes to the current default.17:01
otuborharper: makes sense to me.17:01
otuborharper: I don't have a particular vast background on this topic to argue that now. But I might have tomorrow after some research. I'll file a bug on Launchpad so we can discuss.17:02
rharperhttps://bugs.launchpad.net/cloud-init/+bug/180601417:04
ubot5Ubuntu bug 1806014 in cloud-init "[Centos] IPV6_AUTOCONF=no when using dhcp6" [Medium,Fix released]17:04
otubowell that was quick17:05
otuborharper: before reading it, just wanted to exaplain a little bit on the background of my issue: When an instance is deployed under IBM PowerVS, it needs an ipv6 link local to communicate with the RMC module on the hypervisor.17:06
otuborharper: apparently this interface fluctuates in stability, and it's tested that using IPV6_AUTOCONF=NO solves the problem17:08
otuborharper: I'm not the real expert here, probably vijayendra can give more details on this.17:09
rharperwell, ideally we'd root cause the problem w.r.t the variance;  vijayendra already talked with NM folks and they said you didn't tell us not to do AUTOCONF stuff and so nm is bringin the interface up and down; IIRC17:10
rharper<vijayendra> rharper, I did get in touch with nm developer but he doesn't seems to be in agreement with it. below is his explanation17:11
rharper<vijayendra> rharper, NetworkMAnager fails to get an IPv6 address and it fails the activation.17:11
rharper<vijayendra> Also, the logfile is filled with warnings and messages of the device repeatedly activating and deactivating.17:11
rharper<vijayendra> There is a cycle of NetworkManager trying to autoactivate the profile, and failing and retrying. Of course,17:11
rharper<vijayendra> the IP address thereby gets added and removed again. Fix either your configuration or your network (depending on your circumstances).17:12
otuboInteresting.17:13
otuboYeah, I think we need to work through this a little better, because now I'm wondering why exactly the interface is behaving like that and why it's not acquiring ip.17:14
rharperfor link local, ther'es no acquiring; you just have it ; link local on ivp6 is based on the device mac17:15
otuborharper: for a reference, just found the BZ vijayendra mentioned https://bugzilla.redhat.com/show_bug.cgi?id=188856917:26
ubot5Error: Error getting bugzilla.redhat.com bug #1888569: NotPermitted17:26
vijayendrarharper, otubo My understanding on this is if there is no entry about IPV6_AUTOCONF, it defaults to yes and this looks for ipv6 router and when no router this ipv6 fluctuation behaviour is found17:39
vijayendraso here in case no router, we need to explicitly say IPV6_AUTOCONF=no which sets ipv6.method to either manual or link-local otherwise with AUTOCONF yes this seems to "auto" which looks for ipv6 router17:41
vijayendrabut going through the cloudinig sysconfig.py code, there isn't way to do so for static configuration17:42
otubovijayendra: did you check on this? https://bugs.launchpad.net/cloud-init/+bug/180601417:48
ubot5Ubuntu bug 1806014 in cloud-init "[Centos] IPV6_AUTOCONF=no when using dhcp6" [Medium,Fix released]17:48
otubo"When instructing cloud-init to use `type: dhcp6` for the subnet of a physical network interface, the end-result is that `/etc/sysconfig/network` contains `IPV6_AUTOCONF=no`."17:49
otubovijayendra: ^^^17:49
vijayendraotubo, sorry I missed to check that, checking now17:49
meenai made new bug: https://bugs.launchpad.net/cloud-init/+bug/190075317:58
ubot5Ubuntu bug 1900753 in cloud-init "fix regression: remove dependency on dmidecode" [Undecided,New]17:58
vijayendraotubo, 1806014 is pretty fast. Thanks18:04
otubovijayendra: does it solve your problem?18:05
vijayendraotubo, will have test with this new change. will update,18:06
otubovijayendra: nice, thanks! Need to leave now18:06
otuborharper: thanks for the pointer on that. Hopefully we won't have to touch cloud-init to make that work.18:06
vijayendraotubo, thanks18:08
vijayendraotubo,  here looks like we are doing static configuration, for static configuration, this still may not work right?18:35
rharperotubo: vijayendra:   yeah; I think there are two points here:  1) there currently isn't a way to disable Router Advertisements for ipv6 static only via network-config   2)  why does NM bounce interface configuration/ip if one does not disable RA?    ;  (1) is a reasonable bug for cloud-init;  the gap exists for openstack and network-config v1;  netplan allows control over RA   (2) is a separate issue with NM;  as I don't think RA19:04
rharpershould be related to a changing IP; expecially if your environment does not have any ipv6 routers doing advertisements19:04

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