Nutanix Commands

Nutanix AHV acli and ncli commands with startup/shutdown procedures.

Cluster Startup Procedure

Step 1: Power on physical hosts

Power on all nodes in the cluster via IPMI/iLO/iDRAC

Step 2: Wait for CVM boot

Wait 5-10 minutes for all CVMs to boot and stabilize

ssh nutanix@<cvm_ip>

SSH to any CVM to check cluster status

cluster status

Verify all CVMs are up and cluster services started

ncli cluster info

Display cluster information and health

Step 3: Start cluster services

If cluster services not auto-started

cluster start

Start cluster services (run from any CVM)

Step 4: Verify cluster health

Check cluster is fully operational

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

Check fault tolerance status

Step 5: Power on VMs

VMs will auto-start based on HA settings or manually power on

acli vm.list

List all VMs and their power states

acli vm.on <vm_name>

Power on specific VM

Cluster Shutdown Procedure

Step 1: Shutdown all user VMs

Gracefully shutdown all non-essential VMs

acli vm.list power_state=on

List all powered-on VMs

acli vm.shutdown <vm_name>

Gracefully shutdown VM

Step 2: Verify VMs are off

Confirm all user VMs are powered off

acli vm.list

List all VMs and verify power states

Step 3: Stop cluster services

Stop Nutanix cluster services from any CVM

cluster stop

Stop cluster services (run from any CVM)

cluster status

Verify cluster services stopped

Step 4: Shutdown CVMs

Shutdown all Controller VMs

allssh "sudo shutdown -h now"

Shutdown all CVMs simultaneously

Step 5: Shutdown hosts

Shutdown physical hosts via IPMI/iLO/iDRAC

hostssh "shutdown -h now"

Shutdown all AHV hosts (if accessible)

Guest Tools Certificate Renewal

Step 1: Check certificate expiry

Verify NGT certificate expiration date

ssh nutanix@<cvm_ip>

SSH to CVM

openssl x509 -in /home/nutanix/config/ngt_cert/ngt.crt -noout -dates

Check NGT certificate validity dates

Step 2: Backup existing certificate

Backup current NGT certificates before renewal

cd /home/nutanix/config/ngt_cert/

Navigate to NGT certificate directory

cp ngt.crt ngt.crt.backup && cp ngt.key ngt.key.backup

Backup existing certificates

Step 3: Generate new certificate

Create new self-signed certificate

openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout ngt.key -out ngt.crt -subj "/C=US/ST=State/L=City/O=Org/CN=ngt"

Generate new 10-year certificate

Step 4: Set permissions

Ensure correct ownership and permissions

chmod 600 ngt.key ngt.crt

Set certificate file permissions

chown nutanix:nutanix ngt.key ngt.crt

Set certificate ownership

Step 5: Restart NGT services

Restart services to apply new certificate

genesis restart ngt_manager

Restart NGT manager service

Step 6: Update VMs

Update or reinstall NGT on VMs for new certificate

acli vm.guest_update_tools <vm_name>

Update guest tools on VM

ACLI - Cluster Management

acli cluster.info

Display cluster information

acli cluster.list

List cluster details

acli cluster.get <cluster_name>

Get specific cluster info

acli host.list

List all hosts in cluster

acli host.info <host_uuid>

Display host details

acli datastore.list

List all containers (datastores)

acli datastore.get <container_name>

Get container details

ACLI - VM Management

acli vm.list

List all VMs

acli vm.list power_state=on

List powered-on VMs

acli vm.get <vm_name>

Display VM details

acli vm.create <vm_name> num_vcpus=<num> memory=<GB>G

Create new VM

acli vm.delete <vm_name>

Delete VM

acli vm.on <vm_name>

Power on VM

acli vm.off <vm_name>

Force power off VM

acli vm.shutdown <vm_name>

Graceful shutdown VM

acli vm.reset <vm_name>

Reset VM (hard reboot)

acli vm.update <vm_name> num_vcpus=<num>

Update VM vCPU count

acli vm.update <vm_name> memory=<GB>G

Update VM memory

acli vm.clone <source_vm> clone_name=<new_vm>

Clone VM

acli vm.snapshot_create <vm_name> snapshot_name=<name>

Create VM snapshot

acli vm.snapshot_list <vm_name>

List VM snapshots

acli vm.snapshot_delete <vm_name> snapshot_uuid=<uuid>

Delete VM snapshot

acli vm.snapshot_restore <vm_name> snapshot_uuid=<uuid>

Restore VM snapshot

ACLI - Disk Management

acli vm.disk_create <vm_name> clone_from_vmdisk=<source_disk>

Clone disk to VM

acli vm.disk_create <vm_name> create_size=<size>G container=<container>

Create new disk for VM

acli vm.disk_delete <vm_name> disk_addr=<addr>

Delete disk from VM

acli vm.disk_update <vm_name> disk_addr=<addr> size=<GB>G

Resize disk

acli vm.disk_get <vm_name>

List VM disks

acli vdisk.list

List all virtual disks

acli vdisk.get <vdisk_uuid>

Get virtual disk details

ACLI - Network Management

acli net.list

List all networks

acli net.get <network_name>

Display network details

acli net.create <network_name> vlan=<vlan_id>

Create VLAN network

acli net.delete <network_name>

Delete network

acli vm.nic_create <vm_name> network=<network_name>

Add NIC to VM

acli vm.nic_delete <vm_name> <mac_address>

Remove NIC from VM

acli vm.nic_update <vm_name> <mac_address> network=<network_name>

Update NIC network

acli vm.nic_list <vm_name>

List VM NICs

NCLI - Cluster Operations

ncli cluster info

Display cluster information

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

Check node fault tolerance

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

Check disk fault tolerance

ncli cluster get-hypervisor-types

List hypervisor types

ncli cluster add-to-name-servers servers=<dns_ip>

Add DNS server to cluster

ncli cluster add-to-ntp-servers servers=<ntp_server>

Add NTP server to cluster

ncli cluster remove-from-name-servers servers=<dns_ip>

Remove DNS server

ncli cluster remove-from-ntp-servers servers=<ntp_server>

Remove NTP server

NCLI - Storage Management

ncli container ls

List all containers

ncli container info id=<container_id>

Display container details

ncli container create name=<name> sp-name=<pool_name>

Create container

ncli container rm id=<container_id>

Remove container

ncli container edit id=<container_id> name=<new_name>

Rename container

ncli container edit id=<container_id> rf=2

Set replication factor to 2

ncli container edit id=<container_id> rf=3

Set replication factor to 3

ncli storagepool ls

List storage pools

ncli storagepool info id=<pool_id>

Display storage pool details

ncli disk ls

List all disks

ncli disk info id=<disk_id>

Display disk details

NCLI - Protection Domains

ncli pd ls

List protection domains

ncli pd info id=<pd_name>

Display protection domain details

ncli pd create name=<pd_name>

Create protection domain

ncli pd add-vm id=<pd_name> vm-names=<vm_name>

Add VM to protection domain

ncli pd remove-vm id=<pd_name> vm-names=<vm_name>

Remove VM from protection domain

ncli pd activate id=<pd_name>

Activate protection domain

ncli pd deactivate id=<pd_name>

Deactivate protection domain

ncli pd set-schedule id=<pd_name> interval=<minutes>

Set snapshot schedule

ncli pd protect id=<pd_name>

Take snapshot now

ncli snapshot ls pd-name=<pd_name>

List snapshots in PD

ncli snapshot delete id=<snapshot_id>

Delete snapshot

NCLI - User & Security

ncli user list

List local users

ncli user create user-name=<username> password=<password>

Create local user

ncli user reset-password user-name=<username> password=<newpassword>

Reset user password

ncli user delete user-name=<username>

Delete user

ncli authconfig list-directory

List directory services

ncli authconfig add-directory name=<ad_name> directory-url=<ldap_url>

Add Active Directory

ncli cluster edit-params enable-lockdown-mode=true

Enable lockdown mode

ncli cluster edit-params enable-lockdown-mode=false

Disable lockdown mode

NCLI - Monitoring & Health

ncli health-checks

Run health checks

ncli alerts ls

List cluster alerts

ncli alerts acknowledge id=<alert_id>

Acknowledge alert

ncli alerts resolve id=<alert_id>

Resolve alert

ncli task list

List running tasks

ncli task get id=<task_id>

Get task status

ncli cluster get-smtp-server

Display SMTP server configuration

ncli cluster set-smtp-server address=<smtp_server> port=<port>

Configure SMTP server

ncli multicluster get-cluster-state

Display multi-cluster status

Advanced Troubleshooting

allssh "command"

Execute command on all CVMs

hostssh "command"

Execute command on all AHV hosts

cluster status

Display cluster service status

genesis status

Display genesis service status

links

Display Stargate links status

ncli cluster get-cvm-ip-addresses

List all CVM IP addresses

ncli cluster get-hypervisor-addresses

List all hypervisor addresses

tail -f /home/nutanix/data/logs/genesis.out

Monitor genesis logs

tail -f /home/nutanix/data/logs/prism/prism_gateway.log

Monitor Prism logs

nutanix@cvm$ ncc health_checks run_all

Run all NCC health checks

ncli cluster get-network-config

Display cluster network configuration

curl -k https://127.0.0.1:9440/api/nutanix/v3/cluster

Query Prism API locally