Sep 01 2016

Create & Configure Nutanix Cluster via command line

Updated 2018-01-18: Updated Directory Authentication section to match AOS 5.5 requirements.

Updated 2017-09-06: Updated to include local PRISM users

Updated 2017-05-31: Updated to include Network Visualization

Updated 2017-05-31: Updated to include configure External Data Services IP address

Updated 2017-05-31: Updated the section where a new container is created and changed inline compression to post compression, see section here.

Updated 2017-03-02: Mounting Nutanix Container to ESXi hosts

Updated 2017-01-28: Change Nutanix Cluster admin user password


I have received a few questions about creating and configure a Nutanix cluster via cli. Since i’m doing that pretty much one-two times per quarter when changing hypervisor in my cluster i figure i can share the commands i’m using.

You can create a bash script with static parameters or with user interaction requirements but the below is just plain text you can copy into any CVMs shell.

Create the Nutanix Cluster

This is really simple and takes only one command. The only pre req is that you have set IP address of the CVMs eth0 interface.

Important: Use the script at the end of the blog post so you don’t need to copy and paste each section individually. Find the Configuration Script here.

You run the cluster create command and in my example below i have added some parameters available during the creation process:

  •  –redundancy_factor – with the two options 2 or 3 (requires min 5 Nutanix nodes).
  • –cluster_name – The Nutanix cluster name
  • –cluster_external_ip – The Nutanix cluster IP address
  • –dns_servers – IP to the DNS servers
  • –ntp_servers – FQDN to the NTP servers

Configure the Nutanix Cluster

The following section contains the a mix of parameters i use in my cluster and parameters i use during Nutanix cluster implementations.

  • Set time zone
  • Set new Nutanix Cluster Admin password
  • Add local PRISM users with – will be added with read only permissions
  • Grant the newly created user the User Admin Role
  •  Set External Data Services IP Address
  • Configure directory authentication
  • Add Active Directory group to PRISM with user admin rights
  • Set SMTP Configuration
  • Enable syslog with level warning for all components
  • Set proxy server
  • Set proxy server whitelist. Good if you use e.g. PRISM Central and don’t need Proxy to reach it
  • Enable pulse
  • Enable email alerts
  • Configure Network Visualization
    • SNMP Profile using SNMP version 2
    • Switch Configuration adding 3 AHV Hosts
  • Get Storage Pool name
  • Get Default Container name
  • Delete default container
  • Create container with name ctr01, post compression turned on with 60 min delay and replication factor set to 2.
  • If running ESXi you might want to mount the container as a NFS datastore to the ESXi hosts in the cluster. If so, use the following command:

    • If you want to mount the container to a specific set of ESXi hosts you need to provide the host-ids which you can find by running the following command from any CVM in the Nutanix Cluster.

      The above command will display an output according to the below figure where the first output lists both the ESXi host Name and ID and the second part just lists the ESXi host Id which you need.
    • If you want to mount the Container to the A & C ESXi host you run the following command:

So that’s about it. Anything you normally use and you want me to add, please let me know.

If not, happy Nutanix cluster creation & configuration:)

Configuration Script

—– Same thing as above but without any unnecessary text —–



Skip to comment form

  1. charles

    Hi ! thx Guy cool stuff to be reuse 🙂
    I just have 1 question, I can’t find how to configure a CTR with a list of hypervisor ? it will dramatically help my automatic installation stuff 😉

    sheers (and happy new year).

    Thomas CHARLES

  2. magander3

    guess you are talking about mounting the container to ESXi hosts? if so you can run the hostssh command and use esxcli to mount the container to each ESXi host.

    make sense?


  3. charles

    that’s perferctly making sense,

    hoped it was somewhat coded on the ncli command 😉

    thx !


  4. magander3

    perfect. lemme know if you run into any problems.


  5. magander3

    guess you can try the following as well:
    ncli datastore { create | add} ctr-name=”container_name” [name=”datastore_name” ] [host-ids=”host_ids” ] [read-only=”{ true | false }” ]


  6. magander3

    Hi, I have updated the script to include the mount command from CVM now


Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">