This article provides a proper way to rename an ESXi host, especially after running a bare-metal Foundation install. This also includes non-configurable components which needs to be checked before changing any aspect on Esxi hosts.
Description:
For changing the hostname of an ESXi host, as far as Nutanix is concerned, renaming a host is an instant and secure procedure, and can be done by following VMware instructions, from the below VMware Article: Changing the name of an ESX or ESXi host (1010821).
The following ESXi settings should NOT be manually changed as some of them are non-configurable config and others have dependency on Esxi functionality (Please involve VMware technical Support in case there are any concerns on these components):
- NFS datastore settings
- VM swapfile location
- VM startup/shutdown order
- CVM Name
- CVM virtual hardware configuration file (.vmx file)
- Each AOS version and upgrade includes a specific CVM virtual hardware configuration. Therefore, do not edit or otherwise modify the CVM virtual hardware configuration file.
- iSCSI software adapter settings
- vSwitchNutanix standard virtual switch
- vmk0 interface in port group “Management Network”
- vSwitchNutanix standard virtual switch
- SSH enabled
- Host firewall ports that are open
For a complete information please refer to the Non-configurable Esxi Components outlined in Non-Configurable ESXi Components.
Solution
For reference, you can check the below steps to change the hostname:
1. Log in to the ESXi host to rename through SSH or DCUI. Display current hostname:
root@esxi# hostname
NTNX-Blxxx-1-A
2. Run the following command to change the hostname:
root@esxi# esxcli system hostname set --host=hostname
3. Run the following command to set the fully qualified domain name. Note that –host and –fqdn are mutually exclusive.
root@esxi# esxcli system hostname set --fqdn=hostname.domain.com
4. Display the new hostname and fqdn:
root@esxi# esxcli system hostname get
Domain Name: domain.com
Fully Qualified Domain Name: hostname.domain.com
Host Name: hostname
5. To clear the domain name and leave only the hostname:
root@esxi# esxcli system hostname set -d=""
root@esxi# esxcli system hostname get
Domain Name:
Fully Qualified Domain Name: hostname
Host Name: hostname
6. Depending on the ESXi version, changes might be reflected automatically or imply a service restart.
- ESXi 5.1 / ESXi 5.5: After changing the hostname, execute the following command in the ESXi host. Prism will reflect the changes after about 30 seconds. Be aware that restarting hostd is a mildly disruptive operation.
root@esxi# /etc/init.d/hostd restart
watchdog-hostd: Terminating watchdog process with PID 34187
hostd stopped.
Ramdisk 'hostd' with estimated size of 1053MB already exists
hostd started.
- ESXi 6.x: Prism will reflect the changes automatically without restarting any service.
7. There is a known limitation with the NFSv3 implementation in VMware. The NFS lock files (.lck) in the VM directory will have the name of the previously named host no matter if existing, moved via VMotion or newly created VMs. This limitation only gets fixed by rebooting the ESXi host. We recommend rebooting the host after a host rename due to the fact that troubleshooting as well as log analysis can be more difficult.