community.sap_install icon indicating copy to clipboard operation
community.sap_install copied to clipboard

sap_general_preconfigure: RHEL 8 system deletes network interface during installation step when created with image provisioning

Open rhmk opened this issue 3 years ago • 4 comments

the default image in GCP has not installed the package NetworkManager-config-server.

This adds a NetworkManager configuration file to make it behave more like the old "network" service. In particular, it stops NetworkManager from automatically running DHCP on unconfigured ethernet devices, and allows connections with static IP addresses to be brought up even on ethernet devices with no carrier. This package is intended to be installed by default for server deployments.

Hence the role installs it automatically, with the consequence that dhcp is no longer started on the network interfaces in GCP after reboot and the machine is disconnected from the network.

One easy option is to print a warning if that happens, the other option is to "define" the existing network config if it is unconfigured

rhmk avatar Feb 02 '22 19:02 rhmk

Everything works as designed. The follwowing task before a reboot is fixing the issue:

    - name: ensure network configuration is persistent
      include_role:
         name: rhel-system-roles.network
      vars:
         network_provider: nm
         network_connections:
           - name: "{{ ansible_default_ipv4.alias }}"
             mac: "{{ ansible_default_ipv4.macaddress }}"
             interface_name: "{{ ansible_default_ipv4.interface }}"
             type: ethernet
             ip:
                     dhcp4: true
                     dhcp4_send_hostname: true 

It will create a file in /etc/sysconfig/network-scripts to make the connection persistent. For production with multiple interfaces, it would be a good practice to run the network role anyway after VM creation

So a possible probe for a warning in the playbook network section could be no /etc/sysconfig/network-scripts/ifcfg-* files or run a " nmcli c s " command and check if a ifcfg-$1 for existing NW config do exist. If not throw a warning or error

rhmk avatar Feb 03 '22 19:02 rhmk

It's not affecting only to the GCP VMs, I was able to reproduce the issue in a generic VM and I had the same behavior of the VM.

juestrad avatar Jun 28 '23 13:06 juestrad

I saw the problem with GCP first., but it is likely to occur on any cloud or virtualization environment. The issue is based on the fact that NetworkManager in client mode (default) tries to discover an IP address on any available interface. This is a good behavior for laptops or cloud images, where you do not know, which interfaces exist or which will be connected at boot time. But this is an unwanted behavior for servers where you have a well-defined environment. The package NetworkManager-config-server disables this functionality. It will be installed as a member of the server package group during the sap-preconfigure script. For servers, you should use the network system role prior to running the sap prep playbooks to get a proper and well-defined network setup, or if it is just a demo system you can use the above configuration to persist the DHCP connection on the found interface.

rhmk avatar Jul 04 '23 09:07 rhmk

I don't think this has to be fixed in the SAP preconfigure roles because it is a task that is typically performed as part of the initial network configuration. The network system role can be used for exactly this purpose. Nonetheless, the behavior as such should be well documented.

rhmk avatar Jul 04 '23 09:07 rhmk

No further activity after 04-Jul-2023 -> Closing as wontfix. Please reopen this issue if necessary and provide a justification.

berndfinger avatar Feb 17 '25 17:02 berndfinger