Professional Documents
Culture Documents
Command Reference-NOS v3 5
Command Reference-NOS v3 5
NOS 3.5
23-Sep-2013
Notice
Copyright
Copyright 2013 Nutanix, Inc.
Nutanix, Inc.
1740 Technology Drive, Suite 400
San Jose, CA 95110
All rights reserved. This product is protected by U.S. and international copyright and intellectual property
laws. Nutanix is a trademark of Nutanix, Inc. in the United States and/or other jurisdictions. All other marks
and names mentioned herein may be trademarks of their respective companies.
Conventions
Convention Description
user@host$ command The commands are executed as a non-privileged user (such as nutanix)
in the system shell.
root@host# command The commands are executed as the root user in the hypervisor host
(vSphere or KVM) shell.
Version
Last modified: September 23, 2013 (2013-09-23-12:35 GMT-7)
2: Controller VM Commands...................................................................... 7
cluster.................................................................................................................................................. 7
diagnostics.py.................................................................................................................................... 16
genesis...............................................................................................................................................18
3: nCLI Reference......................................................................................23
alerts: Alert.................................................................................................................................... 23
authconfig: Authentication Configuration...................................................................................... 24
cluster: Cluster.............................................................................................................................. 26
container: Storage Container........................................................................................................ 33
datastore: Datastore...................................................................................................................... 37
disk: Physical Disk..........................................................................................................................38
host: Physical Host......................................................................................................................... 40
http-proxy: HTTP Proxy................................................................................................................43
managementserver: Management Server....................................................................................... 45
protection-domain: Protection domain.........................................................................................46
rackable-unit: Rackable unit........................................................................................................53
remote-site: Remote Site............................................................................................................. 53
servicecenter: Service Center......................................................................................................55
snapshot: Snapshot........................................................................................................................ 56
snmp: SNMP..................................................................................................................................... 58
storagepool: Storage Pool............................................................................................................ 61
storagetier: Storage Tier............................................................................................................. 63
user: User........................................................................................................................................64
vdisk: Virtual Disk...........................................................................................................................67
virtualmachine: Virtual Machine...................................................................................................69
vzone: vZone................................................................................................................................... 70
vstore: VStore................................................................................................................................ 72
3
1
Nutanix Command-Line Interface
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
1. Verify that your system has Java Runtime Environment (JRE) version 5.0 or higher.
To check which version of Java is installed on your system or to download the latest version, go to
http://www.java.com/en/download/installed.jsp.
b.
Click the user icon at the top of the console.
Troubleshooting
Error Explanation/Resolution
Error: Bad credentials The admin user password has been changed from the default and
you did not specify the correct password.
Type exit and start the nCLI again with the correct password.
When the cluster is up, exit the nCLI and start it again.
Results. The Nutanix CLI is now in interactive mode. To exit this mode, type exit at the ncli> prompt.
Command Format
Nutanix Command-Line Interface commands must match the following format:
ncli> entity action parameter1=value parameter2=value ...
Parameter-value pairs can be listed in any order, as long as they are preceded by a valid entity and action.
Tip: To avoid syntax errors, surround all string values with double-quotes, as demonstrated in the
preceding example. This is particularly important when specifying parameters that accept a list of
values.
Embedded Help
The nCLI provides assistance on all entities and actions. By typing help at the command line, you can
request additional information at one of three levels of detail.
help
Provides a list of entities and their corresponding actions
entity help
Provides a list of all actions and parameters associated with the entity, as well as which parameters
are required, and which are optional
entity action help
Provides a list of all parameters associated with the action, as well as a description of each
parameter
The nCLI provides additional details at each level. To control the scope of the nCLI help output, add the
detailed parameter, which can be set to either true or false.
For example, type the following command to request a detailed list of all actions and parameters for the
cluster entity.
ncli> cluster help detailed=true
You can also type the following command if you prefer to see a list of parameters for the cluster edit-
params action without descriptions.
ncli> cluster edit-params help detailed=false
cluster
Usage
Usage: /home/nutanix/cluster/bin/cluster [flags] [command]
commands:
add_public_key
create
destroy
disable_auto_install
enable_auto_install
ipconfig
migrate_zeus
reconfig
remove_all_public_keys
remove_public_key
restart_genesis
start
status
stop
upgrade
/home/nutanix/cluster/bin/cluster
--add_dependencies
Include Dependencies.
Default: false
--clean_debug_data
If 'clean_debug_data' is True, then when we destroy a cluster we will also remove the logs, binary
logs, cached packages, and core dumps on each node.
Default: false
--cluster_name
Name of the cluster (use with create).
--config
Path to the cluster configuration file.
--force
Force action.
Default: false
--force_install_proto
When upgrading from 3.* to 3.5, force installation of python protobuf libraries is required for rolling
upgrade.
Default: true
cluster.consts
--factory_config_json_path
Path to the factory_config.json file.
Default: /etc/nutanix/factory_config.json
--hyperv_external_network_interface
Default name of the network device for Hyper-V's external network.
Default: TenGigTeam
--hyperv_hypervisor_username
The username to use when logging into the local Hyper-V node.
Default: Administrator
--hyperv_internal_network_interface
Default name of the network device for Hyper-V's internal network.
Default: InternalSwitch
--hypervisor_internal_ip
Internal IP address of the hypervisor.
Default: 192.168.5.1
--hypervisor_password
The password to use when logging into the local hypervisor.
Default: nutanix/4u
--hypervisor_username
The username to use when logging into the local hypervisor.
Default: root
--ipmi_password
The password to use when logging into the local IPMI device.
Default: ADMIN
cluster.genesis.client
--genesis_jsonrpc_url
URL of the JSON RPC handler on the Genesis HTTP server.
Default: /jsonrpc
--genesis_port
Port that Genesis listens on.
Default: 2100
--genesis_rpc_timeout_secs
Timeout for each Genesis RPC.
Default: 30
cluster.genesis.cluster_manager
--cluster_state_znode
Location in Zookeeper where we keep whether a node start or stop.
Default: /appliance/logical/genesis/cluster_state
--cluster_versions_znode
Location in Zookeeper where we keep the desired software versions map.
Default: /appliance/logical/genesis/cluster_versions
--force_disable_blackbox
File to disable blackbox mode completely.
Default: /home/nutanix/.force_disable_blackbox
--node_shutdown_token_state_znode
Location in Zookeeper where we keep state of which node has currently requested to go down for
maintenance.
Default: /appliance/logical/genesis/node_shutdown_token
cluster.genesis.migration_manager
--num_migration_commit_retries
Number of times to retry updating the zeus configuration with new zookeeper ensemble.
Default: 5
--num_migration_rpc_retries
Number of times to retry Rpcs to other nodes during zookeeper migration.
Default: 10
--tcpkill
Path to the tcpkill binary
Default: /usr/sbin/tcpkill
--zookeeper_migration_wal_path
Path to zookeeper write-ahead-log file where migration state is recorded.
Default: /home/nutanix/data/zookeeper_migration.wal
--zookeeper_session_check_time_secs
Number of seconds zookeeper takes to verify and disconnect zookeeper quorum ip addresses that
are no longer valid.
Default: 10
--zookeeper_tcpkill_timeout_secs
Number of seconds to let tpckill to disconnect the tcp connections of zookeeper ensemble member
that is to be removed.
Default: 10
cluster.genesis.node_manager
--auto_discovery_interval_secs
Number of seconds to sleep when local node can't join any discovered cluster.
Default: 5
--avahi_service_type
Avahi service type to publish under.
Default: _nutanix._tcp
--configure_iptables_with_stig
If True, then we will setup iptables to be STIG compliant.
cluster.ipv4config
--esx_cmd_timeout_secs
Default timeout for running a remote command on an ESX host.
Default: 120
cluster.service.alert_manager_service
--alert_manager_data_dir
Path to the alert_manager data directory.
Default: /home/nutanix/data/alert_manager
--alert_manager_path
Path to the alert_manager binary.
Default: /home/nutanix/bin/alert_manager
--alert_manager_rss_mem_limit
Maximum amount of resident memory Alert Manager may use on an Svm with 8GB memory
configuration.
Default: 268435456
--alert_manager_virt_mem_limit
Maximum amount of virtual memory (in GB) Alert Manager may use on an Svm with 8GB memory
configuration.
Default: 1073741824
cluster.service.service_utils
--disk_inventory_path
The location to the file that contains the configurations for all of the supported disks.
Default: /home/nutanix/cluster/config/disk_inventory.cfg
--memory_limits_base_size_kb
Total memory size of the standard Svm based on which memory limits are derived.
Default: 8388608
--service_stop_wait
Wait time for how long we should wait before we start issuing SIGKILL instead of SIGTERM.
Default: 5
cluster.sshkeys_helper
--authorized_keys_file
Path to file containing list of permitted RSA keys
Default: /home/nutanix/.ssh/authorized_keys2
diagnostics.py
Usage
Usage: /home/nutanix/diagnostics/diagnostics.py [command]
commands:
cleanup
list_runtime_test_args
run
/home/nutanix/diagnostics/diagnostics.py
--ctr_name
Name of the container to be created for the disks of the UVM
Default: NTNX-NFS-DEFAULT
--default_aggregator
Default script to aggregate results.
Default: fio_aggregator.py
--default_ncli_password
Default password for login into the ncli.
Default: admin
--default_ncli_user
Default username for login into the ncli.
Default: admin
--deprecated_ctr_name
Deprecated container name used by older versions of this script. This is used to cleanup any
container that may be left behind by the previous version.
Default: NTNX-diagnostics-ctr
--display_cassandra_latency_stats
Display cassandra latency stats for each test.
Default: true
--display_latency_stats
Display latency stats for each test (available in fio tests only).
Default: false
genesis
Usage
Usage: /home/nutanix/cluster/bin/genesis start [all|<service_name>]|stop [all|
<service_name>]|restart|status
/home/nutanix/cluster/bin/genesis
--foreground
Run Genesis in foreground.
Default: false
cluster.genesis.client
--genesis_jsonrpc_url
URL of the JSON RPC handler on the Genesis HTTP server.
Default: /jsonrpc
--genesis_port
Port that Genesis listens on.
Default: 2100
--genesis_rpc_timeout_secs
Timeout for each Genesis RPC.
Default: 30
cluster.genesis.cluster_manager
--cluster_state_znode
Location in Zookeeper where we keep whether a node start or stop.
Default: /appliance/logical/genesis/cluster_state
--cluster_versions_znode
Location in Zookeeper where we keep the desired software versions map.
Default: /appliance/logical/genesis/cluster_versions
--force_disable_blackbox
File to disable blackbox mode completely.
Default: /home/nutanix/.force_disable_blackbox
--node_shutdown_token_state_znode
Location in Zookeeper where we keep state of which node has currently requested to go down for
maintenance.
Default: /appliance/logical/genesis/node_shutdown_token
--node_upgrade_status
Location in Zookeeper where we store upgrade status of nodes.
Default: /appliance/logical/genesis/node_upgrade_status
--nutanix_default_ssh_keys
Nutanix default SSH key used for logging into SVM.
Default: /home/nutanix/ssh_keys/nutanix
cluster.genesis.migration_manager
--num_migration_commit_retries
Number of times to retry updating the zeus configuration with new zookeeper ensemble.
Default: 5
--num_migration_rpc_retries
Number of times to retry Rpcs to other nodes during zookeeper migration.
Default: 10
--tcpkill
Path to the tcpkill binary
Default: /usr/sbin/tcpkill
--zookeeper_migration_wal_path
Path to zookeeper write-ahead-log file where migration state is recorded.
Default: /home/nutanix/data/zookeeper_migration.wal
--zookeeper_session_check_time_secs
Number of seconds zookeeper takes to verify and disconnect zookeeper quorum ip addresses that
are no longer valid.
Default: 10
--zookeeper_tcpkill_timeout_secs
Number of seconds to let tpckill to disconnect the tcp connections of zookeeper ensemble member
that is to be removed.
Default: 10
cluster.genesis.node_manager
--auto_discovery_interval_secs
Number of seconds to sleep when local node can't join any discovered cluster.
Default: 5
--avahi_service_type
Avahi service type to publish under.
Default: _nutanix._tcp
--configure_iptables_with_stig
If True, then we will setup iptables to be STIG compliant.
Default: true
--default_ssh_keys
SSH key used for logging into SVM.
Default: /home/nutanix/.ssh/id_rsa
--dhcp_ntp_conf
dhcp ntp configuration file.
cluster.genesis.server
--genesis_document_root
Document root where static files are served from.
Default: /home/nutanix/cluster/www
alerts: Alert
Description An Alert
Alias alert
Acknowledge Alerts
ncli> alerts { acknowledge | ack } ids
Required arguments
ids
A comma-separated list of ids of the Alerts
List Alerts
ncli> alerts { list | ls } { acknowledged } { max-alerts }
Required arguments
None
Resolve Alerts
ncli> alerts resolve ids
Required arguments
ids
A comma-separated list of ids of the Alerts
cluster: Cluster
Description A Nutanix Complete Cluster
Alias None
Operations • add-node
• add-public-key
• add-to-email-contacts
• add-to-name-servers
• add-to-nfs-whitelist
• add-to-ntp-servers
• clear-smtp-server
• configure-node
• discover-nodes
• edit-params | edit-info
• execute-command | exec-cmd
• get-email-alerts-status
• get-email-contacts
• get-name-servers
• get-nfs-whitelist
• get-ntp-servers
• get-params | info
• get-remote-support-status
• get-remove-status | get-rm-status
• get-send-stats-params
• get-smtp-server
• list-public-keys | ls-public-keys
• remove-all-public-keys | rm-all-public-keys
• remove-finish | rm-finish
• remove-from-email-contacts
• remove-from-name-servers
• remove-from-nfs-whitelist
• remove-from-ntp-servers
• remove-public-key | rm-public-key
• remove-start | rm-start delete
• send-test-email
• set-send-stats-params
• set-smtp-server
• start
• start-email-alerts
• start-remote-support
• status
• stop
• stop-email-alerts
Clear configuration of SMTP Server used for transmitting alerts and report emails to Nutanix support
ncli> cluster clear-smtp-server
Required arguments
None
Get Configuration parameters for sending stats to Nutanix home for offsite analytics
ncli> cluster get-send-stats-params
Get configuration of SMTP Server used for transmitting alerts and report emails to Nutanix support
ncli> cluster get-smtp-server
Required arguments
None
Delete public key with the specified name from the cluster
ncli> cluster { remove-public-key | rm-public-key } name
Required arguments
name
Name of the cluster public key
Configure parameters for sending stats to Nutanix home for offsite analytics
ncli> cluster set-send-stats-params { enable } { interval }
Required arguments
None
Optional arguments
enable
Whether to enable sending of stats to Nutanix Home for offsite analytics
interval
Interval in minutes at which stats are sent to Nutanix home for offsite analytics
Set configuration of SMTP Server used for transmitting alert and report emails to Nutanix support
ncli> cluster set-smtp-server address { port } { username } { password } { security-mode
}
Operations • add-to-nfs-whitelist
• create | add
• edit | update
• get-down-migrate-times | get-dm-times
• list | ls
• list-stats | ls-stats
• remove | rm
• remove-from-nfs-whitelist
• set-down-migrate-times | set-dm-times
Get the down-migrate times (in minutes) for Storage Tiers in a Storage Container
ncli> container { get-down-migrate-times | get-dm-times } { id } { name }
Required arguments
None
Optional arguments
id
ID of the Storage Container
name
Name of the Storage Container
Set the down-migrate times (in minutes) for a Storage Tier in a Storage Container
datastore: Datastore
Description An NFS Datastore
Alias None
Create a new NFS datastore on the Physical Hosts using the Storage Container (ESX only)
ncli> datastore { create | add } name ctr-name { host-ids } { read-only }
Required arguments
name
Name of the Datastore
ctr-name
Name of the Storage Container
Optional arguments
host-ids
A comma-separated list of the ids of the Physical Hosts (default = Includes all hosts)
read-only
Whether a Physical Host must have only read-only access to the Datastore
Default: false
Alias None
List Physical Disks that are not assigned to any Storage Pool
ncli> disk { list-free | ls-free }
Required arguments
None
Alias None
Operations • add-hacluster
• add-host-to-ha-cluster
• add-node
• configure-node
• discover-nodes
• edit | update
• enable-metadata-store
• get-remove-status | get-rm-status
• list | ls
• list-hadatacenters | ls-hadatacenters
• list-stats | ls-stats
• remove-finish | rm-finish
• remove-start | rm-start delete
• set-monitoring
Configure discovered node with IP addresses (Hypervisor, CVM and IPMI addresses)
ncli> host configure-node node-uuid { cvm-ip } { hypervisor-ip } { ipmi-ip } { ipmi-
netmask } { ipmi-gateway }
Required arguments
node-uuid
UUID of the new node
Optional arguments
cvm-ip
IP address of the controller VM
hypervisor-ip
IP address of the Hypervisor Host
ipmi-ip
IPMI address of the node
ipmi-netmask
IPMI netmask of the node
ipmi-gateway
IPMI gateway of the node
List HADatacenter(s)
ncli> host { list-hadatacenters | ls-hadatacenters } ms-name { datacenter-name }
Required arguments
ms-name
Name of the Management Server
Optional arguments
datacenter-name
Name of an HADatacenter
Alias proxy
Operations • add
• edit | update
• list | ls
• remove | rm
Alias ms
Operations • add
• edit | update
• list | ls
• list-types | ls-types
• remove | rm
• rename
Alias pd
Create a new out of band snapshot schedule in a Protection domain to take a snapshot at a specified time
ncli> protection-domain { add-one-time-snapshot | create-one-time-snapshot } name {
snap-time } { remote-sites } { retention-time }
Required arguments
name
Name of the Protection domain
Optional arguments
snap-time
Specify time in format MM/dd/yyyy [HH:mm:ss [z]] at which snapshot is to be taken. If not
specified, snapshot will be taken immediately
remote-sites
Comma-separated list of Remote Site to which snapshots are replicated. If not specified, remote
replication is not performed
retention-time
Number of seconds to retain the snapshot. Aged snapshots will be garbage collected. By
default, snapshot is retained forever
Mark Protection domain as inactive and failover to the specified Remote Site
ncli> protection-domain migrate name remote-site
Required arguments
name
Name of the Protection domain
remote-site
Remote Site to be used for planned failover
Mark a Protection domain for removal. Protection domain will be removed from the appliance when all
outstanding operations on it are cancelled
ncli> protection-domain { remove | rm } name
Required arguments
name
Name of the Protection domain
Mark Virtual Machines and NFS files for removal from a given Protection domain. They will be removed when all
outstanding operations on them are completed/cancelled
ncli> protection-domain unprotect name { files } { vm-names }
Required arguments
name
Name of the Protection domain
Alias ru
Alias rs
Mark a Remote Site for removal. Site will be removed from the appliance when all outstanding operations that are
using the remote site are cancelled
ncli> remote-site { remove | rm } name
Required arguments
name
Name of the Remote Site
Alias sc
Operations • add
• edit | update
• list | ls
• remove | rm
snapshot: Snapshot
Description Snapshot of a Virtual Disk
Alias snap
Operations • clone
• create | add
• list | ls
• list-stats | ls-stats
• remove | rm
List Snapshots
ncli> snapshot { list | ls } { name } { vdisk-name }
Required arguments
None
Optional arguments
name
Name of the Snapshot
vdisk-name
Name of the corresponding Virtual Disk
snmp: SNMP
Description An SNMP agent
Alias None
Operations • add-transport
• add-trap
• add-user
• edit-trap | update-trap
• edit-user | update-user
• get-status
• list-transports | ls-transports
• list-traps | ls-traps
• list-users | ls-users
• remove-transport | delete-transport
• remove-trap | delete-trap
• remove-user | delete-user
• set-status
Add a transport to the list of snmp transports. Each transport is a protocol:port pair
ncli> snmp add-transport protocol port
Required arguments
protocol
Protocol for the snmp agent or trap sink. Currently supported protocols are UDP, TCP and
UDP_6
port
Port number on which an snmp agent listens for requests or on which a trap sink is waiting traps
Add a trap sink to the list of trap sinks. Each trap sink is a combination of trap sink address, username and
authentication information
ncli> snmp add-trap username address { port } { protocol } { engine-id } { inform }
Required arguments
username
Identity of an snmp user
address
Address of an snmp trap sink. This should be an IP address or FQDN
Optional arguments
port
Port number on which an snmp agent listens for requests or on which a trap sink is waiting traps
Add an snmp user along with its authentication and privacy keys
ncli> snmp add-user username auth-key auth-type { priv-key } { priv-type }
Required arguments
username
Identity of an snmp user
auth-key
Authentication key for an snmp user
auth-type
Authentication type for snmp user. Can be MD_5 or SHA
Optional arguments
priv-key
Encryption key for an snmp user
priv-type
Encryption type for an snmp user. Can be DES or AES
Edit one of the trap sinks from the list of trap sinks. Editable properties are username, authentication and privacy
settings and protocol
ncli> snmp { edit-trap | update-trap } address { port } { protocol } { engine-id } {
inform }
Required arguments
address
Address of an snmp trap sink. This should be an IP address or FQDN
Optional arguments
port
Port number on which an snmp agent listens for requests or on which a trap sink is waiting traps
protocol
Protocol for the snmp agent or trap sink. Currently supported protocols are UDP, TCP and
UDP_6
engine-id
Engine id of the snmp trap sink. This must be a hex string starting with 0x
inform
Flag that specifies whether a trap sink is actually an inform sink
List all the transports specified for the snmp agent. Each transport is a protocol:port pair
ncli> snmp { list-transports | ls-transports }
Required arguments
None
List all the configured trap sinks along with their user information.
ncli> snmp { list-traps | ls-traps } { address }
Required arguments
None
Optional arguments
address
Address of an snmp trap sink. This should be an IP address or FQDN
Lists all the snmp users along with their properties like authentication and privacy information
ncli> snmp { list-users | ls-users } { username }
Required arguments
None
Optional arguments
username
Identity of an snmp user
Alias sp
Alias tier
user: User
Description A User
Alias None
Operations • change-password
• create | add
• delete | remove rm
• disable
• edit | update
• enable
• grant-cluster-admin-role
• grant-user-admin-role
• list | ls
• reset-password
• revoke-cluster-admin-role
• revoke-user-admin-role
• show-profile
Delete a User
ncli> user { delete | remove rm } user-name
Required arguments
user-name
User name of the user
Disable a User
ncli> user disable user-name
Required arguments
user-name
User name of the user
Edit a User
ncli> user { edit | update } user-name { first-name } { last-name } { middle-initial }
{ email-id }
Required arguments
user-name
User name of the user
Enable a User
ncli> user enable user-name
Required arguments
user-name
User name of the user
List Users
ncli> user { list | ls } { user-name }
Required arguments
None
Optional arguments
user-name
User name of the user
Alias None
Operations • clone
• create | add
• edit | update
• list | ls
• list-snapshots | ls-snaps
• list-stats | ls-stats
• remove | rm
• snapshot | snap
List Snapshots
ncli> vdisk { list-snapshots | ls-snaps } name
Alias vm
Operations • list | ls
• list-stats | ls-stats
vzone: vZone
Description A vZone
Alias None
Operations • add-hosts
• add-vdisks
• create | add
• list | ls
• remove | rm
• remove-all-vdisks
• remove-hosts
• remove-vdisks
• sync-haclusters
List vZones
ncli> vzone { list | ls } { name }
Required arguments
None
Optional arguments
name
Name of the vZone
Delete avZone
ncli> vzone { remove | rm } name
Required arguments
name
Name of the vZone
vstore: VStore
Description A file namespace in a container
Alias None
List VStores
ncli> vstore { list | ls } { id } { name }
Required arguments
None
Optional arguments
id
ID of a VStore
name
Name of a VStore
Protect a VStore. Files in a protected VStore are replicated to a Remote Site at a defined frequency and these
protected files can be recovered in the event of a disaster
ncli> vstore protect { id } { name }
Delete a VStore
ncli> vstore { remove | rm } { id } { name } { force }
Required arguments
None
Optional arguments
id
ID of a VStore
name
Name of a VStore
force
Delete a VStore
Default: false
Unprotect a VStore
ncli> vstore unprotect { id } { name }
Required arguments
None
Optional arguments
id
ID of a VStore
name
Name of a VStore