1 November 2021

Nutanix Cheat Sheet

Hopefully, this helps you as much as it helps me. This is by no means a comprehensive list. It’s just a place for me to jot down the various commands I use as I get to know Nutanix more intimately.

Run all NCC Health Checks

ncc health_checks run_all

Shutdown CVM

cvm_shutdown -P now

Check status of CVM metadata ring, see if all CVMs are ‘UP’

nodetool -h 0 ring

Check Cluster Status on CVM

Cluster status

Check if CVM processes are in UP state

cluster status | grep -v UP

Check CVM Metadata store status

ncli host ls | egrep "Meta[Id]Name"

Verify data resiliency

ncli cluster get-domain-fault-tolerance-status type=node

Check which CVM is the Minerva Leader

afs info.get_leader

Check which CVM is the Prism Leader

afs info.prism_leader

Check which CVM is the LCM Leader

lcm_leader

Start cluster

Cluster start

Restart prism on CVM

genesis restart

Prism/CVM Status

genesis status

Check if CVM is in Maintenance Mode
Note: Only the Scavenger, Genesis, and Zeus processes must be running (process ID is displayed next to the process name).

genesis status | grep -v "\[\]"

Cluster/Host Hardware Info (RAM, DIMMs, CPUs, etc…) from CVM

ncc hardware_info show_hardware_info

Migrate VM to a different storage container (AOS >= 5.19)

acli vm.update_container vm-name container=target-container wait=false

Change AHV host name (AOS >= 5.20)

change_ahv_hostname --host_ip=HOST_IP --host_name=NEW-AHV-HOSTNAME

Get all CVM IPs within the cluster

svmips

Get all Host IPs within the cluster

hostips

Get all IPMI IPs within the cluster

ipmiips

Get Cluster Info

ncli cluster info

Get all Hosts Info

acli host.info
ncli host ls

Verify the state of Host
-Entered Maintenace: node_state equals to kEnteredMaintenanceMode and schedulable equals to False.
-Exited Maintenace: node_state equals to kAcropolisNormal and schedulable equals to True.

acli host.get host-ip

Put a CVM in maintenance mode

ncli host edit id=HOST_ID enable-maintenance-mode=true

Exit a CVM from maintenance mode

ncli host edit id=HOST_ID enable-maintenance-mode=false

Put an AHV host in maintenance mode
Note: “wait=true” allows the host to migrate VMs to other hosts before it enters maintenance mode.

acli host.enter_maintenance_mode HOST_IP wait=true

Exit an AHV host from maintenance mode

acli host.exit_maintenance_mode HOST_IP

Check if AHV host is Schedulable

acli host.list

Check AOS version on all CVMs

allssh 'cat /etc/nutanix/release_version'

Check AHV version on all nodes

hostssh 'cat /etc/nutanix-release'

List all VMs on a cluster

acli vm.list

List all VMs on a host

acli host.list_vms host

List VMs in a powered ON state

acli vm.list power_state=on

List VMs in a powered OFF state

acli vm.list power_state=off

Power off all VMs running on the cluster

for vm_name in `acli vm.list power_state=on | grep -v ^'VM
name' | awk '{print $1}'`; do acli vm.force_off $vm_name; done

Power on all VMs running on the cluster

for vm_name in `acli vm.list power_state=off | grep -v ^'VM
name' | awk '{print $1}'`; do acli vm.on $vm_name; done

Tags: , , , , , ,
Copyright 2022. All rights reserved.

Posted November 1, 2021 by IT.G.c in category "Nutanix

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.