Guest OS Customization may fail to set network configuration on virtual machine which NetworkManager keyfile is activated
search cancel

Guest OS Customization may fail to set network configuration on virtual machine which NetworkManager keyfile is activated

book

Article ID: 311956

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:

  • For RHEL 9.x, AlmaLinux 9.x and Rocky Linux 9.x and Oracle Linux 9.x virtual machine, guest os customization may fail to set the expected network configuration, such as ip address, gateway and DNS settings.

  • By running command "(sudo) nmcli -f ALL connection show" in the customized virtual machine, it shows NetworkManager keyfile connection is activated, by default

  • The keyfile profile is located at /etc/NetworkManager/VMwarecustomization-{NAME}.nmconnection, {NAME} is the interface name, e.g., eth0.

 

Environment

VMware vCenter Server 6.7.x
VMware vCenter Server 7.x
VMware vCenter Server 8.x

 

Cause

  • Guest OS Customization writes network configuration to network-scripts file located at /etc/sysconfig/network-scripts/ifcfg-{NAME}, {NAME} is the interface name.  

  • NetworkManager loads network configuration from both keyfile and ifcfg-rh plugins according to the default plugins settings in /etc/NetworkManager/NetworkManager.conf.

  • Only keyfile will be activated for an interface if the keyfile was activated for the interface most recently.

  • This leads to the customized virtual machine fails to get the expected network configuration.

Resolution

  • The issue is fixed in vSphere 6.7 P07/U3r, vSphere 7.0 P05/U3f and vSphere 8.0 releases.

  • From vSphere 6.7 P07/U3r, vSphere 7.0 P05/U3f and vSphere 8.0 releases, Guest OS Customization has set "AUTOCONNECT_PRIORITY=999" to network-scripts file to make sure NetworkManager activates network configuration from /etc/sysconfig/network-scripts/ifcfg-{NAME}.

  • From vSphere 8.0 U3 release, Guest OS Customization has supported NetworkManager Keyfile format, network configuration is written to both /etc/NetworkManager/system-connections/VMware-customization-{NAME}.nmconnection and /etc/sysconfig/network-scripts/ifcfg-{NAME}, no AUTOCONNECT_PRIORITY property is set.

Note:

  • NetworkManager ifcfg-rh plugin is being deprecated, to use keyfile plugin only, VM/Template needs to be updated by setting "plugins=keyfile" in /etc/NetworkManager/NetworkManager.conf,  then NetworkManager will load network configuration from keyfile only after Guest OS Customization.