coreos / fedora-coreos-tracker

Issue tracker for Fedora CoreOS
https://fedoraproject.org/coreos/
260 stars 60 forks source link

Have the coreos-installer '--copy-network' option also copy generated udev ifname rules #1684

Open fmhirtz opened 4 months ago

fmhirtz commented 4 months ago

Describe the enhancement

In the OCP 4.14 tree, we now will try propagage the ifname udev rules in coreos-teardown-initramfs.sh:

https://github.com/coreos/fedora-coreos-config/pull/2411/commits/84bc2306fab0a637b715b4fce6b0f4e816a6e39b

...but, presently the 'coreos-installer' '--copy-network' feature does not copy these udev rules to the root disk. I would like to request that we change that, please.

Without it, we can't set up network interface names based on MAC addresses. That is immensely useful when we're trying to build bonds and the like with specific devices in our PXE (or other) installs.

System details

Additional information

Hit this when looking at options to set up bonding on an SNO install (which requires OVN-K). Was trying to set up the following:

... ifname=nic1:00:50:56:b3:5d:e1 ifname=nic2:00:50:56:b3:9f:1d bond=bond0:nic1,nic2:mode=active-backup,miimon=1000 ip=bond0:dhcp ...

...as a test, and it builds a broken 'cluster' since we lose the name mappings as we reboot into the node's initial build.

jlebon commented 4 months ago

I think this makes sense to me.

The confusing thing is that ifname is one of the kargs we do forward when doing an automated install (via coreos.inst. kargs). The idea though is that when driving coreos-installer more directly, those kargs would now be converted to NM keyfiles that you could copy into the target system via --copy-network. That way you only have to specify the kargs once.

So I think actually what we should probably do is make sure that --copy-network copies any other "output" that comes from that list of network kargs (of which the udev rule is one of them) so that we get UX parity.

jlebon commented 2 months ago

We discussed this in today's community meeting:

  • AGREED: we recognize a minor UX gap but currently don't feel like it's enough to warrant changing anything given that our networking story is quite complex already. we will keep an eye on this and reconsider if more information comes to light. (@jlebon:fedora.im, 17:07:47)

One approach in the future might be a new --copy-network-kargs switch which would forward the network-related kargs to the installed system. We currently have this logic living in the service unit. So it'd be about lowering that down into coreos-installer proper and have the service use --copy-network-kargs itself.