meenacjp256: I'm working on fixing get_interfaces() and get_interfaces_by_mac() for FreeBSD, and if I understand you correctly, we don't need the blacklist drivers hacks for BSD10:46
meenacurrently using defaultdict from collections, like holmanb recommended. Not sure it's the way to go…11:12
holmanbmeena: I'm always looking for improvements :)13:30
holmanbHave something else in mind?13:30
* holmanb tries to remember the context of what he suggested13:31
cjp256meena: correct, we wouldn't need blacklist_drivers blasted everywhere, but would we need get_interfaces() to provide driver name, and I'd suggest deprecating/removing _by_mac() variants where possible to avoid duplicate mac problems in the issue13:37
meenaholmanb, cjp256 https://github.com/canonical/cloud-init/compare/main...igalic:cloud-init:bsd/fix_duplicate_macs?expand=113:38
meenaif MAC addresses aren't unique, are names? 13:45
holmanbI remember a conversation related to this topic. Still not remembering the specifics related to this, however 13:46
holmanbShower/food now, will reload memories from irc after and get back to you13:46
klnikitahello there, I'm a network guys from scaleway. caribou told me that they were some questions regarding our network setup, the /32 with the on link gw. If the topic is still open and you have some questions feel free to ask :)13:48
meenaklnikita: We, or rather, holmanb, have now discovered other cloud providers who have the same sort of setup 13:56
klnikitayeah, having the /32 used as the primary IP of a VM may seems unusual but it facilitate many things regarding VM live migration, network underlay setup and some other subtilities14:01
cjp256holmanb: fwiu blacklist_drivers is only used for Azure to prevent cloudinit from trying to configure the mlx[45]  interfaces.   This list is set by the Azure datasource and it later gets reset when the distro object is cleared, so it's not working everywhere as intended.  (see PR #1853 workaround).  And the assumption that all interfaces have unique macs is not 100% correct which is leading to bugs in _by_mac() usage.  FreeBSD does not 14:02
cjp256currently work at all with the mlx/mce interfaces because there is no queried driver name to account for and alphabetically the mce0 interface is taking precedence over hn0 when it builds the dictionary by mac.  We need a cross-platform way of get the interface list with driver name (see PR #1672).14:02
meenacjp256: i'm really confused by the fact that the current implementation of get_interfaces() doesn't return anything… here's my development version: https://gist.github.com/1beba16360db0d9eb6e60aa29739adfe14:06
meenacjp256: btw, as you can see, on BSD, the output is *not* alphabetic… the order is already as indexed by the kernel14:09
cjp256meena: i think net.get_interfaces() is very Linux-specific and unused in the bsd paths?14:10
meenacjp256: net.get_interfaces() dispatches to other functions. The plan (https://github.com/canonical/cloud-init/blob/main/WIP-ONGOING-REFACTORIZATION.rst ) is to move those functions from net into distro.14:11
cjp256meena: can you plumb in the text from https://github.com/canonical/cloud-init/pull/1672#discussion_r1047795909 and see what would happen?14:12
-ubottu:#cloud-init- Pull 1672 in canonical/cloud-init "sources/azure: fix device driver matching for net config" [Closed]14:12
meenacjp256: https://gist.github.com/4e3c2d8fbb1a6aac7e16f1caf99b605e14:15
cjp256awesome, thanks :D14:17
meenaI wonder what the output of __repr__() on Ifstate could look like to make it useful…14:18
cjp256so if we're trying to apply the equivalent of blacklist_drivers on top of this, is there a way to query for the driver name of an interface? or would we end up relying on the device naming scheme? that is mlx* vs. mce*?14:18
meenacjp256: netbsd and openbsd: Yes. FreeBSD… ooooooooof: https://github.com/canonical/cloud-init/compare/main...igalic:cloud-init:bsd/device_drivers14:19
meenaFreeBSD allows renaming nics but gives us no easy way to get back at the original name…14:20
cjp256so in my example above, that would return "mce" as the driver name?14:22
meenacjp256: yes14:23
meenai probably could also get a table to normalize the names14:23
meenaevery driver in BSD is documented14:24
meenahttps://man.freebsd.org/mce(4) is mlx5en14:25
cjp256I think that'd be fine if the mapping is well understood.  I don't see the name for mlx4 in the docs so I'm gonna spin up a VM and see what it is out of curiosity14:31
meenaconfusingly,  https://man.freebsd.org/mlx(4) is something different. Mylex DAC-family RAID driver14:32
cjp256https://man.bsd.lv/FreeBSD-13.0/man4/mlx4en.4 :D14:34
meenacjp256: that's so much nicer rendered… when will FreeBSD adopt that??14:36
meenawhen will someone at FreeBSD have some time to migrate to that thing14:36
cjp256looks like it came up as mlxen*14:37
meenacjp256: the mce(4) man page tells you exactly what the nic will come up with as14:38
cjp256yeah that was nice14:39
minimalklnikita: I guess we were surprised by the /32 PtP use of the interface. Your metadata server is providing a version1 network-config right? I was wondering how it flags the interface as PtP using that15:06
caribouminimal: that's my upcoming tasks : make sure that the mods work for all rendering otherwise I'll need another solution16:03
minimalI've noticed a couple of other providers using /32 addresses in some situation, however for example OVH Bare Metal Cloud are using Openstack ConfigDrive to provide the network config (which is not v1 or v2 format, it's JSON), and Hetzner I'm not sure if they use cloud-init at all for the situations where they provide static /32 (i.e. maybe its only for bare metal, not sure)16:06
meenaminimal: hetzner solves this by using DHCP… or at least falling back to DHCP16:33
meenait was only when I decided i need 1 less daemon running, that i was trying to figure out how to get that peer-to-peer config configured on FreeBSD… like, they don't even document it for FreeBSD: https://docs.hetzner.com/cloud/servers/static-configuration — i had to figure it out on my own:16:35
minimalmeena: with DHCP is the default route handled ok?16:53
=== janitha70 is now known as janitha7
meenaminimal: yupp17:23
meenaminimal: i don't know if Hetzner uses cloud-init for hardware17:26
klnikitathe correct term for this kind of connectivity is "directly connected gateway", pointopoint is something different17:54
minimalok, I meant that its effectively using ethernet as a non-broadcast network, which is typically what "pointopoint" signifies, sort of like an unnumbered PPP link17:57
meenaklnikita: you tell that the Debian folks. i think they're the ones who started it17:57
klnikitayep sorry, I didnt saw that my irc was not on the last message actually, I was thinking that last chan msg was still about adding it in ifupdown :)17:59
meenacjp256: passing this on: <CrtxReavr> I don't have either of those devices.  Maybe you could share the output of 'grep mlx /var/run/dmesg.boot'17:59
klnikitaif I'm not mistaken it should work pretty out of the box with ifupdown https://salsa.debian.org/debian/ifupdown/-/blob/master/inet.defn#L43 but I have not tested it 18:04
klnikitaand, it wont work on ifupdown + kfreebsd18:05
minimaland probably not with ifupdown-ng on Alpine18:07
klnikitayep it won't work, https://github.com/ifupdown-ng/ifupdown-ng/blob/main/executor-scripts/linux/static#L36 is missing the "onlink" option at the end 18:18
minimalI think the situation is (a) where addresses and routes are allocated via DHCP then its down to the particular DHCP client as to what happens, or (b) where the provider's metadata server or ConfigDrive/NoCloud files provide network config via non-DHCP then (b1) how does the provided v1/v2 network config indicate a "onlink" route to cloud-init, and (b2) what then does cloud-init put into each of sysconfig/eni/etc files to signify such an "onlink" route 18:19
minimalsuch that the OS'es handler for their own distro-specific config file know to deal appropriately with it18:19
minimalklnikita: yupe, had just checked that myself - I think adding "onlink" to the "ip route add default" statement would be "bad" as "onlink" should only be used when specified/required18:20
klnikitayep agreed, without the onlink you got an "Error: Nexthop has invalid gateway." error which protect about most misconfiguration18:22
klnikitaI guess the onlink just disable the check18:23
esvhello folks, scripts located in the per-instance section or subdirectories should be executed only once upon machine creation, right?21:31
anankeesv: or when said OS is booted on another instance (which varies with actual implementation). but yes21:43
holmanbmeena: forgot to circle back to you this morning, sorry about that22:42
holmanbmeena: I think it was aciba who was talking to you about using defaultdict (explains my brain-gap)22:43
meenaholmanb: ah,22:43
holmanbmeena: https://irclogs.ubuntu.com/2022/11/16/%23cloud-init.txt22:43
meenai'll test with defaultdict and see where it goes22:43
holmanbsounds good22:43
meenai need to figure out how to access stuff in it first.22:46
meenaactually, maybe a list of tuples might be better, tho not much easier for easy access either…22:47
meenanames are unique, always, right?22:47
holmanb"always" begets more research before giving a confident answer22:48
holmanbI'll say: I've seen multiple instances of systems with duplicate macs, multiple different setups and scenarios. I don't _think_ I've ever seen a system with duplicate interface names.22:49
* holmanb starts wondering about linux namespaces now22:50
holmanbmy gut feeling is that multiple interfaces could be named the same (after an interface rename) in different network namespaces, but I'd have to dig a bit to confirm that and I haven't touched linux namespaces in a couple of years22:53
holmanbklnikita: hello and welcome :)22:53
holmanbklnikita: thanks for dropping by, catching up on conversation now - I'll possibly have a question or three for you once I do22:57
cjp256meena: not sure whatcha looking for, but here a dmesg for both mlx4 and mlx523:23
holmanbcjp256: ack, thanks for the refresh / context - will you reopen 1672 in a new PR? It doesn't look like we have the power to do that for whatever reason.23:24
cjp256holmanb: np, I'll reopen it, thanks!23:26
-ubottu:#cloud-init- Pull 1914 in canonical/cloud-init "sources/azure: fix device driver matching for net config" [Open]23:28
holmanbcjp256: Nice, thanks!23:28
holmanbcaribou: "make sure that the mods work for all rendering" -> By this do you mean that you're interested in contributing to cloud-init to help with support on this?23:28
holmanbrather - regardless of whether that's what you meant, is that something you're interested in doing?23:34

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