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

NetworkManager config changes sometimes not retrain on reboot. #1711

Open
aka7 opened this issue Sep 11, 2024 · 0 comments · May be fixed by #1712
Open

NetworkManager config changes sometimes not retrain on reboot. #1711

aka7 opened this issue Sep 11, 2024 · 0 comments · May be fixed by #1712
Milestone

Comments

@aka7
Copy link
Contributor

aka7 commented Sep 11, 2024

On one of our vcs cluster, which adds two static routs,
after applying the interface config using nmstatectl apply (via ncm-network) on reboot it seems to revert back to previous config. running nmstatectl apply again fixes it.

on reboot it appears to use the connection from /run and not the update config in /etc and config in run does not match the updated config in /etc/. During reboot it seem to always apply the config in /run/.

nmcli dev shows this as externally connected.

$ nmcli dev status
DEVICE          TYPE      STATE                   CONNECTION
lo              loopback  connected (externally)  lo
dummy_hostname  dummy     connected               dummy_hostname
eth0            ethernet  connected (externally)  eth0
eth1            ethernet  connected (externally)  eth1

# nmcli -f filename conn
FILENAME
/run/NetworkManager/system-connections/lo.nmconnection
/etc/NetworkManager/system-connections/dummy_hostname.nmconnection
/run/NetworkManager/system-connections/eth0.nmconnection
/run/NetworkManager/system-connections/eth1.nmconnection
/etc/NetworkManager/system-connections/eth0.nmconnection
/etc/NetworkManager/system-connections/eth1.nmconnection

from NetworkManager.conf

keep-configuration
           On startup, NetworkManager tries to not interfere with interfaces that are already configured. It does so by generating a in-memory
           connection based on the interface current configuration.

           If this generated connection matches one of the existing persistent connections, the persistent connection gets activated. If there is no
           match, the generated connection gets activated as "external", which means that the connection is considered as active, but NetworkManager
           doesn't actually touch the interface.

           It is possible to disable this behavior by setting keep-configuration to no. In this way, on startup NetworkManager always tries to
           activate the most suitable persistent connection (the one with highest autoconnect-priority or, in case of a tie, the one activated most
           recently).

           Note that when NetworkManager gets restarted, it stores the previous state in /run/NetworkManager; in particular it saves the UUID of the
           connection that was previously active so that it can be activated again after the restart. Therefore, keep-configuration does not have
           any effect on service restart.

That suggests that 'keep-configuration no' might work on a start/reboot to ignore the previous uuid in /run and configure the device.
I'm not sure why on this particular vcs cluter we are seeing this, but this suggests that 'keep-configuration no' work on a start/reboot to ignore the previous uuid in /run and configure the device. Setting this value fixes this problem.

We need an option to set this in ncm-network.

@jrha jrha added this to the 24.10 milestone Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants