Nutanix Cheat Sheet
💡
As products continuously evolve and commands get discontinued or changed. I welcome you all to provide feedback if any of the commands you test no longer work.
Create a cluster
nutanix@cvm$ cluster -s <cvm_ip_address01>,<cvm_ip_address02> --cluster_external_ip <external_ip> --cluster_name <name> --container_name <name> --dns_servers <dns01>,<dns02> --ntp_servers <ntp01>,<ntp02> create
Display available timezones on a CVM
nutanix@cvm$ ls /usr/share/zoneinfo
Nutanix Command Line Interface
Set timezone
nutanix@cvm$ ncli cluster set-timezone timezone=<timezone>
ESX Command Line Interface
The following command examples are always run from controller VM, but might be handy to quickly change configuration on an ESX.
DNS Server on ESX hosts
The next three commands remove existing DNS configuration and apply only two new DNS servers
nutanix@cvm$ hostssh esxcli network ip dns server remove --all
nutanix@cvm$ hostssh esxcli network ip dns server add --server=<dns-server-1>
nutanix@cvm$ hostssh esxcli network ip dns server add --server=<dns-server-2>
Domain Name
nutanix@cvm$ hostssh esxcli system hostname set --domain=<domain-name>
nutanix@cvm$ hostssh esxcli system hostname get
Change CVM Display Name in Prism (AHV Only)
nutanix@cvm$ change_cvm_display_name --cvm_ip=<cvm-ip> --cvm_name=<new-cvm-display-name>
Password Management
Changing the password on a Controller VM
nutanix replaced the default linux passwd command with its own command. This is ensures that on a password change the change is done on all the controller VMs within the same cluster at once.
nutanix@cvm$ sudo passwd nutanix
Changing the password on a AHV hypervisor
The following command changes the local root password on all AHV hosts within the cluster by validating the complexity and than iterating through all nodes.
nutanix@cvm$ echo -e "CHANGING ALL AHV HOST ROOT PASSWORDS. Note - This script cannot be used for passwords that contain special characters ( $ \ { } ^ &)\nPlease input new password: "; read -s password1; echo "Confirm new password: "; read -s password2; if [ "$password1" == "$password2" ] && [[ ! "$password1" =~ [\\\{\$\^\}\&] ]]; then hostssh "echo -e \"root:${password1}\" | chpasswd"; else echo "The passwords do not match or contain invalid characters (\ $ { } ^ &)"; fi