» Download this section as PDF (opens in a new tab/window)
The Acropolis CLI (aCLI) is the CLI for managing the Acropolis and AHV portion of the Nutanix product for tasks like AHV host, network, and VM management. These capabilities were enabled in releases after AOS 4.1.2 and are available on Nutanix AHV cluster CVMs only. aCLI is not supported on Prism Central.
The current aCLI command reference can be found on the Nutanix Portal.
Description: Enter aCLI shell.
acli
OR
Description: Execute aCLI command via Linux shell
acli <command>
Description: Enter aCLI shell. Any responses to commands will be in JSON format.
acli –o json
Description: Lists AHV nodes in the cluster.
host.list
This screenshot shows the output from ‘host.list’ in both tabulated and JSON format. The obfuscated information are cluster specific serial numbers and IP address details.
Description: Create network based on VLAN
net.create NAME TYPE.ID[.VSWITCH] ip_config=A.B.C.D/NN vlan="VLAN"
Example:
net.create vlan.133 ip_config=10.1.1.1/24 vlan="133"
Description: List networks
net.list
Description: Create dhcp scope
net.add_dhcp_pool NET NAME start=START IP A.B.C.D end=END IP W.X.Y.Z
Note: The last usable IP address in the network range is selected for the Acropolis DHCP server if an address for the DHCP server wasn’t set during network creation.
Example:
net.add_dhcp_pool vlan.100 start=10.1.1.100 end=10.1.1.200 vlan="100"
Description: Get a network’s VMs and details including VM name / UUID, MAC address and IP
net.list_vms NETNAME
Example:
net.list_vms vlan.133
Description: Set DHCP DNS
net.update_dhcp_dns NETNAME servers=COMMA SEPARATED DNS IPs domains=COMMA SEPARATED DOMAINS
Example:
net.update_dhcp_dns vlan.100 servers=10.1.1.1,10.1.1.2 domains=ntnxlab.local
Description: Create VM
vm.create COMMA SEPARATED VM NAMES memory=NUM MEM MB num_vcpus=NUM VCPU num_cores_per_vcpu=NUM CORES ha_priority=PRIORITY INT
Example:
vm.create testVM memory=2G num_vcpus=2
Description: Create bulk VMs
vm.create CLONEPREFIX[STARTING INT..END INT] memory=NUM MEM MB num_vcpus=NUM VCPU num_cores_per_vcpu=NUM CORES ha_priority=PRIORITY INT
Example:
vm.create testVM[000..999] memory=2G num_vcpus=2
Description: Create clone of existing VM
vm.clone CLONE NAME(S) clone_from_vm=SOURCE VM NAME
Example:
vm.clone testClone clone_from_vm=MYBASEVM
Description: Create bulk clones of existing VM
vm.clone CLONEPREFIX[STARTING INT..END INT] clone_from_vm=SOURCE VM NAME
Example:
vm.clone testClone[001..999] clone_from_vm=MYBASEVM
Description: Create disk for OS
vm.disk_create VM NAME create_size=Size and qualifier, e.g. 500G container=CONTAINER NAME
Example:
vm.disk_create testVM create_size=500G container=default
Description: Create and add NIC
vm.nic_create VM NAME network=NETWORK NAME model=MODEL
Example:
vm.nic_create testVM network=vlan.100
Description: Set a VM boot device
Set to boot from specific disk id
vm.update_boot_device VM NAME disk_addr=DISK BUS
Example:
vm.update_boot_device testVM disk_addr=scsi.0
vm.disk_create VM NAME cdrom="true" empty="true"
Example:
vm.disk_create testVM cdrom="true" empty="true"
Set to boot from CD-ROM
vm.update_boot_device VM NAME disk_addr=CD-ROM BUS
Example:
vm.update_boot_device testVM disk_addr=ide.0
Description: Mount ISO to VM CD-ROM
Steps:
Create CD-ROM with ISO
vm.disk_create VM NAME clone_from_afsf_file=/CONTAINER/ISO CD-ROM=true
Example:
vm.disk_create testVM clone_from_adfs_file=/default/myfile.iso CD-ROM=true
Description: Remove ISO from CD-ROM
vm.disk_update VM NAME CD-ROM BUS empty=true
Description: Power on VM(s)
vm.on VM NAME(S)
Example:
vm.on testVM
Power on all VMs.
Example:
vm.on *
Power on all VMs matching a prefix.
Example:
vm.on testVM*
Power on range of VMs.
Example:
vm.on testVM[0-9][0-9]
The current nCLI command reference can be found on the Nutanix Portal.
The Nutanix Command Line Interface (nCLI) allows you to run system administration commands against the Nutanix cluster. In contrast to aCLI, nCLI can be installed on your local machine. See the Nutanix Portal link above for installation details.
Description: Displays the current version of the Nutanix software
ncli cluster version
This screenshot shows the output from ‘ncli version’ as both a single-line command and from within an ncli “session”.
Description: Adds a particular subnet to the NFS whitelist
ncli cluster add-to-nfs-whitelist ip-subnet-masks=10.2.0.0/255.255.0.0
Description: Displays the existing storage pools
ncli sp ls
Note: This example shows the use of shortened commands. “storagepool” becomes “sp”, “list” becomes “ls”.
Description: Displays the existing containers
ncli ctr ls
Description: Creates a new container
ncli ctr create name=NAME sp-name=SP NAME
Description: Displays the existing VMs
ncli vm ls
Description: Displays the existing public keys
ncli cluster list-public-keys
Description: Adds a public key for cluster access
SCP public key to CVM
Add public key to cluster
ncli cluster add-public-key name=myPK file-path=~/mykey.pub
Description: Removes a public key for cluster access
ncli cluster remove-public-keys name=myPK
Description: Creates a protection domain
ncli pd create name=NAME
Description: Create a remote site for replication
ncli remote-site create name=NAME address-list=Remote Cluster IP
Description: Protect all VMs in the specified container
ncli pd protect name=PD NAME ctr-id=Container ID cg-name=NAME
Description: Protect the VMs specified
ncli pd protect name=PD NAME vm-names=VM Name(s) cg-name=NAME
Description: Protect the DSF Files specified
ncli pd protect name=PD NAME files=File Name(s) cg-name=NAME
Description: Create a one-time snapshot of the protection domain
ncli pd add-one-time-snapshot name=PD NAME retention-time=seconds
Description: Create a recurring snapshot schedule and replication to n remote sites
ncli pd set-schedule name=PD NAME interval=seconds retention-policy=POLICY remote-sites=REMOTE SITE NAME
Description: Monitor replication status
ncli pd list-replication-status
Description: Fail-over a protection domain to a remote site
ncli pd migrate name=PD NAME remote-site=REMOTE SITE NAME
Description: Activate a protection domain at a remote site
ncli pd activate name=PD NAME
# Node status
ncli cluster get-domain-fault-tolerance-status type=node
# Block status
ncli cluster get-domain-fault-tolerance-status type=rackable_unit