/opt/vmware/share/vami/vami_config_net fails with "Unable to set hostname to <newhostname> reverting to previous hostname:"This issue occurs when the existing hostname of the vCenter is hard coded in the /etc/hosts file.
Example:
└─$ cat etc/hosts
# Begin /etc/hosts (network card version)
<vCenteripaddress> <vCenterfqdn>
# End /etc/hosts (network card version)
To resolve this issue:
systemctl restart dnsmasq
systemctl restart systemd-resolved
nslookup <vcenterFQDN)
nslookup <vcenterIP>
Note: vCenter entry in the /etc/hosts file should be removed which was manually updated. Do not update or remove anything else between # VAMI_EDIT_BEGIN and # VAMI_EDIT_END
Additionally having vCenter FQDN in the /etc/hosts file is not a requirement if the external DNS server is able to resolve the vCenter FQDN