Describe, differentiate and utilize nCLI/aCLI to configure and monitor a cluster

Acropolis CLI (ACLI)

The Acropolis CLI (aCLI) is used for managing the Acropolis portion of the Nutanix

List hosts:

host.list

Create network:

net.create [TYPE].[ID].[VSWITCH] ip_config=[A.B.C.D]/[NN]

#Example
net.create vlan.133 ip_config=10.1.1.1/24

List network(s):

net.list

Create DHCP scope:

net.add_dhcp_pool [NET NAME] start=[START IP A.B.C.D] end=[END IP W.X.Y.Z]

Note: .254 is reserved and used by the Acropolis DHCP server if an address for the Acropolis DHCP server wasn’t set during network creation

Get an existing network’s details:

net.list_vms [NET NAME]

#Example
net.list_vms vlan.133

Configure DHCP DNS servers for network:

net.update_dhcp_dns [NET NAME] servers=[COMMA SEPARATED DNS IPs] domains=[COMMA SEPARATED DOMAINS]

#Example net.set_dhcp_dns vlan.100 servers=10.1.1.1,10.1.1.2
domains=splab.com

Create Virtual Machine:

vm.create [COMMA SEPARATED VM NAMES] memory=[NUM MEM MB] num_vcpus=[NUM VCPU] num_cores_per_vcpu=[NUM CORES] ha_priority=[PRIORITY INT]

Bulk Create Virtual Machine:

vm.create [CLONE PREFIX][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

Clone VM from existing:

vm.clone [CLONE NAME(S)] clone_from_vm=[SOURCE VM NAME]

#Example
vm.clone testClone clone_from_vm=MYBASEVM

Bulk Clone VM from existing:

vm.clone [CLONE PREFIX][[STARTING INT]..[END INT]] clone_from_vm=[SOURCE VM NAME]

#Example
vm.clone testClone[001..999] clone_from_vm=MYBASEVM

Create disk and add to VM:

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

Add NIC to VM:

vm.nic_create [VM NAME] network=[NETWORK NAME] model=[MODEL]

#Example
vm.nic_create testVM network=vlan.100

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

Set VM’s boot device to CD-ROM:

vm.update_boot_device [VM NAME] disk_addr=[CD-ROM BUS]

#Example
vm.update_boot_device testVM disk_addr=ide.0

Create CD-ROM with ISO:

vm.disk_create [VM NAME] clone_nfs_file=[PATH TO ISO] CD-ROM=true

#Example
vm.disk_create testVM clone_nfs_file=/default/ISOs/myfile.iso CD-ROM=true

If a CD-ROM is already created just mount it:

vm.disk_update [VM NAME] [CD-ROM BUS] clone_nfs_file[PATH TO ISO]

#Example
vm.disk_update atestVM1 ide.0 clone_nfs_file=/default/ISOs/myfile.iso

Detach ISO from CD-ROM:

vm.disk_update [VM NAME] [CD-ROM BUS] empty=true

Power on VM(s):

vm.on

#Example
vm.on testVM

Power on all VMs:

vm.on *

Power on all VMs matching a prefix:

vm.on testVM*

Power on range of VMs:

vm.on testVM[0-9][0-9]

Nutanix command-line interface (nCLI)

The Nutanix command-line interface (nCLI) allows you to run system administration commands against the Nutanix cluster from any of the following machines:

  • Your local machine (preferred)
  • Any Controller VM in the cluster

Add subnet to NFS whitelist:

ncli cluster add-to-nfs-whitelist ip-subnet-masks=10.2.0.0/255.255.0.0

Display cluster version

ncli cluster version

Display hidden NCLI options:

ncli helpsys listall hidden=true [detailed=false|true]

List Storage Pools:

ncli sp ls

List containers:

ncli ctr ls

Create container:

ncli ctr create name=[NAME] sp-name=[SP NAME]

List VMs:

ncli vm ls

List public keys:

ncli cluster list-public-keys

Add public key to cluster:

ncli cluster add-public-key name=myPK file-path=~/mykey.pub

Remove public key:

ncli cluster remove-public-keys name=myPK

Create protection domain:

ncli pd create name=[NAME]

Create remote site:

ncli remote-site create name=[NAME] address-list=[Remote Cluster IP]

Create protection domain for all VMs in container:

ncli pd protect name=[PD NAME] ctr-id=[Container ID] cg-name=[NAME]

Create protection domain with specified VMs:

ncli pd protect name=[PD NAME] vm-names=[VM Name(s)] cg-name=[NAME]

Create protection domain for DSF files (aka vDisk):

ncli pd protect name=[NAME] files=[File Name(s)] cg-name=[NAME]

Create snapshot of protection domain:

ncli pd add-one-time-snapshot name=[PD NAME] retention-time=[seconds]

Create snapshot and replication schedule to remote site:

ncli pd set-schedule name=[PD NAME] interval=[seconds] retention-policy=[POLICY] remote-sites=[REMOTE SITE NAME]

List replication status:

ncli pd list-replication-status

Migrate protection domain to remote site:

ncli pd migrate name=[PD NAME] remote-site=[REMOTE SITE NAME]

Activate protection domain:

ncli pd activate name= [PD NAME]

Enable DSF shadow clones:

ncli cluster edit-params enable-shadow-clones=true

Enable dedup for vDisk:

ncli vdisk edit name=[VDISK NAME] fingerprint-on-write=[true/false] on-disk-dedup=[true/false]

Check cluster resiliency status:

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

# Block status
ncli cluster get-domain-fault-tolerance-status type=rackable_unit

Leave a Reply

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