Closed chewborg closed 2 weeks ago
Thank you @chewborg for filing this bug and improving cloud-init. Can you clarify what behavior is broken by cloud-init's decision to render sysconfig files instead of /etc/NetworkManager/system-connections/. Is network inoperable, does this conflict with other network configuration emitted on the system in NetworkManager/system-connection/*?
My understanding from the bug is that cloud-init is still rendering content in what's considered "deprecated behavior" by the /etc/sysconfig/network-scripts/readme-ifcfg-rh.txt file.
@ani-sinha this request/issue seems at conflict with the RedHat/Rocky specific changes we added in #4132 which was a strict decision to always use sysconfig if you have the plugin ifcfg-rh
. I have no visibility to RHBZ: 2194050 so I don't know specifically what bug #4132 was trying to fix.
Do we want to consider either of the following:
In RHEL 9 use of Sysconfig renderer is the default. That is because the Sysconfig renderer has the higher priority and the ifcfg plug-in is available. We will never make a major decision to flip the switch and always use network manager renderer by default in the middle of the major RHEL version. If users want, they can override the default priority and use network manager renderer with a higher priority so that it takes precedence over Sysconfig renderer.
In RHEL 10 network manager renderer is the default and is the only way to configure the network. Therefore network manager renderer has the higher priority over Sysconfig renderer (and you can't enable Sysconfig renderer as the ifcfg plugin is absent).
In terms of documentation, I will draw the attention of our doc team to check if this has been documented in one of RH KCs , if not add one.
Another data point is this - RHEL 9.2 and below did not support network manager renderer. It's only RHEL 9.3 and above that supports both Sysconfig and network manager renderer. Hence we won't make network manager renderer default for RHEL 9. Instead we will use the RHEL 9 train to stabilize network manager renderer before making the big switch to making it the default in RHEL 10.
Hi @ani-sinha
Now I'm not sure if we are talking about cloud-init or the RHEL OS in the above For a RHEL v9.0 installation the default is to use NetworkManager keyfiles, and I just did a quick KVM install via the ISO to verify
[root@rhel90-iso-install patrick]# nmcli -f NAME,TYPE,AUTOCONNECT,ACTIVE,DEVICE,STATE,FILENAME connection show
NAME TYPE AUTOCONNECT ACTIVE DEVICE STATE FILENAME
enp1s0 ethernet yes yes enp1s0 activated /etc/NetworkManager/system-connections/enp1s0.nmconnection
[root@rhel90-iso-install patrick]# cat /etc/redhat-release
Red Hat Enterprise Linux release 9.0 (Plow)
But perhaps I'm misinterpreting and you are telling me that cloud-init should only use sysconfig and not the network-manager renderer. If so I wasn't aware of this, or at least I didn't find this documented. I'm probably out of my depth knowledgewise so I guess I didn't find what I expected, and I'm probably not alone there.
Honestly, as the nmcli tool will work with either ifcfg or nmconnection files for most of its functionality it's not a big deal I guess. If you want your vm to use keyfiles
For a Openstack VM using cloud-init you can either run
nmcli connection migrate
Or create a custom image with something like
cat /etc/cloud/cloud.cfg.d/92_network_setup.cfg
system_info:
network:
renderers: ['network-manager']
And you'll get the state we wish to use.
In that case I think a solution to the issue I raised is to ensure the documention for cloud-init that the Network Renderer will be sysconfig
by default for RHEL 9 versions (and clones) using cloud-init.
@chewborg
Now I'm not sure if we are talking about cloud-init or the RHEL OS in the above
cloud-init.
But perhaps I'm misinterpreting and you are telling me that cloud-init should only use sysconfig and not the network-manager renderer.
No, what I am saying is this. For RHEL 9.0, 9.1 and 9.2, cloud-init can only use syscnfig renderer as support for network manager renderer is absent. From RHEL 9.3 onwards, both sysconfig and network manager renderer can be used.
Or create a custom image with something like
cat /etc/cloud/cloud.cfg.d/92_network_setup.cfg system_info: network: renderers: ['network-manager']
So essentially what you are doing here is removing other renderers and keeping only network-manager renderer. You do not need to do that. You can simply give network-manager
renderer a higher priority over sysconfig
, something like:
network:
renderers: ['netplan', 'network-manager', 'networkd', 'sysconfig', 'eni']
and then it will give priority to network-manager renderer. Again, remember that this will only work for RHEL 9.3 and above. By default, cloud-init in RHEL 9.3 and above will continue to use sysconfig renderer.
I will check with our doc team to see if we can better document this.
Thanks for the additional context Ani.
From upstream's perspective, this works as expected. Cloud-init correctly determines that sysconfig is installed and uses the sysconfig renderer if sysconfig is orderered earlier in the renderer list.
We have a templated config file that can be modified to specify renderer ordering when building cloud-init, though it looks like this is already being overridden downstream. If you want to submit a PR to make a change specific to Rocky in this template, we're happy to accept it.
Bug report
Since RHEL 9 the default storage of network configurations is now NetworkManager keyfiles, not sysconfig network ifcfg files. https://www.redhat.com/en/blog/rhel-9-networking-say-goodbye-ifcfg-files-and-hello-keyfiles https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html-single/9.0_release_notes/index#enhancement_networking
However a change to the decision evaluation on which network renderer to use now causes sysconfig to be used in all cases, rather than the expected network-manager renderer. Issue 4131 Pull Request 4132 This is because the RHEL9 NetworkManager package also always includes the file /usr/lib64/NetworkManager/*/libnm-settings-plugin-ifcfg-rh.so, now used as the inescapable determination of whether to use the sysconfig or network-manager renderers, though using NetworkManager keyfiles now is the default.
So cloud-init is overriding the default behaviour and the result is a RHEL9 OS configured with cloud-init is in an unexpect state. Which is the Interfaces are managed by NetworkManager as ifcfg files in /etc/sysconfig/network-scripts/ rather than the expected keyfiles in /etc/NetworkManager/system-configurations/
Additional steps then need to be undertaken to migrate these configurations to keyfile format.
We expect to find the default state for RHEL9 Networking when using an unmodified cloud-config, and there does not appear to be a way for overriding this except to add a custom renderer list in /etc/cloud/cloud.cfg.d/ excluding sysconfig in custom images.
Steps to reproduce the problem
Environment details
cloud-init logs