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 fails 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 STATE is activated, by default the keyfile FILENAME is /etc/NetworkManager/system-connections/{NAME}.connection, {NAME} is the connection name.


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 connection name. But when keyfile is being activated, NetworkManager will load network configuration from keyfile but network-scripts file. This leads to the customized virtual machine fails to get the expected network configuration.

Resolution

This issue has been resolved in vSphere 6.7 P07/U3r, vSphere 7.0 P05/U3f and vSphere 8.0 releases.
Native NetworkManager Keyfile format has been supported in vSphere 8.0 U3 release. Guest OS Customization will write network configuration to /etc/NetworkManager/system-connections/{NAME}.connection.


Workaround:

To workaround the issue:
Editing keyfile with FILENAME /etc/Ne†workManager/system-connections/{NAME}.connection in the source virtual machine/template, it can set keyfile to have lower AUTOCONNECT-PRIORITY than network-script file, so that any customized virtual machines from this source virtual machine/template will activate network-script automatically and then have the expected network configuration.

Detailed editing steps:

  1. Power-on Virtual Machine.

  2. Edit /etc/NetworkManager/system-connections/{NAME}.connection file(s).

  3. Add 'autoconnect-priority=-999' under [Connection] section in the file(s).

  4. Save and close the file(s).

  5. Power-off the Virtual Machine (convert Virtual Machine back to template).