Nutanix Cluster Expansion Using Ansible

Introduction

Scaling a Nutanix cluster manually via Prism is fine for one-off events, but enterprise and edge environments demand repeatable, secure automation. This guide shows how to onboard new nodes to a Nutanix cluster using Ansible. With a single playbook, you can add multiple hosts, validate their state, and complete your cluster expansion.


My Personal Repository on GitHub

Nutanix Repository on GitHub


Diagram: Cluster Expansion with Ansible


Use Case

  • Automate node addition at scale
  • Repeatable node joins for edge rollouts
  • Validate post-join status (optional)

YAML Input File: node_list.yml

nodes:
- ip: 10.10.10.11
hostname: node4
rackable_unit_serial: NX-AAA111
- ip: 10.10.10.12
hostname: node5
rackable_unit_serial: NX-BBB222

Playbook: add_nodes.yml

- name: Add Nutanix hosts to cluster
hosts: localhost
gather_facts: false
collections:
- nutanix.ncp
vars_files:
- nutanix_credentials.yml
- node_list.yml
tasks:

- name: Add each node to the cluster
loop: "{{ nodes }}"
loop_control:
loop_var: node
nutanix.ncp.hosts:
state: present
ip_address: "{{ node.ip }}"
hostname: "{{ node.hostname }}"
rackable_unit_serial: "{{ node.rackable_unit_serial }}"
cluster_name: "prod-cluster"

Execute It

ansible-playbook add_nodes.yml --ask-vault-pass -i inventory.yml

Optional: Validate Join

After addition, list hosts to confirm:

ncli host list

Or include a follow-up nutanix.ncp.hosts_info task in the playbook.


Summary

Cluster expansion with Ansible gives you structured, repeatable scaling across Nutanix environments. From edge deployments to production datacenters, this method improves reliability and auditability when growing infrastructure.

External Documentation:

Leave a Reply

Discover more from Digital Thought Disruption

Subscribe now to keep reading and get access to the full archive.

Continue reading