Automate Nutanix cluster deployment

Shares

Automation is everywhere, in the public cloud, private cloud, security, software development, sysadmin day to day tasks. Basically, any repeatable task is usually automated one way or another. In this post, I will show you how to automate Nutanix cluster deployment using Postman and Nutanix Foundation.

Automate Nutanix cluster deployment using Postman

Before we start, below are few requirements you have to meet.

The Nutanix foundation API documentation can be found on www.nutanix.dev portal under API reference subcategory. In fact, on the portal, you can find documentation for all Nutanix products where API is available like Nutanix Era, Nutanix Karbon and more.

https://www.nutanix.dev/reference/foundation/

Let check how does this work. Below you can find few examples of API calls from Postman to Foundation VM (standalone Foundation outside of Nutanix cluster)

List AOS packages available on Nutanix foundation

192.168.1.63:8000/foundation/enumerate_nos_packages
[
    "nutanix_installer_package-release-euphrates-5.16.1.2-stable-x86_64.tar",
    "nutanix_installer_package-release-euphrates-5.17.1.3-stable-x86_64.tar.gz"
]

List hypervisor packages available on Nutanix foundation

192.168.1.63:8000/foundation/enumerate_hypervisor_isos
{
    "linux": [],
    "hyperv": [],
    "kvm": [
        {
            "supported": true,
            "filename": "AHV bundled with AOS (version 4.6+)"
        }
    ],
    "xen": [],
    "esx": [
        {
            "supported": true,
            "filename": "VMware-VMvisor-Installer-6.7.0.update01-10302608.x86_64.iso"
        },
        {
            "supported": true,
            "filename": "VMware-VMvisor-Installer-6.5.0.update01-5969303.x86_64.iso"
        },
        {
            "supported": true,
            "filename": "VMware-VMvisor-Installer-7.0.0-15843807.x86_64.iso"
        }
    ]
}

Let’s get started. The API call for imaging Nutanix clusters is /foundation/image_nodes

192.168.1.63:8000/foundation/image_nodes

You have to include JSON as part of the API call. To do it, you have to click on the BODY and choose RAW as the data format.
NOTE: make sure you change the request to POST (top left corner). You can watch the video I recorded to see the whole process step by step (at the bottom of the post).

Postman API call with JSON file in BODY

When you click send, you can switch to the Nutanix Foundation web console to watch deployment progress. Cluster deployment takes from 45 minutes (For Nutanix AHV) to 2h (with Microsoft Hyper-V).

Nutanix Foundation process completed

Youtube video – automate nutanix cluster deployment with Postman

Below you can find JSON file I used in the video above.

{
  "cvm_netmask": "255.255.255.0", 
  "ui_platform": "nutanix_nx", 
  "hypervisor_iso": {}, 
  "ipmi_netmask": "255.255.255.0", 
  "rdma_passthrough": false, 
  "bond_lacp_rate": null, 
  "ucsm_managed_mode": false, 
  "ui_skip_network_check": true, 
  "ui_is_installing_hypervisor": true, 
  "clusters": [
    {
      "enable_ns": false, 
      "cluster_external_ip": "192.168.1.45", 
      "cluster_init_successful": null, 
      "redundancy_factor": 2, 
      "cluster_name": "homelab01", 
      "cvm_ntp_servers": "0.us.pool.ntp.org", 
      "timezone": "America/New_York", 
      "cluster_members": [
        "192.168.1.40", 
        "192.168.1.41", 
        "192.168.1.42"
      ], 
      "cvm_dns_servers": "192.168.1.1", 
      "cluster_init_now": true
    }
  ], 
  "hyperv_sku": null, 
  "blocks": [
    {
      "nodes": [
        {
          "ipv6_address": null, 
          "svm_ip": "192.168.1.40", 
          "cluster_id": 16626, 
          "is_bare_metal": true, 
          "image_successful": true, 
          "ipv6_interface": null, 
          "foundation_version": "foundation-4.5.2-a98fe48a", 
          "image_now": true, 
          "ui_node_id": "27b74a86-739c-459a-9e3e-611b13778e0e", 
          "nos_version": "5.16.1.1", 
          "ipmi_ip": "192.168.1.20", 
          "hardware_attributes_override": {}, 
          "node_position": "A", 
          "configured": false, 
          "block_id": null, 
          "is_selected": true, 
          "hypervisor_hostname": "ntnx01", 
          "cvm_gb_ram": 24, 
          "ui_existing_hypervisor": "kvm", 
          "ipmi_password": "ADMIN", 
          "hypervisor_version": "el6.nutanix.20170830.337", 
          "ipmi_configure_now": false, 
          "hypervisor_ip": "192.168.1.30", 
          "ipmi_user": "ADMIN", 
          "ipmi_mac": "0C:C4:7A:0C:F3:44", 
          "current_network_interface": "eth0", 
          "hypervisor": "kvm", 
          "attributes": {}, 
          "cvm_ip": "192.168.1.40"
        }, 
        {
          "ipv6_address": null, 
          "svm_ip": "192.168.1.41", 
          "cluster_id": 16626, 
          "is_bare_metal": true, 
          "image_successful": true, 
          "ipv6_interface": null, 
          "foundation_version": "foundation-4.5.2-a98fe48a", 
          "image_now": true, 
          "ui_node_id": "7f65293d-1982-4d3e-bf8b-ce6e7582756d", 
          "nos_version": "5.16.1.1", 
          "ipmi_ip": "192.168.1.21", 
          "hardware_attributes_override": {}, 
          "node_position": "B", 
          "configured": false, 
          "block_id": null, 
          "is_selected": true, 
          "hypervisor_hostname": "ntnx02", 
          "cvm_gb_ram": 24, 
          "ui_existing_hypervisor": "kvm", 
          "ipmi_password": "ADMIN", 
          "hypervisor_version": "el6.nutanix.20170830.337", 
          "ipmi_configure_now": false, 
          "hypervisor_ip": "192.168.1.31", 
          "ipmi_user": "ADMIN", 
          "ipmi_mac": "0C:C4:7A:0C:F3:E3", 
          "current_network_interface": "eth0", 
          "hypervisor": "kvm", 
          "attributes": {}, 
          "cvm_ip": "192.168.1.41"
        }, 
        {
          "ipv6_address": null, 
          "svm_ip": "192.168.1.42", 
          "cluster_id": 16626, 
          "is_bare_metal": true, 
          "image_successful": true, 
          "ipv6_interface": null, 
          "foundation_version": "foundation-4.5.2-a98fe48a", 
          "image_now": true, 
          "ui_node_id": "953f8d9a-0b71-4555-ae74-ca6d7306ec73", 
          "nos_version": "5.16.1.1", 
          "ipmi_ip": "192.168.1.22", 
          "hardware_attributes_override": {}, 
          "node_position": "C", 
          "configured": false, 
          "block_id": null, 
          "is_selected": true, 
          "hypervisor_hostname": "ntnx03", 
          "cvm_gb_ram": 24, 
          "ui_existing_hypervisor": "kvm", 
          "ipmi_password": "ADMIN", 
          "hypervisor_version": "el6.nutanix.20170830.337", 
          "ipmi_configure_now": false, 
          "hypervisor_ip": "192.168.1.32", 
          "ipmi_user": "ADMIN", 
          "ipmi_mac": "0C:C4:7A:0C:F3:D3", 
          "current_network_interface": "eth0", 
          "hypervisor": "kvm", 
          "attributes": {}, 
          "cvm_ip": "192.168.1.42"
        }
      ], 
      "ui_block_id": "14SM12320036", 
      "ui_model": "NX-1020", 
      "block_id": "14SM12320036", 
      "chassis_n": null
    }
  ], 
  "ui_is_installing_cvm": true, 
  "bond_mode": "", 
  "ipmi_gateway": "192.168.1.1", 
  "cvm_gateway": "192.168.1.1", 
  "ui_ucsm_keep_settings": false, 
  "ui_is_installing_secondary_hypervisor": false, 
  "hypervisor": "kvm", 
  "session_id": "20201016-121737-1", 
  "hypervisor_netmask": "255.255.255.0", 
  "is_imaging": true, 
  "hypervisor_gateway": "192.168.1.1", 
  "nos_package": "/home/nutanix/foundation/nos/nutanix_installer_package-release-euphrates-5.17.1.3-stable-x86_64.tar.gz"
}
5 1 vote
Article Rating

Artur Krzywdzinski

Artur is Consulting Architect at Nutanix. He has been using, designing and deploying VMware based solutions since 2005 and Microsoft since 2012. He specialize in designing and implementing private and hybrid cloud solution based on VMware and Microsoft software stacks, datacenter migrations and transformation, disaster avoidance. Artur holds VMware Certified Design Expert certification (VCDX #077).

You may also like...

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x

FOR FREE. Download Nutanix port diagrams

Join our mailing list to receive an email with instructions on how to download 19 port diagrams in MS Visio format.

NOTE: if you do not get an email within 1h, check your SPAM filters

You have Successfully Subscribed!

Pin It on Pinterest