Changing the hostname of an ESX or ESXi host
before I start, there is Important notes you have take care:
-If the management network of the ESX/ESXi host is on a vSphere Distributed Switch, migrate the network to a vSphere Standard Switch before proceeding.
-If the ESX/ESXi host is a part of a VSA cluster, do not remove the host from inventory.
-If ESXi host is a part of a vSAN cluster, the node in maintenance mode may still be primary or backup node in vSAN cluster, and you must manually drag the ESXi host out of the cluster to remove it from the cluster.
then start directly to change name like:
Run this command:
esxcfg-advcfg -s ESXi_FQDN /Misc/hostname
where ESXi_FQDN is the new FQDN hostname for the ESX host.
Reboot the ESX host.
Join the ESX host to VirtualCenter/vCenter Server and clusters.
esxcli system hostname set --host=hostname
esxcli system hostname set --fqdn=fqdn
5. Join the ESX host to VirtualCenter/vCenter Server and clusters