Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ncm-network: nmstate, renaming devices and ifcfg files #1674

Open
stdweird opened this issue Mar 18, 2024 · 8 comments
Open

ncm-network: nmstate, renaming devices and ifcfg files #1674

stdweird opened this issue Mar 18, 2024 · 8 comments

Comments

@stdweird
Copy link
Member

in at least el9.2, there is a /usr/lib/udev/rules.d/60-net.rules which basically renames all it can using /lib/udev/rename_device.
however, that tool still (and only?) supports ifcfg files. so we have another side effect of switching to nmstate: we loose some control of naming devices.

question is, what do we do with this? ignore, generate the ifcfg files (pins mac address to device name), or generate udev rules?

@stdweird
Copy link
Member Author

initscripts-rename-device is the rpm that provides the 60-net rule and also the tool. it required by initscripts itself.

@jouvin
Copy link
Contributor

jouvin commented Mar 19, 2024

It is weird that initscripts are deprecated and not installed by default but that a new component provided by RH requires them...

@stdweird
Copy link
Member Author

@jouvin it's not required by eg nmstate or networkmanager, i just wanted to point out that anyone relying on these renaming rules will need a replacement if we fully drop initscripts

@stdweird
Copy link
Member Author

in my hunt to find what is renming our ibX devices, udev debug log pointed to /usr/lib/systemd/network/99-default.link.
these are files defined by https://www.freedesktop.org/software/systemd/man/latest/systemd.link.html, and look prime candidates to have them generated by nmstate component to set eg ethtool params.
these can also be use to pin a device name to a mac address

@stdweird
Copy link
Member Author

yep, as expected. when specifiying interface names incl the mac address, kickstart generates eg /etc/systemd/network/10-anaconda-ifname-em1.link

# cat /etc/systemd/network/10-anaconda-ifname-em1.link 
# Generated by Anaconda based on ifname= installer boot option.
[Match]
MACAddress=aa:bb:cc:dd:ee:ff

[Link]
Name=em1

to integrate this in nmstate, the more complicated procedure of actual renaming might be problematic.

@jouvin
Copy link
Contributor

jouvin commented Mar 19, 2024

Not sure why/what you want to integrate to nmstate. This part is already done, nmstate must just refer to the new names. At least it seems to work for us (apart from #1671 which for me is unrelated). May be I missed something?

@aka7
Copy link
Contributor

aka7 commented Mar 19, 2024

we actually create udev rules at KS to get consistent naming so by the ncm-network runs in ks-post-reboot, all interfaces are correctly named with right Mac address. can share snippet we add in ks.

@stdweird
Copy link
Member Author

well, if the ifcfg files exist, they were used to control device names (to some point). now that these files are gone, all kinds of stuff might go wrong.
the systemd network link files might be a good solution for it, since they can also be used for setting other parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants