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.
VMware vCenter Server 6.7.x
VMware vCenter Server 7.x
VMware vCenter Server 8.x
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.
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:
Power-on Virtual Machine.
Edit /etc/NetworkManager/system-connections/{NAME}.connection file(s).
Add 'autoconnect-priority=-999' under [Connection] section in the file(s).
Save and close the file(s).
Power-off the Virtual Machine (convert Virtual Machine back to template).