Essential Nutanix CLI
Essential commands for any Nutanix Administrators
No.#1 Build a new Nutanix cluster with at least 3 nodes
If you are planning to create new Nutanix cluster required at least three nodes for RF-2 cluster
Make sure that all the CVMs, Nodes and IPMI IP addresses are reachable or ping able to each other.
Issue following commands of any controller VM (CVM)
cvm$> cluster -s cvm1_ip_addr,cvm2_ip_addr,cvm3_ip_addr create Test cluster -s 192.168.10.1,192.168.10.2,192.168.10.3 create Note: Each CVM IP adddress separeted by comma (,) without space
OR can do same thing to add extra prefix parameters in above command
cvm$> cluster –cluster_name= --cluster_external_ip= --dns_servers= --ntp_servers= --redundancy_factor=2 -s cvm1_IP_addr,cvm2_IP_addr,cvm3_IP_addr, So on.. create
Note: –redundancy_factor parameter has to values 2 and 3
To use –redundancy_factor 2 need at least 3 nodes for build the nutanix cluster, RF-2 keeps one additional copy of master data, if one nodes goes down or in maintenance mode no impact on nutanix cluster
To use –redundancy_factor 3 need atleast 5 nodes for build the nutanix cluster, RF-3 keeps two additional copy of master data, if two nodes goes down or in maintenance mode no impact on nutanix cluster
No.#2 Start & Stop Nutanix cluster
Planning for any hardware maintenance or relocation of the nutanix nodes need to stop the nutanix cluster for sometime and start again to begin production
To Start Nutanix cluster following command
cvm$ cluster start
To Stop Nutanix cluster following command
cvm$ cluster stop
No.#3 Show cluster status and running services
Want to know nutanix cluster and running services status, Issue following command from any CVM
cvm$ cluster status
No.#4 Set timezone on nutanix running cluster
It is very important to set timezone after built nutanix cluster as your country
cvm$ ncli cluster set-timezone timezone=choose_timezone
Example cvm$ ncli cluster set-timezone timezone=Asia/Kolkata or America/Los_Angeles etc
No.#5 Run nutanix cluster health check
Need to check nutanix running cluster health status to verify the nutanix health report via email and text document issue following command from any CVMcvm$ ncc health_checks run_allNo.#6 Check controller VM (CVM), Hypervisor and IPMI IP Address of running nutanix cluster
To check controller VM (CVM) IP addressees on nutanix cluster
cvm$ svmipsTo check Hypervisor IP addresses on nutanix cluster
cvm$ hostipsTo check IPMI IP addresses on nutanix cluster
cvm$ ipmiipsNo.#7 Check AOS and Hypervisor upgrade progress/status
If want to check upgrade progress through command line and what is going on in back end, hit following command from any CVMTo show AOS upgrade progress/status
cvm$ upgrade_statusTo show Hypervisor upgrade progress/status
cvm$> host_upgrade statusNo.#8 Check AOS & AHV version through command line
To show AOS version issue following command cvm$ cat /etc/nutanix/release_version #Run on particular node cvm$ allssh cat /etc/nutanix/release_version #Run on entire cluster for all node's CVMTo show AHV version on particular node issue following command AHV# cat /etc/nutanix-release #Run on particular AHV node/hostTo show entire cluster AHV version run following command on any CVM of the nutanix cluster cvm$ hostssh cat /etc/nutanix-releaseNo.#9 Get cluster information like cluster name, cluster UUID, cluster IP address and timezone etc run below command from any CVM
cvm$ ncli cluster infoThis is last but not the least command from “nutanix commands pitara”.
No.#10 Know your hardware specification like Memory, CPU, Network card, Power supply units, Storage info (HDD,SSD) etc. go through mentioned commandcvm$ allssh ncc hardware_info show_hardware_infoCreate the Nutanix Cluster
This is really simple and takes only one command. The only pre req is that you have set IP address of the CVMs eth0 interface.
You run the cluster create command and in my example below I have added some parameters available during the creation process:
- –redundancy_factor – with the two options 2 or 3 (requires min 5 Nutanix nodes).
- –cluster_name – The Nutanix cluster name
- –cluster_external_ip – The Nutanix cluster IP address
- –dns_servers – IP to the DNS servers
- –ntp_servers – FQDN to the NTP servers
cluster --dns_servers=10.16.188.210,10.113.61.111 --ntp_servers=pool.ntp.org --redundancy_factor=2 -s 10.21.17.211,10.21.17.213,10.21.17.215,10.21.17.217 --cluster_name=NTQX --cluster_external_ip=10.21.17.218 create

And our 4 node cluster creation is completed.

Comments
Post a Comment