Welcome to another Nutanix tutorial! We’re tackling a task I often find myself engaged in – renaming AHV hosts and CVMs. This isn’t just a mundane task; it’s about bringing clarity and organization to your virtual environment. Especially in scenarios where you’re reorganizing or adhering to new naming policies, these changes can significantly enhance the visual appeal and usability of your setup.
Say goodbye to confusing serial numbers and service tags!
Changing the AHV Hostname: Gone are the days when renaming an AHV host was a complex task. Thanks to the change_ahv_hostname script, it’s now a straightforward process. Let me guide you through it:
Step 1: SSH into any CVM: Begin by SSH’ing into any CVM in your cluster using nutanix. It’s a good practice to avoid using the Cluster VIP for this. Tools like PuTTY or other SSH clients work perfectly here.
Step 2: Change the Hostname: After logging in, execute the c
hange_ahv_hostname script. Use the command as follows, replacing host-IP-address with your host’s IP address and new-host-name with the desired hostname.
change_ahv_hostname --host_ip=host-IP-address --host_name=new-host-name
Step 3: Wait for the Update: Give Prism time to reflect the changes once you’ve executed the command.
Important Naming Conventions for the CVM Hostname:
- The maximum length is 63 characters.
- Allowed characters are uppercase and lowercase letters (A-Z and a-z), decimal digits (0-9), dots (.), and hyphens (-).
- The entity name must start and end with a number or letter.
To rename other AHV hosts in the cluster, simply repeat the process, one host at a time. Remember, uniqueness within your network and adherence to naming conventions are crucial.
Changing the Display Name of the CVM Prism: Renaming a CVM’s display name in Prism is almost as straightforward as changing the AHV hostname. However, it requires a reboot of the CVM. Ensure your cluster is in a healthy state and perform this operation from a different CVM than the one you’re renaming.
If you run this script from the same CVM, you will run into this error. But depending on the version of AOS/AHV you are running, you might not get this alert/error.
Step 1: SSH into a CVM: Start by SSH’ing into any CVM (not the one you’re renaming) in your cluster using nutanix. Again, avoid using the Cluster VIP and use an SSH client.
Step 2: Change the CVM Hostname: Once logged in, execute the change_cvm_display_name script. Replace CVM-IP with the IP of the CVM you’re renaming, and new-name with the desired display name.
change_cvm_display_name --cvm_ip=CVM-IP --cvm_name=new-name
Points to Remember for the CVM Name:
- Only use letters, numbers, and dashes (-).
- The name should start with
NTNX-
and end with-CVM
.
Summary: Renaming AHV hosts and CVMs in your Nutanix environment doesn’t just add to its aesthetic appeal but also enhances operational efficiency. With these simple steps, you can keep your virtual environment organized and easy to navigate.
Is this something you are interested in? Did I miss something?
Feel free to leave a comment and let me know what you think!