Nutanix is the most popular hyper-converged platform in the universe. If you have nutanix solution for your IT-infra you must be excited to explore.
As per client requirement need to change nutanix cvm (Controller vm) host name or Controller VM name that shows as VM name in Nutanix Prism as well and then can create DNS entry in local name server(s).
Make change in CVM’s (controller vm) host name or Controller VM name is possible through command line only.
Note: When you change Nutanix CVM host name will not reflect in prism. You need to run ‘hostname’ command on each Nutanix CVM.
Follow the steps to change Nutanix CVM host name
If you are using AOS 5.10.x or later then you can follow below steps
Step 1: Log in to target CVM (Controller VM) need to change host name via Prism- VM launch console or do ssh via putty or ssh directly from linux terminal.
Step 2: After log in to the Nutanix CVM run the following command
CVM$ sudo /usr/local/nutanix/cluster/bin/change_cvm_hostname <NTNX-Enter_new_cvm_host_name-CVM>
Note : Nutanix CVM host name Prefix as ‘NTNX’ and suffix ‘CVM’ word is mandatory to use, you can change the middle character as your choice.
Nutanix CVM will take restart to during the changing the host name.
Repeat this command for each Nutanix CVM one by one once recently rebooted Nutanix CVM comes up and take back the ownership of all services then you can proceed to change other Nutanix CVMs host name.
Step 3 ( Optional ): If new CVM host name does not show off then you can run following command to update new CVM host name in clusters database just restart the Acropolis service:
CVM$ genessis stop acropolis; cluster start
Note: No impact on running production VMs, will get some alerts in Prism just resolve them.
Step 4: close the CVM’s console ssh / putty session in which you have logged in and re-open to see the changes.
Optional: If Step 3 does not work, just restart each CVM in 10-15 minutes interval.
Change Nutanix CVM Name in Prism
Nutanix administrator can change the Nutanxi controller VM (CVM) name in Prism from Nutanix native Hypervisor AHV to run following commands
Step 1 : Login into SSH to Nutanix AHV host to determine the Nutanix CVM name
AHV# virsh list –all
Output will look like this
NTNX-Node-1-CVM shut off
Step 2 : Shutdown Nutanix CVM to change CVM host name
If you Nutanix Acropolis cluster is running then run following command only
cvm$ cvm_shutdown -h now
if Nutanix CVM is running standalone the run Following command
ahv@root# virsh shutdown <Nutanix-CVM_Name>
Step 3 : Change Nutanix CVM name
AHV# virsh domrename NTNX-Node-1-CVM NTNX-<New_name>-CVM
Note : Nutanix CVM name Prefix as ‘NTNX’ and suffix ‘CVM’ word is mandatory to use, you can change the middle character as your choice.
Step 4 : Power on / start the Nutanix CVM using New CVM Name
AHV# virsh start NTNX-<New_name>-CVM
Step 5 : Enable ‘Autostart’ flag on Nutanix CVM to start / shutdown with host
ahv@root# virsh autostart NTNX-<New_name>-CVM
Step 6 : Cross check new CVM name through following command
AHV# virsh list –all
ahv@roo# vi NTNX-NEWNAME-A-CVM.xml
Thanks to being here Enjoy Hyperhci Tech Blog.!