Clusters APIs

Clusters APIs

APIs for managing Clusters

Table of Contents

1. Create a Cluster

After you add the primary cluster, you can add more clusters to expand the domain.

1.1. Prerequisites

  • The following data is required

    • ID of the domain in which the cluster is to be created

    • Cluster details

      • Name of the cluster

      • Hosts details

        • ID of the host (UUID)

        • License key for the host

        • List of VDS names to associate with host

        • ID of the vmNic host to be associated with VDS / N-VDS, once added to cluster

      • Datastore details

Note : Only one of "vsanDatastoreSpec" (For VSAN), "nfsDatastoreSpec" (For NFS) or "vmfsDatastoreSpec" (For VMFS on FC) or vvolDatastoreSpec (For VVOL) or vsanRemoteDatastoreClusterSpec (For vSAN HCI Mesh Remote Datastore) must be specified.

  * For VSAN

    * Number of host failures to tolerate (can be 0, 1, or 2)

    * License key for the vSAN datastore

    * Esa Config to enable vSAN ESA

          {
            "vsanDatastoreSpec" : {
              "failuresToTolerate" : 1,
              "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
              "esaConfig" : {
                "enabled" : false
              },
              "datastoreName" : "sfo-w01-cl01-ds-vsan01"
            }
          }

  * For NFS

    * List of NFS server names

    * Shared directory path

    * User tag used to annotate NFS share

    * Boolean to identify if the mount directory should be read-only

          {
            "nfsDatastoreSpecs" : [ {
              "nasVolume" : {
                "serverName" : [ "10.0.0.250" ],
                "path" : "/nfs_mount/my_read_write_folder",
                "readOnly" : false
              },
              "datastoreName" : "sfo-w01-cl01-ds-nfs01"
            } ]
          }

  * For VMFS on FC

    * Ensure that the ESXi hosts have the given VMFS on FC datastore name configured.

        {
          "vmfsDatastoreSpec" : {
            "fcSpec" : [ {
              "datastoreName" : "sfo-w01-cl01-ds-fc01"
            } ]
          }
        }

  * For VVOL, Ensure that the ESXi hosts have the given VVOL datastore name configured.

    * Vasa provider guid

    * Vasa container guid

    * Protocol type for vVol container

    * Vasa user guid

          {
            "vvolDatastoreSpecs" : [ {
              "name" : "sfo-w01-cl01-ds-vvol01",
              "vasaProviderSpec" : {
                "vasaProviderId" : "42de6c36-e85e-483b-89c1-4aee5e8deebe",
                "storageContainerId" : "908ce3e4-4e8d-414b-84e7-847ba9883521",
                "storageProtocolType" : "ISCSI",
                "userId" : "d0ed4dd6-1375-4b12-af8c-96c18c46d319"
              }
            } ]
          }

  * For vSAN HCI Mesh Compute Only Cluster

    * vSAN datastore uuid of the server datastore

  {
    "vsanRemoteDatastoreClusterSpec" : {
      "vsanRemoteDatastoreSpec" : [ {
        "datastoreUuid" : "c83f081533b449e1-a1673ed0afdcc7d9"
      } ]
    }
  }
  • Network Details

    • List of VDS details, For each VDS

      • Port group names and the corresponding transport type. Note that EDGE_INFRA_OVERLAY_UPLINK, VREALIZE should not be specified in the input spec. Multiple port groups with transport type PUBLIC can be created.

      • DVS host Infrastructure traffic resource type

      • Maximum allowed usage for a traffic class

      • Amount of bandwidth to be reserved for the host infrastructure traffic class

      • The list of transport zone(s) to be associated with the vSphere Distributed Switch managed by NSX. The supported transport types are OVERLAY and VLAN.

        [ {
          "name" : "sfo-w01-cl01-vds01",
          "portGroupSpecs" : [ {
            "name" : "sfo-w01-cl01-vds01-pg-mgmt",
            "transportType" : "MANAGEMENT",
            "activeUplinks" : [ "uplink1", "uplink2" ],
            "teamingPolicy" : "loadbalance_ip"
          }, {
            "name" : "sfo-w01-cl01-vds01-pg-vsan",
            "transportType" : "VSAN",
            "activeUplinks" : [ "uplink1" ],
            "standByUplinks" : [ "uplink2" ],
            "teamingPolicy" : "loadbalance_loadbased"
          }, {
            "name" : "sfo-w01-cl01-vds01-pg-vmotion",
            "transportType" : "VMOTION",
            "activeUplinks" : [ "uplink2" ],
            "standByUplinks" : [ "uplink1" ],
            "teamingPolicy" : "loadbalance_srcmac"
          } ],
          "mtu" : 9000
        }, {
          "name" : "sfo-w01-cl01-vds02",
          "nsxtSwitchConfig" : {
            "transportZones" : [ {
              "name" : "sfo-w01-nsx-overlay",
              "transportType" : "OVERLAY"
            }, {
              "name" : "sfo-w01-nsx-vlan01",
              "transportType" : "VLAN"
            } ],
            "hostSwitchOperationalMode" : "STANDARD"
          },
          "mtu" : 9000
        } ]
        
    • NSX cluster Details

      • For each vSphere Distributed Switch that is managed by NSX UplinkProfile needs to be defined inside nsxTClusterSpec . For DHCP transportVlan needs to be provided inside UplinkProfile

        {
          "nsxTClusterSpec" : {
            "uplinkProfiles" : [ {
              "name" : "Uplink-Profile-1",
              "teamings" : [ {
                "policy" : "FAILOVER_ORDER",
                "activeUplinks" : [ "uplink-1" ],
                "standByUplinks" : [ "uplink-2" ]
              } ],
              "transportVlan" : 2
            } ]
          }
        }
        
      • TEP IP assignment can be done from the Static IP pool. For creating a new IP pool during the domain creation

        {
          "nsxTClusterSpec" : {
            "ipAddressPoolsSpec" : [ {
              "name" : "static-ip-pool-01",
              "subnets" : [ {
                "ipAddressPoolRanges" : [ {
                  "start" : "10.0.11.50",
                  "end" : "10.0.11.70"
                }, {
                  "start" : "10.0.11.80",
                  "end" : "10.0.11.150"
                } ],
                "cidr" : "10.0.11.0/24",
                "gateway" : "10.0.11.250"
              } ]
            } ],
            "uplinkProfiles" : [ {
              "name" : "Uplink-Profile-1",
              "teamings" : [ {
                "policy" : "FAILOVER_ORDER",
                "activeUplinks" : [ "uplink-1" ],
                "standByUplinks" : [ "uplink-2" ]
              } ],
              "transportVlan" : 2
            } ]
          }
        }
        
      • For using an existing IP pool during the domain creation

        {
          "nsxTClusterSpec" : {
            "ipAddressPoolsSpec" : [ {
              "name" : "static-ip-pool-01"
            } ],
            "uplinkProfiles" : [ {
              "name" : "Uplink-Profile-1",
              "teamings" : [ {
                "policy" : "FAILOVER_ORDER",
                "activeUplinks" : [ "uplink-1" ],
                "standByUplinks" : [ "uplink-2" ]
              } ],
              "transportVlan" : 2
            } ]
          }
        }
        

Note : To create a new IP address pool during domain creation, "subnets" , the list of IpAddressPoolSubnetSpec in the input spec must not be empty. Only the IP address pool name has to be sent in the input spec while using an existing IP address pool.

* Once vSphere Distributed Switch, Uplink Profiles and IP Address Pools Spec are defined, they need to be associated in *networkProfiles* in *networkSpec*

      [ {
        "name" : "Cluster-1-network-profile01",
        "isDefault" : true,
        "nsxtHostSwitchConfigs" : [ {
          "vdsName" : "sfo-w01-cl01-vds02",
          "uplinkProfileName" : "Uplink-Profile-1",
          "ipAddressPoolName" : "static-ip-pool-01",
          "vdsUplinkToNsxUplink" : [ {
            "vdsUplinkName" : "uplink1",
            "nsxUplinkName" : "uplink-1"
          }, {
            "vdsUplinkName" : "uplink2",
            "nsxUplinkName" : "uplink-2"
          } ]
        } ]
      } ]

Note : In case of multiple profiles, the profile name needs to be referred in networkProfileName in HostNetworkSpec.

  • Network pool must be configured.

  • Logical VMware Cloud Foundation container (Workload Domain) must be provisioned.

Note : NSX management cluster is configured when the domain is created.

  • Prerequisites for vSAN, NFS or VMFS on FC or VVOL must be met.

  • License key details may be provisioned in vCenter.

  • Host configuration must have minimum two active vmNics.

  • There must be at least three hosts available in the VMware Cloud Foundation inventory.

  • Ensure that the hosts you want to add to the cluster are in UNASSIGNED_USEABLE state.

  • You must have valid host and vSAN (if using vSAN storage) license key specified with adequate sockets available for the host to be added.

  • A DHCP server must be configured on the Geneve VLAN of the respective domains. When NSX creates VTEPs for the hosts in the domain, they are assigned IP addresses from the DHCP server.

  • Evaluate if you want to have pNICs on multiple vSphere Distributed Switches in the NSX domain. At least two pNICs are needed on a single switch. Below is a spec sample:

    {
      "vmNics" : [ {
        "id" : "vmnic0",
        "vdsName" : "sfo-w01-cl01-vds01",
        "uplink" : "uplink1"
      }, {
        "id" : "vmnic1",
        "vdsName" : "sfo-w01-cl01-vds01",
        "uplink" : "uplink2"
      }, {
        "id" : "vmnic2",
        "vdsName" : "sfo-w01-cl01-vds02",
        "uplink" : "uplink1"
      }, {
        "id" : "vmnic3",
        "vdsName" : "sfo-w01-cl01-vds02",
        "uplink" : "uplink2"
      } ]
    }
    

1.2. Steps

  • Validate the input specification.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/validations' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "domainId" : "7844dfe6-773b-4a59-ba0b-40252b48f3f2",
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "sfo-w01-cl02",
      "hostSpecs" : [ {
        "id" : "0de131ef-b0bc-4a07-a365-c13ab53cec33",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink2"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink2"
          } ]
        }
      }, {
        "id" : "53348f24-dd48-410a-9eab-76198413d251",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink2"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink2"
          } ]
        }
      }, {
        "id" : "bbd8c904-6c76-42e4-917e-f4dd147a5edc",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink2"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink2"
          } ]
        }
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXX-XXXX",
          "datastoreName" : "sfo-w01-cl02-ds-vsan01"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "sfo-w01-cl02-vds01",
          "portGroupSpecs" : [ {
            "name" : "sfo-w01-cl02-vds01-pg-mgmt",
            "transportType" : "MANAGEMENT",
            "activeUplinks" : [ "uplink1", "uplink2" ],
            "teamingPolicy" : "loadbalance_loadbased"
          }, {
            "name" : "sfo-w01-cl02-vds01-pg-vsan",
            "transportType" : "VSAN",
            "activeUplinks" : [ "uplink1", "uplink2" ],
            "teamingPolicy" : "loadbalance_loadbased"
          }, {
            "name" : "sfo-w01-cl02-vds01-pg-vmotion",
            "transportType" : "VMOTION",
            "activeUplinks" : [ "uplink1", "uplink2" ],
            "teamingPolicy" : "loadbalance_loadbased"
          } ],
          "mtu" : 9000
        }, {
          "name" : "sfo-w01-cl02-vds02",
          "nsxtSwitchConfig" : {
            "transportZones" : [ {
              "name" : "sfo-m01-tz-vlan01",
              "transportType" : "VLAN"
            }, {
              "name" : "sfo-m01-tz-overlay01",
              "transportType" : "OVERLAY"
            } ]
          },
          "mtu" : 9000
        } ],
        "nsxClusterSpec" : {
          "nsxTClusterSpec" : {
            "uplinkProfiles" : [ {
              "name" : "Uplink-Profile-1",
              "teamings" : [ {
                "policy" : "FAILOVER_ORDER",
                "activeUplinks" : [ "uplink-1" ],
                "standByUplinks" : [ "uplink-2" ]
              } ],
              "transportVlan" : 2
            } ]
          }
        },
        "networkProfiles" : [ {
          "name" : "sfo-w01-cl02-network-profile01",
          "isDefault" : true,
          "nsxtHostSwitchConfigs" : [ {
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplinkProfileName" : "Uplink-Profile-1",
            "vdsUplinkToNsxUplink" : [ {
              "vdsUplinkName" : "uplink1",
              "nsxUplinkName" : "uplink-1"
            }, {
              "vdsUplinkName" : "uplink2",
              "nsxUplinkName" : "uplink-2"
            } ]
          } ]
        } ]
      },
      "advancedOptions" : {
        "evcMode" : "",
        "highAvailability" : {
          "enabled" : false
        }
      }
    } ],
    "skipFailedHosts" : false
  }
}'

HTTP Request

POST /v1/clusters/validations HTTP/1.1
Content-Type: application/json
Content-Length: 4774
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "domainId" : "7844dfe6-773b-4a59-ba0b-40252b48f3f2",
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "sfo-w01-cl02",
      "hostSpecs" : [ {
        "id" : "0de131ef-b0bc-4a07-a365-c13ab53cec33",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink2"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink2"
          } ]
        }
      }, {
        "id" : "53348f24-dd48-410a-9eab-76198413d251",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink2"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink2"
          } ]
        }
      }, {
        "id" : "bbd8c904-6c76-42e4-917e-f4dd147a5edc",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink2"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink2"
          } ]
        }
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXX-XXXX",
          "datastoreName" : "sfo-w01-cl02-ds-vsan01"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "sfo-w01-cl02-vds01",
          "portGroupSpecs" : [ {
            "name" : "sfo-w01-cl02-vds01-pg-mgmt",
            "transportType" : "MANAGEMENT",
            "activeUplinks" : [ "uplink1", "uplink2" ],
            "teamingPolicy" : "loadbalance_loadbased"
          }, {
            "name" : "sfo-w01-cl02-vds01-pg-vsan",
            "transportType" : "VSAN",
            "activeUplinks" : [ "uplink1", "uplink2" ],
            "teamingPolicy" : "loadbalance_loadbased"
          }, {
            "name" : "sfo-w01-cl02-vds01-pg-vmotion",
            "transportType" : "VMOTION",
            "activeUplinks" : [ "uplink1", "uplink2" ],
            "teamingPolicy" : "loadbalance_loadbased"
          } ],
          "mtu" : 9000
        }, {
          "name" : "sfo-w01-cl02-vds02",
          "nsxtSwitchConfig" : {
            "transportZones" : [ {
              "name" : "sfo-m01-tz-vlan01",
              "transportType" : "VLAN"
            }, {
              "name" : "sfo-m01-tz-overlay01",
              "transportType" : "OVERLAY"
            } ]
          },
          "mtu" : 9000
        } ],
        "nsxClusterSpec" : {
          "nsxTClusterSpec" : {
            "uplinkProfiles" : [ {
              "name" : "Uplink-Profile-1",
              "teamings" : [ {
                "policy" : "FAILOVER_ORDER",
                "activeUplinks" : [ "uplink-1" ],
                "standByUplinks" : [ "uplink-2" ]
              } ],
              "transportVlan" : 2
            } ]
          }
        },
        "networkProfiles" : [ {
          "name" : "sfo-w01-cl02-network-profile01",
          "isDefault" : true,
          "nsxtHostSwitchConfigs" : [ {
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplinkProfileName" : "Uplink-Profile-1",
            "vdsUplinkToNsxUplink" : [ {
              "vdsUplinkName" : "uplink1",
              "nsxUplinkName" : "uplink-1"
            }, {
              "vdsUplinkName" : "uplink2",
              "nsxUplinkName" : "uplink-2"
            } ]
          } ]
        } ]
      },
      "advancedOptions" : {
        "evcMode" : "",
        "highAvailability" : {
          "enabled" : false
        }
      }
    } ],
    "skipFailedHosts" : false
  }
}

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 292

{
  "id" : "3a7459fd-50f8-4ac0-b130-c5b6b4ba183d",
  "description" : "Validating Cluster Creation Spec",
  "executionStatus" : "COMPLETED",
  "resultStatus" : "SUCCEEDED",
  "validationChecks" : [ {
    "description" : "ClusterCreationSpecValidation",
    "resultStatus" : "SUCCEEDED"
  } ]
}
  • In case of no errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "SUCCEEDED".

  • In case of errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "FAILED".

Note : Make changes to the input specification and re-validate using a new API invocation.

  • Trigger the task using the valid input specification.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept-Language: zh' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "domainId" : "5da804a6-cd47-4a9f-a3d8-3e4297fd4220",
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "sfo-w01-cl02",
      "hostSpecs" : [ {
        "id" : "be8b5f17-7ab6-44bb-bd42-d5007cf09380",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink2"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink2"
          } ]
        }
      }, {
        "id" : "c4e3ff8d-4119-4599-aa58-9a80c62f43e9",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink2"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink2"
          } ]
        }
      }, {
        "id" : "6a2ea964-1c11-4352-bb0e-778c1c412277",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink2"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink2"
          } ]
        }
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXX-XXXX",
          "datastoreName" : "sfo-w01-cl02-ds-vsan01"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "sfo-w01-cl02-vds01",
          "portGroupSpecs" : [ {
            "name" : "sfo-w01-cl02-vds01-pg-mgmt",
            "transportType" : "MANAGEMENT",
            "activeUplinks" : [ "uplink1", "uplink2" ],
            "teamingPolicy" : "loadbalance_loadbased"
          }, {
            "name" : "sfo-w01-cl02-vds01-pg-vsan",
            "transportType" : "VSAN",
            "activeUplinks" : [ "uplink1", "uplink2" ],
            "teamingPolicy" : "loadbalance_loadbased"
          }, {
            "name" : "sfo-w01-cl02-vds01-pg-vmotion",
            "transportType" : "VMOTION",
            "activeUplinks" : [ "uplink1", "uplink2" ],
            "teamingPolicy" : "loadbalance_loadbased"
          } ],
          "mtu" : 9000
        }, {
          "name" : "sfo-w01-cl02-vds02",
          "nsxtSwitchConfig" : {
            "transportZones" : [ {
              "name" : "sfo-m01-tz-vlan01",
              "transportType" : "VLAN"
            }, {
              "name" : "sfo-m01-tz-overlay01",
              "transportType" : "OVERLAY"
            } ]
          },
          "mtu" : 9000
        } ],
        "nsxClusterSpec" : {
          "nsxTClusterSpec" : {
            "uplinkProfiles" : [ {
              "name" : "Uplink-Profile-1",
              "teamings" : [ {
                "policy" : "FAILOVER_ORDER",
                "activeUplinks" : [ "uplink-1" ],
                "standByUplinks" : [ "uplink-2" ]
              } ],
              "transportVlan" : 2
            } ]
          }
        },
        "networkProfiles" : [ {
          "name" : "sfo-w01-cl02-network-profile01",
          "isDefault" : true,
          "nsxtHostSwitchConfigs" : [ {
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplinkProfileName" : "Uplink-Profile-1",
            "vdsUplinkToNsxUplink" : [ {
              "vdsUplinkName" : "uplink1",
              "nsxUplinkName" : "uplink-1"
            }, {
              "vdsUplinkName" : "uplink2",
              "nsxUplinkName" : "uplink-2"
            } ]
          } ]
        } ]
      },
      "advancedOptions" : {
        "evcMode" : "",
        "highAvailability" : {
          "enabled" : false
        }
      }
    } ],
    "skipFailedHosts" : false
  }
}'

HTTP Request

POST /v1/clusters HTTP/1.1
Content-Type: application/json
Accept-Language: zh
Content-Length: 4774
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "domainId" : "5da804a6-cd47-4a9f-a3d8-3e4297fd4220",
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "sfo-w01-cl02",
      "hostSpecs" : [ {
        "id" : "be8b5f17-7ab6-44bb-bd42-d5007cf09380",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink2"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink2"
          } ]
        }
      }, {
        "id" : "c4e3ff8d-4119-4599-aa58-9a80c62f43e9",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink2"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink2"
          } ]
        }
      }, {
        "id" : "6a2ea964-1c11-4352-bb0e-778c1c412277",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink2"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink2"
          } ]
        }
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXX-XXXX",
          "datastoreName" : "sfo-w01-cl02-ds-vsan01"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "sfo-w01-cl02-vds01",
          "portGroupSpecs" : [ {
            "name" : "sfo-w01-cl02-vds01-pg-mgmt",
            "transportType" : "MANAGEMENT",
            "activeUplinks" : [ "uplink1", "uplink2" ],
            "teamingPolicy" : "loadbalance_loadbased"
          }, {
            "name" : "sfo-w01-cl02-vds01-pg-vsan",
            "transportType" : "VSAN",
            "activeUplinks" : [ "uplink1", "uplink2" ],
            "teamingPolicy" : "loadbalance_loadbased"
          }, {
            "name" : "sfo-w01-cl02-vds01-pg-vmotion",
            "transportType" : "VMOTION",
            "activeUplinks" : [ "uplink1", "uplink2" ],
            "teamingPolicy" : "loadbalance_loadbased"
          } ],
          "mtu" : 9000
        }, {
          "name" : "sfo-w01-cl02-vds02",
          "nsxtSwitchConfig" : {
            "transportZones" : [ {
              "name" : "sfo-m01-tz-vlan01",
              "transportType" : "VLAN"
            }, {
              "name" : "sfo-m01-tz-overlay01",
              "transportType" : "OVERLAY"
            } ]
          },
          "mtu" : 9000
        } ],
        "nsxClusterSpec" : {
          "nsxTClusterSpec" : {
            "uplinkProfiles" : [ {
              "name" : "Uplink-Profile-1",
              "teamings" : [ {
                "policy" : "FAILOVER_ORDER",
                "activeUplinks" : [ "uplink-1" ],
                "standByUplinks" : [ "uplink-2" ]
              } ],
              "transportVlan" : 2
            } ]
          }
        },
        "networkProfiles" : [ {
          "name" : "sfo-w01-cl02-network-profile01",
          "isDefault" : true,
          "nsxtHostSwitchConfigs" : [ {
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplinkProfileName" : "Uplink-Profile-1",
            "vdsUplinkToNsxUplink" : [ {
              "vdsUplinkName" : "uplink1",
              "nsxUplinkName" : "uplink-1"
            }, {
              "vdsUplinkName" : "uplink2",
              "nsxUplinkName" : "uplink-2"
            } ]
          } ]
        } ]
      },
      "advancedOptions" : {
        "evcMode" : "",
        "highAvailability" : {
          "enabled" : false
        }
      }
    } ],
    "skipFailedHosts" : false
  }
}

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/d0c71c07-162e-4ff1-9125-872d533188b6
Content-Length: 166

{
  "id" : "d0c71c07-162e-4ff1-9125-872d533188b6",
  "name" : "Add Cluster Workflow",
  "status" : "IN_PROGRESS",
  "creationTimestamp" : "2023-09-24T01:56:24.356Z"
}
  • Poll the task until "status" is not "IN_PROGRESS" using the "id" from the previous response.

Tip : Refer to: Get a Task.

  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed.

Tip : Refer to: Retry a Task.

2. Get the Clusters

2.1. Prerequisites

None

2.2. Steps

  • Invoke the API.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/clusters HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 7568

{
  "elements" : [ {
    "id" : "8045e44e-974e-4f43-9862-7f0326782655",
    "domain" : {
      "id" : "4fb47280-3beb-46d3-89cf-e5209febb21f"
    },
    "name" : "sfo-m01-cl01",
    "status" : "ACTIVE",
    "hciMeshData" : {
      "name" : "sfo-m01-cl01",
      "isHciMeshEnabled" : true,
      "primaryDataStoreId" : "8045e44e-974e-4f43-9862-7f0326783766",
      "vsanDataStores" : [ "sfo-m01-cl01-ds-vsan01" ],
      "remoteDatastoreInfos" : [ {
        "serverCluster" : "8045e44e-974e-4f43-9862-7f0326784877",
        "remoteDatastore" : "8045e44e-974e-4f43-9862-7f0326785988"
      } ],
      "isServer" : false,
      "isClient" : true,
      "computeOnlyClient" : false,
      "numberOfClients" : 1,
      "numberOfServers" : 1
    },
    "primaryDatastoreName" : "sfo-m01-cl01-ds-vsan01",
    "primaryDatastoreType" : "VSAN",
    "hosts" : [ {
      "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c5"
    }, {
      "id" : "c0703431-6742-470b-9e1d-f9d3bbc9b1c9"
    } ],
    "isStretched" : false,
    "isDefault" : true,
    "failuresToTolerate" : 1,
    "isImageBased" : true,
    "capacity" : {
      "cpu" : {
        "used" : {
          "value" : 9.745999724364296,
          "unit" : "GHz"
        },
        "total" : {
          "value" : 67.03999810397931,
          "unit" : "GHz"
        },
        "numberOfCores" : 32
      },
      "memory" : {
        "used" : {
          "value" : 127.80859375,
          "unit" : "GB"
        },
        "total" : {
          "value" : 312.484375,
          "unit" : "GB"
        }
      },
      "storage" : {
        "used" : {
          "value" : 224.15609374642372,
          "unit" : "GB"
        },
        "total" : {
          "value" : 858.1875,
          "unit" : "GB"
        }
      }
    },
    "vcenter" : {
      "id" : "ed2c9f30-db7f-48d2-9c9c-d38c5d3718e4",
      "fqdn" : "vcenter-1.vrack.vsphere.local",
      "vcInstanceId" : "abe05e93-cffb-41ca-a367-2352f54f815d"
    },
    "managedObjectReferenceId" : "domain-c8"
  }, {
    "id" : "8045e44e-974e-4f43-9862-7f0326782677",
    "domain" : {
      "id" : "4fb47280-3beb-46d3-89cf-e5209febb21f"
    },
    "name" : "sfo-w01-cl01",
    "status" : "ACTIVATING",
    "primaryDatastoreName" : "sfo-w01-cl01-ds-nfs01",
    "primaryDatastoreType" : "NFS",
    "hosts" : [ {
      "id" : "c0703437-6746-470z-9e1c-f9d3bbc9b1c6"
    }, {
      "id" : "c0703431-6742-470t-9e1d-f9d3bbc9b1c1"
    } ],
    "isStretched" : false,
    "isDefault" : true,
    "isImageBased" : false,
    "vcenter" : {
      "id" : "ed2c9f30-db7f-48d2-9c9c-d38c5d3718e4",
      "fqdn" : "vcenter-1.vrack.vsphere.local",
      "vcInstanceId" : "abe05e93-cffb-41ca-a367-2352f54f815d"
    },
    "managedObjectReferenceId" : "domain-c8"
  }, {
    "id" : "8045e44e-974e-4f43-9861-7f0326782633",
    "domain" : {
      "id" : "4fb47280-3beb-46d3-89cf-e5209febb21f"
    },
    "name" : "sfo-w02-cl01",
    "status" : "ERROR",
    "primaryDatastoreName" : "sfo-w02-cl01-ds-nfs01",
    "primaryDatastoreType" : "NFS",
    "hosts" : [ {
      "id" : "c0703437-6746-470e-9e1c-f9d3bbc9b1c3"
    }, {
      "id" : "c0703431-6742-470r-9e1d-f9d3bbc9b1c4"
    } ],
    "isStretched" : false,
    "isDefault" : true,
    "isImageBased" : true,
    "vcenter" : {
      "id" : "ed2c9f30-db7f-48d2-9c9c-d38c5d3718e4",
      "fqdn" : "vcenter-1.vrack.vsphere.local",
      "vcInstanceId" : "abe05e93-cffb-41ca-a367-2352f54f815d"
    },
    "managedObjectReferenceId" : "domain-c8"
  }, {
    "id" : "8045e44e-974e-4f43-9861-7f0326782677",
    "domain" : {
      "id" : "4fb47280-3beb-46d3-89cf-e5209febb21f"
    },
    "name" : "sfo-w03-cl01",
    "status" : "SKIPPED",
    "primaryDatastoreName" : "sfo-w03-cl01-ds-fc01",
    "primaryDatastoreType" : "FC",
    "hosts" : [ {
      "id" : "c0703437-6746-470e-9e2c-f9d3bbc9b1c3"
    }, {
      "id" : "c0703431-6742-460r-9e1d-f9d3bbc9b1c4"
    } ],
    "isStretched" : false,
    "isDefault" : true,
    "isImageBased" : false,
    "vcenter" : {
      "id" : "ed2c9f30-db7f-48d2-9c9c-d38c5d3718e4",
      "fqdn" : "vcenter-1.vrack.vsphere.local",
      "vcInstanceId" : "abe05e93-cffb-41ca-a367-2352f54f815d"
    },
    "managedObjectReferenceId" : "domain-c8"
  }, {
    "id" : "2345e44e-974e-4f43-9862-7f0326782898",
    "domain" : {
      "id" : "4fb47280-3beb-46d3-89cf-e5209febb21f"
    },
    "name" : "sfo-w04-cl01",
    "status" : "DEACTIVATING",
    "primaryDatastoreName" : "sfo-w04-cl01-ds-vsan01",
    "primaryDatastoreType" : "VSAN",
    "hosts" : [ {
      "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c5"
    }, {
      "id" : "c0703431-6742-470b-9e1d-f9d3bbc9b1c9"
    } ],
    "isStretched" : true,
    "isDefault" : true,
    "failuresToTolerate" : 1,
    "isImageBased" : false,
    "vcenter" : {
      "id" : "ed2c9f30-db7f-48d2-9c9c-d38c5d3718e4",
      "fqdn" : "vcenter-1.vrack.vsphere.local",
      "vcInstanceId" : "abe05e93-cffb-41ca-a367-2352f54f815d"
    },
    "managedObjectReferenceId" : "domain-c8"
  }, {
    "id" : "2345e44e-974e-4f43-9862-7f0326782899",
    "domain" : {
      "id" : "4fb47280-3beb-46d3-89cf-e5209febb21f"
    },
    "name" : "sfo-w05-cl01",
    "status" : "CREATING",
    "primaryDatastoreName" : "sfo-w05-cl01-ds-vsan01",
    "primaryDatastoreType" : "VSAN_ESA",
    "hosts" : [ {
      "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c7"
    }, {
      "id" : "c0703431-6742-470b-9e1d-f9d3bbc9b1c7"
    } ],
    "isStretched" : false,
    "isDefault" : true,
    "failuresToTolerate" : 1,
    "isImageBased" : true,
    "vcenter" : {
      "id" : "ed2c9f30-db7f-48d2-9c9c-d38c5d3718e4",
      "fqdn" : "vcenter-1.vrack.vsphere.local",
      "vcInstanceId" : "abe05e93-cffb-41ca-a367-2352f54f815d"
    },
    "managedObjectReferenceId" : "domain-c8"
  }, {
    "id" : "8045e44e-974e-4f43-9862-7f0326782655",
    "domain" : {
      "id" : "4fb47280-3beb-46d3-89cf-e5209febb21f"
    },
    "name" : "sfo-m01-cl01",
    "status" : "ACTIVE",
    "hciMeshData" : {
      "name" : "sfo-m01-cl01",
      "isHciMeshEnabled" : true,
      "primaryDataStoreId" : "8045e44e-974e-4f43-9862-7f0326783766",
      "vsanDataStores" : [ "sfo-m01-cl01-ds-vsan01" ],
      "clientClusters" : [ "client-cluster" ],
      "isServer" : true,
      "isClient" : false,
      "computeOnlyClient" : false,
      "numberOfClients" : 1,
      "numberOfServers" : 1
    },
    "primaryDatastoreName" : "sfo-m01-cl01-ds-vsan01",
    "primaryDatastoreType" : "VSAN",
    "hosts" : [ {
      "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c5"
    }, {
      "id" : "c0703431-6742-470b-9e1d-f9d3bbc9b1c9"
    } ],
    "isStretched" : false,
    "isDefault" : true,
    "failuresToTolerate" : 1,
    "isImageBased" : true,
    "capacity" : {
      "cpu" : {
        "used" : {
          "value" : 9.745999724364296,
          "unit" : "GHz"
        },
        "total" : {
          "value" : 67.03999810397931,
          "unit" : "GHz"
        },
        "numberOfCores" : 32
      },
      "memory" : {
        "used" : {
          "value" : 127.80859375,
          "unit" : "GB"
        },
        "total" : {
          "value" : 312.484375,
          "unit" : "GB"
        }
      },
      "storage" : {
        "used" : {
          "value" : 224.15609374642372,
          "unit" : "GB"
        },
        "total" : {
          "value" : 858.1875,
          "unit" : "GB"
        }
      }
    },
    "vcenter" : {
      "id" : "ed2c9f30-db7f-48d2-9c9c-d38c5d3718e4",
      "fqdn" : "vcenter-1.vrack.vsphere.local",
      "vcInstanceId" : "abe05e93-cffb-41ca-a367-2352f54f815d"
    },
    "managedObjectReferenceId" : "domain-c8"
  } ]
}

Get the Stretched Clusters

2.3. Prerequisites

None

2.4. Steps

  • Invoke the API.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters?isStretched=true' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/clusters?isStretched=true HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 675

{
  "elements" : [ {
    "id" : "2345e44e-974e-4f43-9862-7f0326782898",
    "domain" : {
      "id" : "4fb47280-3beb-46d3-89cf-e5209febb21f"
    },
    "name" : "sfo-w04-cl01",
    "primaryDatastoreName" : "sfo-w04-cl01-ds-vsan01",
    "primaryDatastoreType" : "VSAN",
    "hosts" : [ {
      "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c5"
    }, {
      "id" : "c0703431-6742-470b-9e1d-f9d3bbc9b1c9"
    } ],
    "isStretched" : true,
    "vcenter" : {
      "id" : "ed2c9f30-db7f-48d2-9c9c-d38c5d3718e4",
      "fqdn" : "vcenter-1.vrack.vsphere.local",
      "vcInstanceId" : "abe05e93-cffb-41ca-a367-2352f54f815d"
    },
    "managedObjectReferenceId" : "domain-c8"
  } ]
}

Get the Vanilla Clusters

2.5. Prerequisites

None

2.6. Steps

  • Invoke the API.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters?isStretched=false' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/clusters?isStretched=false HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2848

{
  "elements" : [ {
    "id" : "8045e44e-974e-4f43-9862-7f0326782655",
    "domain" : {
      "id" : "4fb47280-3beb-46d3-89cf-e5209febb21f"
    },
    "name" : "sfo-m01-cl01",
    "primaryDatastoreName" : "sfo-m01-cl01-ds-vsan01",
    "primaryDatastoreType" : "VSAN",
    "hosts" : [ {
      "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c5"
    }, {
      "id" : "c0703431-6742-470b-9e1d-f9d3bbc9b1c9"
    } ],
    "isStretched" : false,
    "vcenter" : {
      "id" : "ed2c9f30-db7f-48d2-9c9c-d38c5d3718e4",
      "fqdn" : "vcenter-1.vrack.vsphere.local",
      "vcInstanceId" : "abe05e93-cffb-41ca-a367-2352f54f815d"
    },
    "managedObjectReferenceId" : "domain-c8"
  }, {
    "id" : "8045e44e-974e-4f43-9862-7f0326782677",
    "domain" : {
      "id" : "4fb47280-3beb-46d3-89cf-e5209febb21f"
    },
    "name" : "sfo-w01-cl01",
    "primaryDatastoreName" : "sfo-w01-cl01-ds-nfs01",
    "primaryDatastoreType" : "NFS",
    "hosts" : [ {
      "id" : "c0703437-6746-470z-9e1c-f9d3bbc9b1c6"
    }, {
      "id" : "c0703431-6742-470t-9e1d-f9d3bbc9b1c1"
    } ],
    "isStretched" : false,
    "vcenter" : {
      "id" : "ed2c9f30-db7f-48d2-9c9c-d38c5d3718e4"
    },
    "managedObjectReferenceId" : "domain-c8"
  }, {
    "id" : "8045e44e-974e-4f43-9861-7f0326782633",
    "domain" : {
      "id" : "4fb47280-3beb-46d3-89cf-e5209febb21f"
    },
    "name" : "sfo-w02-cl01",
    "primaryDatastoreName" : "sfo-w02-cl01-ds-nfs01",
    "primaryDatastoreType" : "NFS",
    "hosts" : [ {
      "id" : "c0703437-6746-470e-9e1c-f9d3bbc9b1c3"
    }, {
      "id" : "c0703431-6742-470r-9e1d-f9d3bbc9b1c4"
    } ],
    "isStretched" : false,
    "vcenter" : {
      "id" : "ed2c9f30-db7f-48d2-9c9c-d38c5d3718e4"
    },
    "managedObjectReferenceId" : "domain-c8"
  }, {
    "id" : "8045e44e-974e-4f43-9861-7f0326782677",
    "domain" : {
      "id" : "4fb47280-3beb-46d3-89cf-e5209febb21f"
    },
    "name" : "sfo-w03-cl01",
    "primaryDatastoreName" : "sfo-w03-cl01-ds-fc01",
    "primaryDatastoreType" : "FC",
    "hosts" : [ {
      "id" : "c0703437-6746-470e-9e2c-f9d3bbc9b1c3"
    }, {
      "id" : "c0703431-6742-460r-9e1d-f9d3bbc9b1c4"
    } ],
    "isStretched" : false,
    "vcenter" : {
      "id" : "ed2c9f30-db7f-48d2-9c9c-d38c5d3718e4"
    },
    "managedObjectReferenceId" : "domain-c8"
  }, {
    "id" : "8045e44e-974e-4f43-9862-7f0326782688",
    "domain" : {
      "id" : "4fb47280-3beb-46d3-89cf-e5209febb21f"
    },
    "name" : "sfo-w05-cl01",
    "primaryDatastoreName" : "sfo-w05-cl01-ds-vsan01",
    "primaryDatastoreType" : "VSAN_ESA",
    "hosts" : [ {
      "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c7"
    }, {
      "id" : "c0703431-6742-470b-9e1d-f9d3bbc9b1c0"
    } ],
    "isStretched" : false,
    "vcenter" : {
      "id" : "ed2c9f30-db7f-48d2-9c9c-d38c5d3718e4"
    },
    "managedObjectReferenceId" : "domain-c8"
  } ]
}

3. Get a Cluster

3.1. Prerequisites

The following data is required

  • ID of the cluster

3.2. Steps

  • Invoke the API.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/8045e44e-974e-4f43-9862-7f0326782655' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/clusters/8045e44e-974e-4f43-9862-7f0326782655 HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1831

{
  "id" : "8045e44e-974e-4f43-9862-7f0326782655",
  "domain" : {
    "id" : "4fb47280-3beb-46d3-89cf-e5209febb21f"
  },
  "name" : "sfo-m01-cl01",
  "status" : "ACTIVE",
  "hciMeshData" : {
    "name" : "sfo-m01-cl01",
    "isHciMeshEnabled" : true,
    "primaryDataStoreId" : "8045e44e-974e-4f43-9862-7f0326783766",
    "vsanDataStores" : [ "sfo-m01-cl01-ds-vsan01" ],
    "remoteDatastoreInfos" : [ {
      "serverCluster" : "8045e44e-974e-4f43-9862-7f0326784877",
      "remoteDatastore" : "8045e44e-974e-4f43-9862-7f0326785988"
    } ],
    "isServer" : false,
    "isClient" : true,
    "computeOnlyClient" : false,
    "numberOfClients" : 1,
    "numberOfServers" : 1
  },
  "primaryDatastoreName" : "sfo-m01-cl01-ds-vsan01",
  "primaryDatastoreType" : "VSAN",
  "hosts" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c5"
  }, {
    "id" : "c0703431-6742-470b-9e1d-f9d3bbc9b1c9"
  } ],
  "isStretched" : false,
  "isDefault" : true,
  "failuresToTolerate" : 1,
  "isImageBased" : true,
  "capacity" : {
    "cpu" : {
      "used" : {
        "value" : 9.745999724364296,
        "unit" : "GHz"
      },
      "total" : {
        "value" : 67.03999810397931,
        "unit" : "GHz"
      },
      "numberOfCores" : 32
    },
    "memory" : {
      "used" : {
        "value" : 127.80859375,
        "unit" : "GB"
      },
      "total" : {
        "value" : 312.484375,
        "unit" : "GB"
      }
    },
    "storage" : {
      "used" : {
        "value" : 224.15609374642372,
        "unit" : "GB"
      },
      "total" : {
        "value" : 858.1875,
        "unit" : "GB"
      }
    }
  },
  "vcenter" : {
    "id" : "ed2c9f30-db7f-48d2-9c9c-d38c5d3718e4",
    "fqdn" : "vcenter-1.vrack.vsphere.local",
    "vcInstanceId" : "abe05e93-cffb-41ca-a367-2352f54f815d"
  },
  "managedObjectReferenceId" : "domain-c8"
}

3.3. Get list of VDSes of a cluster

Prerequisites

None

Steps
  • Invoke the API.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/vdses' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/vdses HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 703

[ {
  "id" : "bbcb8e27-2af5-4662-9631-d7982e132bbc",
  "name" : "sfo-w01-cl01-vds01",
  "isUsedByNsxt" : false,
  "mtu" : 1500,
  "portGroups" : [ {
    "name" : "sfo-w01-cl01-vds01-pg-mgmt",
    "transportType" : "MANAGEMENT",
    "portBindingType" : "EPHEMERAL",
    "vlanId" : 0
  }, {
    "name" : "sfo-w01-cl01-vds01-pg-vsan",
    "transportType" : "VSAN",
    "portBindingType" : "EPHEMERAL",
    "vlanId" : 0
  }, {
    "name" : "sfo-w01-cl01-vds01-pg-vmotion",
    "transportType" : "VMOTION",
    "portBindingType" : "EPHEMERAL",
    "vlanId" : 0
  } ],
  "nsxtSwitchConfig" : {
    "transportZones" : [ {
      "name" : "sfo-m01-tz-overlay01",
      "transportType" : "OVERLAY"
    } ]
  }
} ]

4. Expand a Cluster

Adding an individual host to a cluster adds the resources of that host to the cluster. You can add multiple hosts at a time to a cluster.

4.1. Prerequisites

  • The following data is required

    • ID of the cluster

    • For each host

      • ID of the host (UUID)

      • List of VDS names to associate with host

      • ID of the vmNic, host is associated to

      • The name of the uplinks on the VDSes to which the vmnics are meant to be associated

      • Availability zone name to which host is mapped, if expand operation to be performed is on a stretched cluster

      • The network profile name if the host is intended to be part of a NSX sub cluster. The host could be added to a new sub cluster defined by the network profile in the spec or to an existing NSX sub cluster. Hosts that do not define "networkProfileName" will be associated with the global config of the cluster

Tip : Refer to the get cluster network configuration API to get all the existing sub clusters: Query the cluster network configuration

  • Is inter-rack cluster expansion - required, only if Cluster contains NSX Edge Cluster

  • License key of ESXi

  • The cluster network specification. Creation of sub clusters and sub transport node profiles is supported from NSX version 4.1.2 onwards. This network spec is needed if the hosts used for cluster expansion needs to have a different NSX network configurations than the cluster.

    • The NSX cluster specification

      • To use DHCP for host TEP IP assignment

      • The list of IP address pool specifications if the host TEP IP assignment is done from a static IP pool

    { "name" : "sfo-w01-cl02-ip-pool-01", "description" : "static ip pool for az2", "subnets" : [ { "ipAddressPoolRanges" : [ { "start" : "10.0.8.30", "end" : "10.0.8.50" } ], "cidr" : "10.0.8.0/24", "gateway" : "10.0.8.250" } ] }

Note : The spec allows user to either define new IP pools or reuse existing ones. To reuse existing IP pool only the "ipAddressPoolName" has to be defined while "subnets" will be null

  • Define the uplink profiles

    { "name" : "sfo-w01-cl02-uplink-profile-01", "teamings" : [ { "policy" : "FAILOVER_ORDER", "activeUplinks" : [ "uplink-1" ], "standByUplinks" : [ "uplink-2" ] } ], "transportVlan" : 100 }

  • The network profile is equivalent to the transport node profile and sub transport profiles in NSX. This contains the cluster VDSes used by NSX and the network configurations to be applied on the VDS. The below details are required to create a new network profile.

    • The name of the network profile

    • The list of NSX Host switch configurations

      • The VDS name (should be a VDS used by NSX)

      • The name of the uplink profile to be associated with the VDS (should be one of the uplink profiles defined in the spec)

      • The name of the IP address pool specification (should be one of the IP address pools defined in the spec)

      • VDS uplink to NSX uplink mappings

      { "name" : "sfo-w01-cl02-network-profile-01", "description" : "Network profile 02", "nsxtHostSwitchConfigs" : [ { "vdsName" : "sfo-w01-cl02-vds01", "uplinkProfileName" : "sfo-w01-cl02-uplink-profile-01", "ipAddressPoolName" : "sfo-w01-cl02-ip-pool-01", "vdsUplinkToNsxUplink" : [ { "vdsUplinkName" : "uplink1", "nsxUplinkName" : "uplink-1" }, { "vdsUplinkName" : "uplink2", "nsxUplinkName" : "uplink-2" } ] } ] }

Note : The spec allows user to either define new network profiles or apply an existing network profile on the incoming host(s). To add host(s) to an existing sub cluster define "networkProfileName" under "hostNetworkSpec". If the cluster is stretched, hosts in one availability zone cannot reuse the network profile of hosts in the other availability zone.

  • The cluster in a domain to which hosts are to be added must exist.

  • There must be a host available in the VMware Cloud Foundation inventory.

  • The hosts to be added must have been commissioned.

  • Ensure that the host you want to add is in an active state.

  • For expanding a cluster which uses more than 2 vmnics, get the hosts which are compatible with the cluster using hosts query API with the criterion "HOST_COMPATIBLE_WITH_CLUSTER_USING_PNICS".

Tip : Refer to: Get the Hosts based on a Criterion.

  • You must have a valid ESXi license specified with adequate sockets available for the host to be added.

  • Ensure that the host to be added to the cluster matches the configuration of the hosts already in the cluster. This ensures a balanced configuration of the cluster.

  • Cluster should be in Stretched state, if expansion to be performed is on Stretched cluster.

4.2. Steps

  • Validate the input specification.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/validations' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "clusterUpdateSpec" : {
    "clusterExpansionSpec" : {
      "hostSpecs" : [ {
        "id" : "dd8d3c77-c78e-4f86-9e7d-f59990420e3c",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink2"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink2"
          } ],
          "networkProfileName" : "sfo-w01-cl02-network-profile-01"
        }
      }, {
        "id" : "dd8d3c77-c78e-4f86-9e7d-f59990420e3c",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink2"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink2"
          } ],
          "networkProfileName" : "sfo-w01-cl02-network-profile-02"
        }
      }, {
        "id" : "dd8d3c77-c78e-4f86-9e7d-f59990420e3c",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02"
          } ]
        }
      } ],
      "networkSpec" : {
        "nsxClusterSpec" : {
          "ipAddressPoolsSpec" : [ {
            "name" : "sfo-w01-cl02-ip-pool-01",
            "description" : "static ip pool for az2",
            "subnets" : [ {
              "ipAddressPoolRanges" : [ {
                "start" : "10.0.8.30",
                "end" : "10.0.8.50"
              } ],
              "cidr" : "10.0.8.0/24",
              "gateway" : "10.0.8.250"
            } ]
          } ],
          "uplinkProfiles" : [ {
            "name" : "sfo-w01-cl02-uplink-profile-01",
            "teamings" : [ {
              "policy" : "FAILOVER_ORDER",
              "activeUplinks" : [ "uplink-1" ],
              "standByUplinks" : [ "uplink-2" ]
            } ],
            "transportVlan" : 100
          } ]
        },
        "networkProfiles" : [ {
          "name" : "sfo-w01-cl02-network-profile-01",
          "description" : "Network profile 02",
          "nsxtHostSwitchConfigs" : [ {
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplinkProfileName" : "sfo-w01-cl02-uplink-profile-01",
            "ipAddressPoolName" : "sfo-w01-cl02-ip-pool-01",
            "vdsUplinkToNsxUplink" : [ {
              "vdsUplinkName" : "uplink1",
              "nsxUplinkName" : "uplink-1"
            }, {
              "vdsUplinkName" : "uplink2",
              "nsxUplinkName" : "uplink-2"
            } ]
          } ]
        } ]
      }
    }
  }
}'

HTTP Request

POST /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/validations HTTP/1.1
Content-Type: application/json
Content-Length: 3640
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "clusterUpdateSpec" : {
    "clusterExpansionSpec" : {
      "hostSpecs" : [ {
        "id" : "dd8d3c77-c78e-4f86-9e7d-f59990420e3c",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink2"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink2"
          } ],
          "networkProfileName" : "sfo-w01-cl02-network-profile-01"
        }
      }, {
        "id" : "dd8d3c77-c78e-4f86-9e7d-f59990420e3c",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplink" : "uplink2"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02",
            "uplink" : "uplink2"
          } ],
          "networkProfileName" : "sfo-w01-cl02-network-profile-02"
        }
      }, {
        "id" : "dd8d3c77-c78e-4f86-9e7d-f59990420e3c",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl02-vds01"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl02-vds01"
          }, {
            "id" : "vmnic2",
            "vdsName" : "sfo-w01-cl02-vds02"
          }, {
            "id" : "vmnic3",
            "vdsName" : "sfo-w01-cl02-vds02"
          } ]
        }
      } ],
      "networkSpec" : {
        "nsxClusterSpec" : {
          "ipAddressPoolsSpec" : [ {
            "name" : "sfo-w01-cl02-ip-pool-01",
            "description" : "static ip pool for az2",
            "subnets" : [ {
              "ipAddressPoolRanges" : [ {
                "start" : "10.0.8.30",
                "end" : "10.0.8.50"
              } ],
              "cidr" : "10.0.8.0/24",
              "gateway" : "10.0.8.250"
            } ]
          } ],
          "uplinkProfiles" : [ {
            "name" : "sfo-w01-cl02-uplink-profile-01",
            "teamings" : [ {
              "policy" : "FAILOVER_ORDER",
              "activeUplinks" : [ "uplink-1" ],
              "standByUplinks" : [ "uplink-2" ]
            } ],
            "transportVlan" : 100
          } ]
        },
        "networkProfiles" : [ {
          "name" : "sfo-w01-cl02-network-profile-01",
          "description" : "Network profile 02",
          "nsxtHostSwitchConfigs" : [ {
            "vdsName" : "sfo-w01-cl02-vds01",
            "uplinkProfileName" : "sfo-w01-cl02-uplink-profile-01",
            "ipAddressPoolName" : "sfo-w01-cl02-ip-pool-01",
            "vdsUplinkToNsxUplink" : [ {
              "vdsUplinkName" : "uplink1",
              "nsxUplinkName" : "uplink-1"
            }, {
              "vdsUplinkName" : "uplink2",
              "nsxUplinkName" : "uplink-2"
            } ]
          } ]
        } ]
      }
    }
  }
}

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 294

{
  "id" : "2c77b965-0c02-4616-a4c8-d809d35b3d5c",
  "description" : "Validating Cluster Expansion Spec",
  "executionStatus" : "COMPLETED",
  "resultStatus" : "SUCCEEDED",
  "validationChecks" : [ {
    "description" : "ClusterExpansionSpecValidation",
    "resultStatus" : "SUCCEEDED"
  } ]
}
  • In case of no errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "SUCCEEDED".

  • In case of errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "FAILED".

Note : Make changes to the input specification and re-validate using a new API invocation.

  • Trigger the task using the valid input specification.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "clusterExpansionSpec" : {
    "hostSpecs" : [ {
      "id" : "6b61d45b-e0da-4ad2-a784-b357da4b5818",
      "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
      "username" : "root",
      "hostNetworkSpec" : {
        "vmNics" : [ {
          "id" : "vmnic0",
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplink" : "uplink1"
        }, {
          "id" : "vmnic1",
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplink" : "uplink2"
        }, {
          "id" : "vmnic2",
          "vdsName" : "sfo-w01-cl02-vds02",
          "uplink" : "uplink1"
        }, {
          "id" : "vmnic3",
          "vdsName" : "sfo-w01-cl02-vds02",
          "uplink" : "uplink2"
        } ],
        "networkProfileName" : "sfo-w01-cl02-network-profile-01"
      }
    }, {
      "id" : "6b61d45b-e0da-4ad2-a784-b357da4b5818",
      "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
      "username" : "root",
      "hostNetworkSpec" : {
        "vmNics" : [ {
          "id" : "vmnic0",
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplink" : "uplink1"
        }, {
          "id" : "vmnic1",
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplink" : "uplink2"
        }, {
          "id" : "vmnic2",
          "vdsName" : "sfo-w01-cl02-vds02",
          "uplink" : "uplink1"
        }, {
          "id" : "vmnic3",
          "vdsName" : "sfo-w01-cl02-vds02",
          "uplink" : "uplink2"
        } ],
        "networkProfileName" : "sfo-w01-cl02-network-profile-02"
      }
    }, {
      "id" : "6b61d45b-e0da-4ad2-a784-b357da4b5818",
      "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
      "username" : "root",
      "hostNetworkSpec" : {
        "vmNics" : [ {
          "id" : "vmnic0",
          "vdsName" : "sfo-w01-cl02-vds01"
        }, {
          "id" : "vmnic1",
          "vdsName" : "sfo-w01-cl02-vds01"
        }, {
          "id" : "vmnic2",
          "vdsName" : "sfo-w01-cl02-vds02"
        }, {
          "id" : "vmnic3",
          "vdsName" : "sfo-w01-cl02-vds02"
        } ]
      }
    } ],
    "networkSpec" : {
      "nsxClusterSpec" : {
        "ipAddressPoolsSpec" : [ {
          "name" : "sfo-w01-cl02-ip-pool-01",
          "description" : "static ip pool for az2",
          "subnets" : [ {
            "ipAddressPoolRanges" : [ {
              "start" : "10.0.8.30",
              "end" : "10.0.8.50"
            } ],
            "cidr" : "10.0.8.0/24",
            "gateway" : "10.0.8.250"
          } ]
        } ],
        "uplinkProfiles" : [ {
          "name" : "sfo-w01-cl02-uplink-profile-01",
          "teamings" : [ {
            "policy" : "FAILOVER_ORDER",
            "activeUplinks" : [ "uplink-1" ],
            "standByUplinks" : [ "uplink-2" ]
          } ],
          "transportVlan" : 100
        } ]
      },
      "networkProfiles" : [ {
        "name" : "sfo-w01-cl02-network-profile-01",
        "description" : "Network profile 02",
        "nsxtHostSwitchConfigs" : [ {
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplinkProfileName" : "sfo-w01-cl02-uplink-profile-01",
          "ipAddressPoolName" : "sfo-w01-cl02-ip-pool-01",
          "vdsUplinkToNsxUplink" : [ {
            "vdsUplinkName" : "uplink1",
            "nsxUplinkName" : "uplink-1"
          }, {
            "vdsUplinkName" : "uplink2",
            "nsxUplinkName" : "uplink-2"
          } ]
        } ]
      } ]
    }
  }
}'

HTTP Request

PATCH /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32 HTTP/1.1
Content-Type: application/json
Content-Length: 3388
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "clusterExpansionSpec" : {
    "hostSpecs" : [ {
      "id" : "6b61d45b-e0da-4ad2-a784-b357da4b5818",
      "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
      "username" : "root",
      "hostNetworkSpec" : {
        "vmNics" : [ {
          "id" : "vmnic0",
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplink" : "uplink1"
        }, {
          "id" : "vmnic1",
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplink" : "uplink2"
        }, {
          "id" : "vmnic2",
          "vdsName" : "sfo-w01-cl02-vds02",
          "uplink" : "uplink1"
        }, {
          "id" : "vmnic3",
          "vdsName" : "sfo-w01-cl02-vds02",
          "uplink" : "uplink2"
        } ],
        "networkProfileName" : "sfo-w01-cl02-network-profile-01"
      }
    }, {
      "id" : "6b61d45b-e0da-4ad2-a784-b357da4b5818",
      "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
      "username" : "root",
      "hostNetworkSpec" : {
        "vmNics" : [ {
          "id" : "vmnic0",
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplink" : "uplink1"
        }, {
          "id" : "vmnic1",
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplink" : "uplink2"
        }, {
          "id" : "vmnic2",
          "vdsName" : "sfo-w01-cl02-vds02",
          "uplink" : "uplink1"
        }, {
          "id" : "vmnic3",
          "vdsName" : "sfo-w01-cl02-vds02",
          "uplink" : "uplink2"
        } ],
        "networkProfileName" : "sfo-w01-cl02-network-profile-02"
      }
    }, {
      "id" : "6b61d45b-e0da-4ad2-a784-b357da4b5818",
      "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
      "username" : "root",
      "hostNetworkSpec" : {
        "vmNics" : [ {
          "id" : "vmnic0",
          "vdsName" : "sfo-w01-cl02-vds01"
        }, {
          "id" : "vmnic1",
          "vdsName" : "sfo-w01-cl02-vds01"
        }, {
          "id" : "vmnic2",
          "vdsName" : "sfo-w01-cl02-vds02"
        }, {
          "id" : "vmnic3",
          "vdsName" : "sfo-w01-cl02-vds02"
        } ]
      }
    } ],
    "networkSpec" : {
      "nsxClusterSpec" : {
        "ipAddressPoolsSpec" : [ {
          "name" : "sfo-w01-cl02-ip-pool-01",
          "description" : "static ip pool for az2",
          "subnets" : [ {
            "ipAddressPoolRanges" : [ {
              "start" : "10.0.8.30",
              "end" : "10.0.8.50"
            } ],
            "cidr" : "10.0.8.0/24",
            "gateway" : "10.0.8.250"
          } ]
        } ],
        "uplinkProfiles" : [ {
          "name" : "sfo-w01-cl02-uplink-profile-01",
          "teamings" : [ {
            "policy" : "FAILOVER_ORDER",
            "activeUplinks" : [ "uplink-1" ],
            "standByUplinks" : [ "uplink-2" ]
          } ],
          "transportVlan" : 100
        } ]
      },
      "networkProfiles" : [ {
        "name" : "sfo-w01-cl02-network-profile-01",
        "description" : "Network profile 02",
        "nsxtHostSwitchConfigs" : [ {
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplinkProfileName" : "sfo-w01-cl02-uplink-profile-01",
          "ipAddressPoolName" : "sfo-w01-cl02-ip-pool-01",
          "vdsUplinkToNsxUplink" : [ {
            "vdsUplinkName" : "uplink1",
            "nsxUplinkName" : "uplink-1"
          }, {
            "vdsUplinkName" : "uplink2",
            "nsxUplinkName" : "uplink-2"
          } ]
        } ]
      } ]
    }
  }
}

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/null
Content-Length: 3

{ }
  • Poll the task until "status" is not "IN_PROGRESS" using the "id" from the previous response.

Tip : Refer to: Get a Task.

  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed.

Tip : Refer to: Retry a Task.

5. Compact a Cluster

When a host is removed from a cluster in a domain, the vSAN members are reduced. Ensure that you have enough hosts remaining to facilitate the configured vSAN availability. Failure to do so might result in the datastore being marked as read-only or in data loss.

5.1. Prerequisites

The following data is required

  • For each host to be removed

    • ID of the host

5.2. Steps

  • Validate the input specification.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/validations' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "clusterCompactionSpec" : {
    "hosts" : [ {
      "id" : "707a79f1-72d8-410c-8acc-7f0e0e06230e"
    } ]
  }
}'

HTTP Request

POST /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/validations HTTP/1.1
Content-Type: application/json
Content-Length: 115
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "clusterCompactionSpec" : {
    "hosts" : [ {
      "id" : "707a79f1-72d8-410c-8acc-7f0e0e06230e"
    } ]
  }
}

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 296

{
  "id" : "a17ad7e1-3917-437b-94f1-689d0529dde5",
  "description" : "Validating Cluster Compaction Spec",
  "executionStatus" : "COMPLETED",
  "resultStatus" : "SUCCEEDED",
  "validationChecks" : [ {
    "description" : "ClusterCompactionSpecValidation",
    "resultStatus" : "SUCCEEDED"
  } ]
}
  • In case of no errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "SUCCEEDED".

  • In case of errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "FAILED".

Note : Make changes to the input specification and re-validate using a new API invocation.

  • Trigger the task using the valid input specification.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "clusterCompactionSpec" : {
    "hosts" : [ {
      "id" : "da3af79f-90f5-4703-bea0-e4cf1418c45f"
    } ]
  }
}'

HTTP Request

PATCH /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32 HTTP/1.1
Content-Type: application/json
Content-Length: 115
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "clusterCompactionSpec" : {
    "hosts" : [ {
      "id" : "da3af79f-90f5-4703-bea0-e4cf1418c45f"
    } ]
  }
}

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/null
Content-Length: 3

{ }
  • Poll the task until "status" is not "IN_PROGRESS" using the "id" from the previous response.

Tip : Refer to: Get a Task.

  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed.

Tip : Refer to: Retry a Task.

6. Stretch a Cluster

Convert a Standard vSAN cluster to a Stretched cluster

6.1. Prerequisites

  • The following data is required

    • ID of the cluster

    • Secondary AZ overlay vLAN Id

    • For each host

      • ID of the host (UUID)

      • License key of ESXi

    • For each Witness host

      • ID of witness host

      • FQDN of witness host

      • vSAN subnet cidr of witness host

  • The following data is optional

    • Witness traffic shared with vSAN (or Management VMK)

    • Edge cluster configured Multi-AZ

  • The cluster network specification. Creation of sub clusters and sub transport node profiles is supported from NSX version 4.1.2 onwards.

    This network spec is needed if the hosts used for the secondary availability zone (az) need to have a different NSX network configuration than the primary availability zone. This enables user to use static IP pool for

    host TEP IP assignment for secondary az hosts.

    • The NSX cluster specification

      • To use DHCP for host TEP IP assignment

      • The list of IP address pool specifications if the host TEP IP assignment is done from a static IP pool

      { "name" : "sfo-w01-cl02-ip-pool-01", "description" : "static ip pool for az2", "subnets" : [ { "ipAddressPoolRanges" : [ { "start" : "10.0.8.30", "end" : "10.0.8.50" } ], "cidr" : "10.0.8.0/24", "gateway" : "10.0.8.250" } ] }

Note : The spec allows user to either define new IP pools or reuse existing ones. To reuse existing IP pool only the "ipAddressPoolName" has to be defined while "subnets" will be null

  • Define the uplink profiles

    { "name" : "sfo-w01-cl02-uplink-profile-01", "teamings" : [ { "policy" : "FAILOVER_ORDER", "activeUplinks" : [ "uplink-1" ], "standByUplinks" : [ "uplink-2" ] } ], "transportVlan" : 100 }

Note : The "secondaryAzOverlayVlanId" is deprecated in favour of "transportVlan" in "uplinkProfiles" . If the NSX version is less than 4.1.2 where sub TNP is not supported, the "secondaryAzOverlayVlanId" is still mandatory.

  • The network profile is equivalent to the transport node profile and sub transport profiles in NSX. This contains the cluster VDSes used by NSX and the network configurations to be applied on the VDS.

    The below details are required to create a new network profile

    • The name of the network profile

    • The list of NSX Host switch configurations

      • The VDS name (should be a VDS used by NSX)

      • The name of the uplink profile to be associated with the VDS (should be one of the uplink profiles defined in the spec)

      • The name of the IP address pool specification (should be one of the IP address pools defined in the spec)

      • VDS uplink to NSX uplink mappings

      { "name" : "sfo-w01-cl02-network-profile-01", "description" : "Network profile 02", "nsxtHostSwitchConfigs" : [ { "vdsName" : "sfo-w01-cl02-vds01", "uplinkProfileName" : "sfo-w01-cl02-uplink-profile-01", "ipAddressPoolName" : "sfo-w01-cl02-ip-pool-01", "vdsUplinkToNsxUplink" : [ { "vdsUplinkName" : "uplink1", "nsxUplinkName" : "uplink-1" }, { "vdsUplinkName" : "uplink2", "nsxUplinkName" : "uplink-2" } ] } ] }

Note : The spec should only define new network profiles to be used for hosts in secondary availability zone.

  • The cluster must exist.

  • There must be a host available in the VMware Cloud Foundation inventory.

  • The hosts to be added must have been commissioned.

  • Ensure that the host you want to add is in an active state.

  • You must have a valid ESXi license specified with adequate sockets available for the host to be added.

  • Ensure that the host to be added to the cluster matches the configuration of the hosts already in the cluster. This ensures a balanced configuration of the cluster.

  • vSAN witness should be configured.

  • Underlying physical network should have proper MTUs and vSAN/vMotion connectivity between availability zones and the witness.

6.2. Steps

  • Validate the input specification.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/validations' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "clusterStretchSpec" : {
    "hostSpecs" : [ {
      "id" : "fe428250-e05c-4f5f-bf08-978c33cd148c",
      "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
      "username" : "root",
      "hostNetworkSpec" : {
        "vmNics" : [ {
          "id" : "vmnic0",
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplink" : "uplink1"
        }, {
          "id" : "vmnic1",
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplink" : "uplink2"
        } ]
      }
    } ],
    "witnessSpec" : {
      "vsanIp" : "10.0.4.88",
      "fqdn" : "witness-vsan.sfo.rainpole.io",
      "vsanCidr" : "10.0.4.0/24"
    },
    "witnessTrafficSharedWithVsanTraffic" : false,
    "networkSpec" : {
      "nsxClusterSpec" : {
        "ipAddressPoolsSpec" : [ {
          "name" : "ip-address-pool",
          "description" : "static ip pool for az2",
          "subnets" : [ {
            "ipAddressPoolRanges" : [ {
              "start" : "10.0.8.30",
              "end" : "10.0.8.50"
            } ],
            "cidr" : "10.0.8.0/24",
            "gateway" : "10.0.8.250"
          } ]
        } ],
        "uplinkProfiles" : [ {
          "name" : "uplink-profile-1",
          "teamings" : [ {
            "policy" : "FAILOVER_ORDER",
            "activeUplinks" : [ "uplink-1" ],
            "standByUplinks" : [ "uplink-2" ]
          } ],
          "transportVlan" : 100
        } ]
      },
      "networkProfiles" : [ {
        "name" : "az2-sub-tnp",
        "description" : "AZ2 Sub-TNP",
        "nsxtHostSwitchConfigs" : [ {
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplinkProfileName" : "uplink-profile-1",
          "ipAddressPoolName" : "ip-address-pool",
          "vdsUplinkToNsxUplink" : [ {
            "vdsUplinkName" : "uplink1",
            "nsxUplinkName" : "uplink-1"
          }, {
            "vdsUplinkName" : "uplink2",
            "nsxUplinkName" : "uplink-2"
          } ]
        } ]
      } ]
    }
  }
}'

HTTP Request

POST /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/validations HTTP/1.1
Content-Type: application/json
Content-Length: 1949
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "clusterStretchSpec" : {
    "hostSpecs" : [ {
      "id" : "fe428250-e05c-4f5f-bf08-978c33cd148c",
      "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
      "username" : "root",
      "hostNetworkSpec" : {
        "vmNics" : [ {
          "id" : "vmnic0",
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplink" : "uplink1"
        }, {
          "id" : "vmnic1",
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplink" : "uplink2"
        } ]
      }
    } ],
    "witnessSpec" : {
      "vsanIp" : "10.0.4.88",
      "fqdn" : "witness-vsan.sfo.rainpole.io",
      "vsanCidr" : "10.0.4.0/24"
    },
    "witnessTrafficSharedWithVsanTraffic" : false,
    "networkSpec" : {
      "nsxClusterSpec" : {
        "ipAddressPoolsSpec" : [ {
          "name" : "ip-address-pool",
          "description" : "static ip pool for az2",
          "subnets" : [ {
            "ipAddressPoolRanges" : [ {
              "start" : "10.0.8.30",
              "end" : "10.0.8.50"
            } ],
            "cidr" : "10.0.8.0/24",
            "gateway" : "10.0.8.250"
          } ]
        } ],
        "uplinkProfiles" : [ {
          "name" : "uplink-profile-1",
          "teamings" : [ {
            "policy" : "FAILOVER_ORDER",
            "activeUplinks" : [ "uplink-1" ],
            "standByUplinks" : [ "uplink-2" ]
          } ],
          "transportVlan" : 100
        } ]
      },
      "networkProfiles" : [ {
        "name" : "az2-sub-tnp",
        "description" : "AZ2 Sub-TNP",
        "nsxtHostSwitchConfigs" : [ {
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplinkProfileName" : "uplink-profile-1",
          "ipAddressPoolName" : "ip-address-pool",
          "vdsUplinkToNsxUplink" : [ {
            "vdsUplinkName" : "uplink1",
            "nsxUplinkName" : "uplink-1"
          }, {
            "vdsUplinkName" : "uplink2",
            "nsxUplinkName" : "uplink-2"
          } ]
        } ]
      } ]
    }
  }
}

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 290

{
  "id" : "329221d1-608d-4c2a-8788-701ec89f917c",
  "description" : "Validating Cluster Stretch Spec",
  "executionStatus" : "COMPLETED",
  "resultStatus" : "SUCCEEDED",
  "validationChecks" : [ {
    "description" : "ClusterStretchSpecValidation",
    "resultStatus" : "SUCCEEDED"
  } ]
}
  • In case of no errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "SUCCEEDED".

  • In case of errors in the input specification, the "executionStatus" is "COMPLETED" and "resultStatus" is "FAILED".

Note : Make changes to the input specification and re-validate using a new API invocation.

  • Trigger the task using the valid input specification.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "clusterStretchSpec" : {
    "hostSpecs" : [ {
      "id" : "136ad1b6-708d-459c-9d89-f81157b59677",
      "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
      "username" : "root",
      "hostNetworkSpec" : {
        "vmNics" : [ {
          "id" : "vmnic0",
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplink" : "uplink1"
        }, {
          "id" : "vmnic1",
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplink" : "uplink2"
        } ]
      }
    } ],
    "witnessSpec" : {
      "vsanIp" : "10.0.4.88",
      "fqdn" : "witness-vsan.sfo.rainpole.io",
      "vsanCidr" : "10.0.4.0/24"
    },
    "witnessTrafficSharedWithVsanTraffic" : false,
    "networkSpec" : {
      "nsxClusterSpec" : {
        "ipAddressPoolsSpec" : [ {
          "name" : "ip-address-pool",
          "description" : "static ip pool for az2",
          "subnets" : [ {
            "ipAddressPoolRanges" : [ {
              "start" : "10.0.8.30",
              "end" : "10.0.8.50"
            } ],
            "cidr" : "10.0.8.0/24",
            "gateway" : "10.0.8.250"
          } ]
        } ],
        "uplinkProfiles" : [ {
          "name" : "uplink-profile-1",
          "teamings" : [ {
            "policy" : "FAILOVER_ORDER",
            "activeUplinks" : [ "uplink-1" ],
            "standByUplinks" : [ "uplink-2" ]
          } ],
          "transportVlan" : 100
        } ]
      },
      "networkProfiles" : [ {
        "name" : "az2-sub-tnp",
        "description" : "AZ2 Sub-TNP",
        "nsxtHostSwitchConfigs" : [ {
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplinkProfileName" : "uplink-profile-1",
          "ipAddressPoolName" : "ip-address-pool",
          "vdsUplinkToNsxUplink" : [ {
            "vdsUplinkName" : "uplink1",
            "nsxUplinkName" : "uplink-1"
          }, {
            "vdsUplinkName" : "uplink2",
            "nsxUplinkName" : "uplink-2"
          } ]
        } ]
      } ]
    }
  }
}'

HTTP Request

PATCH /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32 HTTP/1.1
Content-Type: application/json
Content-Length: 1949
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "clusterStretchSpec" : {
    "hostSpecs" : [ {
      "id" : "136ad1b6-708d-459c-9d89-f81157b59677",
      "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
      "username" : "root",
      "hostNetworkSpec" : {
        "vmNics" : [ {
          "id" : "vmnic0",
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplink" : "uplink1"
        }, {
          "id" : "vmnic1",
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplink" : "uplink2"
        } ]
      }
    } ],
    "witnessSpec" : {
      "vsanIp" : "10.0.4.88",
      "fqdn" : "witness-vsan.sfo.rainpole.io",
      "vsanCidr" : "10.0.4.0/24"
    },
    "witnessTrafficSharedWithVsanTraffic" : false,
    "networkSpec" : {
      "nsxClusterSpec" : {
        "ipAddressPoolsSpec" : [ {
          "name" : "ip-address-pool",
          "description" : "static ip pool for az2",
          "subnets" : [ {
            "ipAddressPoolRanges" : [ {
              "start" : "10.0.8.30",
              "end" : "10.0.8.50"
            } ],
            "cidr" : "10.0.8.0/24",
            "gateway" : "10.0.8.250"
          } ]
        } ],
        "uplinkProfiles" : [ {
          "name" : "uplink-profile-1",
          "teamings" : [ {
            "policy" : "FAILOVER_ORDER",
            "activeUplinks" : [ "uplink-1" ],
            "standByUplinks" : [ "uplink-2" ]
          } ],
          "transportVlan" : 100
        } ]
      },
      "networkProfiles" : [ {
        "name" : "az2-sub-tnp",
        "description" : "AZ2 Sub-TNP",
        "nsxtHostSwitchConfigs" : [ {
          "vdsName" : "sfo-w01-cl02-vds01",
          "uplinkProfileName" : "uplink-profile-1",
          "ipAddressPoolName" : "ip-address-pool",
          "vdsUplinkToNsxUplink" : [ {
            "vdsUplinkName" : "uplink1",
            "nsxUplinkName" : "uplink-1"
          }, {
            "vdsUplinkName" : "uplink2",
            "nsxUplinkName" : "uplink-2"
          } ]
        } ]
      } ]
    }
  }
}

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/null
Content-Length: 3

{ }
  • Poll the task until "status" is not "IN_PROGRESS" using the "id" from the previous response.

Tip : Refer to: Get a Task.

  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed.

Tip : Refer to: Retry a Task.

7. Unstretch a Cluster

Convert a Stretched cluster to a Standard vSAN cluster

7.1. Prerequisites

  • The following data is required

    • ID of the cluster
  • The cluster must exist.

  • Cluster should be in Stretched state.

7.2. Steps

  • Trigger the task using the valid input specification.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "clusterUnstretchSpec" : { }
}'

HTTP Request

PATCH /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32 HTTP/1.1
Content-Type: application/json
Content-Length: 34
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "clusterUnstretchSpec" : { }
}

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/null
Content-Length: 3

{ }
  • Poll the task until "status" is not "IN_PROGRESS" using the "id" from the previous response.

Tip : Refer to: Get a Task.

  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed.

Tip : Refer to: Retry a Task.

8. Delete a Cluster

Warning : Datastores on the ESXi hosts in the cluster that will be deleted are destroyed.

Note : You cannot delete the last cluster in a domain. Instead, the domain can be deleted. A cluster cannot be deleted if it has remote vSAN datastores configured. If so, unmount the remote vSAN datastores from vCenter and then retry cluster deletion. Please refer to the 'VMware Cloud Foundation Administration Guide' for more details.

8.1. Prerequisites

  • The following data is required

    • ID of the cluster to be deleted
  • Ensure that a cluster with the given ID exists.

  • The cluster has been marked for deletion.

  • Migrate or backup the VMs and data on the data store associated with the cluster to another location.

8.2. Steps

  • Initialize the deletion.

Warning : It is not possible to delete a cluster without having marked it for deletion. This 2-step deletion ensures that a cluster is not deleted accidentally.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "markForDeletion" : true
}'

HTTP Request

PATCH /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32 HTTP/1.1
Content-Type: application/json
Content-Length: 30
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "markForDeletion" : true
}

HTTP Response

HTTP/1.1 200 OK
  • Trigger the deletion.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32' -i -X DELETE \
    -H 'Accept-Language: de' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

DELETE /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32 HTTP/1.1
Accept-Language: de
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/49192ac9-d995-4f02-be62-e8094336883b
Content-Length: 160

{
  "id" : "49192ac9-d995-4f02-be62-e8094336883b",
  "name" : "Remove Cluster",
  "status" : "IN_PROGRESS",
  "creationTimestamp" : "2023-09-24T01:56:22.384Z"
}
  • Poll the task until "status" is not "IN_PROGRESS" using the "id" from the previous response.

Tip : Refer to: Get a Task.

  • If the "status" is "SUCCESSFUL", the task is completed successfully.

  • If the "status" is "FAILED", the task can be re-executed.

Tip : Refer to: Retry a Task.

9. Get Cluster Network Configuration Query Criteria

This API is used to get supported criteria for query on cluster network configuration.

9.1. Prerequisites

The following data is required:

  • ID of the Cluster

9.2. Steps

  • Invoke the Get Cluster Network Configuration Query Criteria.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/network/criteria' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/network/criteria HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 525

{
  "elements" : [ {
    "name" : "VCENTER_NSXT_NETWORK_CONFIG",
    "description" : "Cluster networking configuration at vCenter and NSX"
  }, {
    "name" : "VCENTER_NETWORK_CONFIG_SUMMARY",
    "description" : "Cluster network configuration summary at the vCenter"
  }, {
    "name" : "NSX_NETWORK_CONFIG_PREVIEW_POST_DRIFT",
    "description" : "Preview of cluster network configuration at NSX after cluster auto reconfigures with the Sub-TNP feature - grouping host transport nodes of the same NSX configuration"
  } ]
}

10. Query Cluster Network Configuration using criteria

This API is used to initiate a network configuration query on the cluster.

10.1. Prerequisites

The following data is required:

  • ID of the Cluster

  • Query Criteria

10.2. Steps

  • Invoke the API to initiate a query based on criteria on the cluster.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/network/queries' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "name" : "VCENTER_NSXT_NETWORK_CONFIG"
}'

HTTP Request

POST /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/network/queries HTTP/1.1
Content-Type: application/json
Content-Length: 44
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "name" : "VCENTER_NSXT_NETWORK_CONFIG"
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/network/queries/f6ca5c25-9916-4cb8-9e90-044710f900b2
Content-Type: application/json
Content-Length: 183

{
  "queryInfo" : {
    "status" : "IN_PROGRESS",
    "queryId" : "f6ca5c25-9916-4cb8-9e90-044710f900b2",
    "completed" : false,
    "processing" : true,
    "failure" : false
  }
}
  • Poll the query response until "status" is not "IN_PROGRESS" using the "id" from the previous response.

Tip : Refer to: Get Cluster Network Configuration Query Response.

  • If the "status" is "SUCCESSFUL", the query response is completed successfully.

11. Get Cluster Network Configuration Query Response

API is used to get response for submitted query for network configuration on a cluster.

11.1. Prerequisites

The following data is required:

  • ID of the Cluster

  • ID of the Query

11.2. Steps

  • Invoke the API to get the response for submitted query for network configuration on a cluster.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/62c9b706-52eb-4d8f-a8ac-0573f9c9ceec/network/queries/75fab077-1e4d-48d6-92fe-6870f5affceb' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/clusters/62c9b706-52eb-4d8f-a8ac-0573f9c9ceec/network/queries/75fab077-1e4d-48d6-92fe-6870f5affceb HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 4060

{
  "queryInfo" : {
    "status" : "COMPLETED",
    "queryId" : "72a1da56-0c99-47d1-aaf0-7c3597d8a055",
    "completed" : true,
    "processing" : false,
    "failure" : false
  },
  "result" : {
    "elements" : [ {
      "hostDetails" : [ {
        "id" : "3a20bfcb-cd69-4d26-99ae-54a488ff8aee",
        "hostName" : "sfo01-m01-esx01",
        "hostNetworkConfiguration" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl01-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl01-vds01",
            "uplink" : "uplink2"
          } ]
        }
      }, {
        "id" : "7fb60d2c-e9a9-46ce-92d1-47d360030ef7",
        "hostName" : "sfo01-m01-esx02",
        "hostNetworkConfiguration" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl01-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl01-vds01",
            "uplink" : "uplink2"
          } ]
        }
      }, {
        "id" : "b198ebc7-2261-4301-8430-0a826d798218",
        "hostName" : "sfo01-m01-esx03",
        "hostNetworkConfiguration" : {
          "vmNics" : [ {
            "id" : "vmnic0",
            "vdsName" : "sfo-w01-cl01-vds01",
            "uplink" : "uplink1"
          }, {
            "id" : "vmnic1",
            "vdsName" : "sfo-w01-cl01-vds01",
            "uplink" : "uplink2"
          } ]
        }
      } ],
      "vdsConfigurations" : [ {
        "name" : "sfo-w01-cl01-vds01",
        "portGroups" : [ {
          "name" : "sfo-w01-cl01-vds01-pg-management",
          "transportType" : "MANAGEMENT",
          "activeUplinks" : [ "uplink1", "uplink2" ],
          "standByUplinks" : [ ],
          "policy" : "loadbalance_loadbased",
          "vlanId" : 0
        }, {
          "name" : "sfo-w01-cl01-vds01-pg-vsan",
          "transportType" : "VSAN",
          "activeUplinks" : [ "uplink1", "uplink2" ],
          "standByUplinks" : [ ],
          "policy" : "loadbalance_loadbased",
          "vlanId" : 0
        }, {
          "name" : "sfo-w01-cl01-vds01-pg-vmotion",
          "transportType" : "VMOTION",
          "activeUplinks" : [ "uplink1", "uplink2" ],
          "standByUplinks" : [ ],
          "policy" : "loadbalance_loadbased",
          "vlanId" : 0
        } ],
        "nsxtSwitchConfig" : {
          "transportZones" : [ {
            "name" : "vlan-tz-sfo-w01-cl01-vds01",
            "transportType" : "VLAN"
          }, {
            "name" : "overlay-tz-nsxt-vip.vrack.vsphere.local",
            "transportType" : "OVERLAY"
          } ]
        },
        "uplinks" : [ "uplink2", "uplink1" ]
      } ],
      "ipAddressPools" : [ {
        "name" : "static-ip-pool-1",
        "description" : "Static ip pool 1",
        "availableIpAddresses" : 185,
        "totalIpAddresses" : 191,
        "staticSubnets" : [ {
          "ipAddressPoolRanges" : [ {
            "start" : "10.0.1.10",
            "end" : "10.0.1.200"
          } ],
          "gateway" : "10.0.1.253",
          "cidr" : "10.0.1.0/24"
        } ]
      } ],
      "uplinkProfiles" : [ {
        "name" : "vcenter-1-new-vi-cluster1-sfo-w01-cl01-vds01",
        "teamings" : [ {
          "policy" : "LOADBALANCE_SRCID",
          "activeUplinks" : [ "uplink-2", "uplink-1" ],
          "standByUplinks" : [ ]
        } ],
        "transportVlan" : 0,
        "supportedTeamingPolicies" : null
      } ],
      "networkProfiles" : [ {
        "isDefault" : true,
        "nsxtHostSwitchConfigs" : [ {
          "vdsName" : "sfo-w01-cl01-vds01",
          "uplinkProfileName" : "vcenter-1-new-vi-cluster1-sfo-w01-cl01-vds01",
          "ipAddressPoolName" : "static-ip-pool-1",
          "vdsUplinkToNsxUplink" : [ {
            "vdsUplinkName" : "uplink2",
            "nsxUplinkName" : "uplink-2"
          }, {
            "vdsUplinkName" : "uplink1",
            "nsxUplinkName" : "uplink-1"
          } ]
        } ]
      } ]
    } ]
  }
}

Last updated 2023-09-23 19:05:04 -0700

Operations
POST
Add Datastore To Cluster
Mount a datastore to a cluster
PUT
Assign Tags To Cluster
Assign Tags to Cluster
POST
Create Cluster
Create a cluster and add to an existing domain
DELETE
Delete Cluster
Delete a cluster from a domain if it has been previously initialized for deletion
GET
Get Cluster
Get a cluster by its ID
GET
Get Cluster Datastores
Get the list of all datastores associated with the cluster.
POST
Get Cluster Network Configuration
Get cluster network configuration
GET
Get Cluster Network Configuration Criteria
Get cluster network configuration criteria
GET
Get Cluster Network Configuration Query Response
Get cluster network configuration query response
GET
Get Clusters
Retrieve a list of clusters
GET
Get Cluster Tag Manager Url
Get Cluster Tag Manager Url
GET
Get Datastore Criterion
Get a criterion to query for datastore
GET
Get Datastore Query Response
Get Datastore query response
GET
Get Datastores Criteria
Get all datastore criteria
GET
Get Host Criteria
Get all host criteria
GET
Get Host Criterion
Get a criterion to query for host
GET
Get Host Query Response
Get query response
GET
Get Tag Assignable For Cluster
Get tags assignable to a cluster
GET
Get Tags Assigned To Cluster
Get tags assigned to a cluster by its ID
GET
Get Tags Assigned To Clusters
Get tags assigned to clusters
GET
Get Vdses
Get the list of VDSes of a cluster.
POST
Import Vds To Inventory
Import Vds to inventory for the given cluster
POST
Post Datastore Query
Post a datastore query
POST
Post Host Query
Post a host query
DELETE
Remove Datastore From Cluster
Unmount a datastore from a cluster
DELETE
Remove Tags From Cluster
Remove tags from a cluster
PATCH
Update Cluster
Update a Cluster by adding or removing Hosts, Stretching a standard vSAN cluster, Unstretching a stretched cluster or by marking for deletion
POST
Validate Cluster Creation Spec
Perform validation of the ClusterCreationSpec specification
POST
Validate Cluster Update Spec
Perform validation of the ClusterUpdateSpec specification
POST
Validate Vsan Remote Datastore Spec
Perform validation of the DatastoreMountSpec specification