Changing the AHV hostname shows how to replace the default AHV hostname after the Nutanix AHV deployment.
If you want to change the AHV hostname after deployment or creating a cluster, you can follow the actions below:
1- Select and access by SSH one Controller VM (CVM), and get the AHV host list:
acli host.list
With this command, you can see the hypervisor IP address.
2- Type the following command to change the AHV hostname:
change_ahv_hostname --host_ip=hypervisor_ip --host_name=hypervisor_new_hostname
Replace “hypervisor_ip” with your hypervisor IP and “hypervisor_new_hostname” with your hostname.
Examples:
change_ahv_hostname --host_ip=192.168.255.141 --host_name=NTXNCE01
nutanix@NTNX-58a82a95-A-CVM:192.168.255.142:~$ change_ahv_hostname –host_ip=192.168.255.141 –host_name=NTXNCE01
2024-09-29 23:49:23,675Z INFO ahv_host_agent.py:813 Event listener thread started
2024-09-29 23:49:24,778Z INFO change_ahv_hostname:82 Host name is successfully updated
change_ahv_hostname --host_ip=192.168.255.143 --host_name=NTXNCE02
nutanix@NTNX-58a82a95-A-CVM:192.168.255.142:~$ change_ahv_hostname –host_ip=192.168.255.143 –host_name=NTXNCE02
2024-09-29 23:49:45,615Z INFO ahv_host_agent.py:813 Event listener thread started
2024-09-29 23:49:46,717Z INFO change_ahv_hostname:82 Host name is successfully updated
change_ahv_hostname --host_ip=192.168.255.145 --host_name=NTXNCE03
nutanix@NTNX-58a82a95-A-CVM:192.168.255.142:~$ change_ahv_hostname –host_ip=192.168.255.145 –host_name=NTXNCE03
2024-09-29 23:50:01,570Z INFO ahv_host_agent.py:813 Event listener thread started
2024-09-29 23:50:02,672Z INFO change_ahv_hostname:82 Host name is successfully updated
The new AHV hostname will be shown in the Prism Element console in a few moments. That’s it 🙂