If you don’t know Nutanix Cluster Check (NCC), you can read more about it here and here . NCC is one of the most critical tools to detect any problems in your Nutanix platform, so it is important to keep it up to date.
When a new NCC version is released, you need to connect to each Nutanix cluster and upgrade NCC by using either the Prism web console or Life Cycle Manager.
- Log on to the Prism web console and click the gear icon.
- Click Upgrade Software, then click NCC in the dialog box.
- Click Upgrade Available and then click Download
- When the download process is completed, Click Upgrade, then click Yes to confirm.
We need to automate this NCC upgrade task and make day 2 operational easier. OK, so the question now is how do we automate it?
The target solution must be one-liners command and all clusters will be updated with the latest NCC version and for that, no other solution can help us like Ansible.
As you know, Ansible works with a list of hosts in the inventory file. Besides adding one CVM from each cluster, your file will be like this:
The last step is the creation of a secure password file. It contains the admin password to access the prism element. For that, you can use Ansible Vault.
ansible-vault create cvm_creds.yaml
Below, we have our NCC upgrade Ansible playbook, which is composed of 3 tasks.
All these tasks can be done leveraging rest API calls, this is why we will use the URI module.
The Ansible playbook is available on GitHub repo.
Feel free to modify or suggest any improvements.