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

          {
            "vsanDatastoreSpec" : {
              "failuresToTolerate" : 1,
              "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
              "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

    • NSX cluster Details

      • VLAN ID of the Geneve

      • IP address pool spec if the TEP IP assignment is done from IP pool

        For DHCP

        {
          "nsxTClusterSpec" : {
            "geneveVlanId" : 2
          }
        }
        

        For creating new IP pool during domain creation

        {
          "nsxTClusterSpec" : {
            "geneveVlanId" : 2,
            "ipAddressPoolSpec" : {
              "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"
              } ]
            }
          }
        }
        

        For using an existing IP pool during domain creation

        {
          "nsxTClusterSpec" : {
            "geneveVlanId" : 2,
            "ipAddressPoolSpec" : {
              "name" : "static-ip-pool-01"
            }
          }
        }
        

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

        {
          "nsxTClusterSpec" : {
            "geneveVlanId" : 2
          }
        }
  • 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"
      }, {
        "id" : "vmnic1",
        "vdsName" : "sfo-w01-cl01-vds01"
      }, {
        "id" : "vmnic2",
        "vdsName" : "sfo-w01-cl01-vds02"
      }, {
        "id" : "vmnic3",
        "vdsName" : "sfo-w01-cl01-vds02"
      } ]
    }
    

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" : "9c04a8ea-30ae-48ea-987e-57ef3d41cb53",
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "sfo-w01-cl02",
      "hostSpecs" : [ {
        "id" : "3fb4cdf7-a4df-4aac-bec2-b5130bcb8d73",
        "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"
          } ]
        }
      }, {
        "id" : "65b12126-8c55-4fb0-a2d9-ec2642bc0d78",
        "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"
          } ]
        }
      }, {
        "id" : "3bc984bb-39a6-49fb-a3b4-6fb9563adc35",
        "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"
          } ]
        }
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXX-XXXX",
          "datastoreName" : "sfo-w01-cl02-ds-vsan01"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "sfo-w01-cl02-vds01",
          "isUsedByNsxt" : false,
          "portGroupSpecs" : [ {
            "name" : "sfo-w01-cl02-vds01-pg-mgmt",
            "transportType" : "MANAGEMENT"
          }, {
            "name" : "sfo-w01-cl02-vds01-pg-vsan",
            "transportType" : "VSAN"
          }, {
            "name" : "sfo-w01-cl02-vds01-pg-vmotion",
            "transportType" : "VMOTION"
          } ]
        }, {
          "name" : "sfo-w01-cl02-vds02",
          "isUsedByNsxt" : true
        } ],
        "nsxClusterSpec" : {
          "nsxTClusterSpec" : {
            "geneveVlanId" : 0
          }
        }
      },
      "advancedOptions" : {
        "evcMode" : "",
        "highAvailability" : {
          "enabled" : false
        }
      }
    } ],
    "skipFailedHosts" : false
  }
}'

HTTP Request

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

{
  "domainId" : "9c04a8ea-30ae-48ea-987e-57ef3d41cb53",
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "sfo-w01-cl02",
      "hostSpecs" : [ {
        "id" : "3fb4cdf7-a4df-4aac-bec2-b5130bcb8d73",
        "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"
          } ]
        }
      }, {
        "id" : "65b12126-8c55-4fb0-a2d9-ec2642bc0d78",
        "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"
          } ]
        }
      }, {
        "id" : "3bc984bb-39a6-49fb-a3b4-6fb9563adc35",
        "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"
          } ]
        }
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXX-XXXX",
          "datastoreName" : "sfo-w01-cl02-ds-vsan01"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "sfo-w01-cl02-vds01",
          "isUsedByNsxt" : false,
          "portGroupSpecs" : [ {
            "name" : "sfo-w01-cl02-vds01-pg-mgmt",
            "transportType" : "MANAGEMENT"
          }, {
            "name" : "sfo-w01-cl02-vds01-pg-vsan",
            "transportType" : "VSAN"
          }, {
            "name" : "sfo-w01-cl02-vds01-pg-vmotion",
            "transportType" : "VMOTION"
          } ]
        }, {
          "name" : "sfo-w01-cl02-vds02",
          "isUsedByNsxt" : true
        } ],
        "nsxClusterSpec" : {
          "nsxTClusterSpec" : {
            "geneveVlanId" : 0
          }
        }
      },
      "advancedOptions" : {
        "evcMode" : "",
        "highAvailability" : {
          "enabled" : false
        }
      }
    } ],
    "skipFailedHosts" : false
  }
}

HTTP Response

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

{
  "id" : "0f594145-892b-4f78-98b2-0981bedb4032",
  "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" : "daff5b13-ae0f-46e7-8825-6c7ab2e86773",
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "sfo-w01-cl02",
      "hostSpecs" : [ {
        "id" : "1aaf722b-e325-41d5-aa9e-31bc29f7ce59",
        "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"
          } ]
        }
      }, {
        "id" : "bac92ad1-4636-421b-bdb2-0b7dd863c6cc",
        "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"
          } ]
        }
      }, {
        "id" : "1baf4aa1-ec7a-486c-8397-847af7cb4f87",
        "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"
          } ]
        }
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXX-XXXX",
          "datastoreName" : "sfo-w01-cl02-ds-vsan01"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "sfo-w01-cl02-vds01",
          "isUsedByNsxt" : false,
          "portGroupSpecs" : [ {
            "name" : "sfo-w01-cl02-vds01-pg-mgmt",
            "transportType" : "MANAGEMENT"
          }, {
            "name" : "sfo-w01-cl02-vds01-pg-vsan",
            "transportType" : "VSAN"
          }, {
            "name" : "sfo-w01-cl02-vds01-pg-vmotion",
            "transportType" : "VMOTION"
          } ]
        }, {
          "name" : "sfo-w01-cl02-vds02",
          "isUsedByNsxt" : true
        } ],
        "nsxClusterSpec" : {
          "nsxTClusterSpec" : {
            "geneveVlanId" : 0
          }
        }
      },
      "advancedOptions" : {
        "evcMode" : "",
        "highAvailability" : {
          "enabled" : false
        }
      }
    } ],
    "skipFailedHosts" : false
  }
}'

HTTP Request

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

{
  "domainId" : "daff5b13-ae0f-46e7-8825-6c7ab2e86773",
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "sfo-w01-cl02",
      "hostSpecs" : [ {
        "id" : "1aaf722b-e325-41d5-aa9e-31bc29f7ce59",
        "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"
          } ]
        }
      }, {
        "id" : "bac92ad1-4636-421b-bdb2-0b7dd863c6cc",
        "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"
          } ]
        }
      }, {
        "id" : "1baf4aa1-ec7a-486c-8397-847af7cb4f87",
        "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"
          } ]
        }
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXX-XXXX",
          "datastoreName" : "sfo-w01-cl02-ds-vsan01"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "sfo-w01-cl02-vds01",
          "isUsedByNsxt" : false,
          "portGroupSpecs" : [ {
            "name" : "sfo-w01-cl02-vds01-pg-mgmt",
            "transportType" : "MANAGEMENT"
          }, {
            "name" : "sfo-w01-cl02-vds01-pg-vsan",
            "transportType" : "VSAN"
          }, {
            "name" : "sfo-w01-cl02-vds01-pg-vmotion",
            "transportType" : "VMOTION"
          } ]
        }, {
          "name" : "sfo-w01-cl02-vds02",
          "isUsedByNsxt" : true
        } ],
        "nsxClusterSpec" : {
          "nsxTClusterSpec" : {
            "geneveVlanId" : 0
          }
        }
      },
      "advancedOptions" : {
        "evcMode" : "",
        "highAvailability" : {
          "enabled" : false
        }
      }
    } ],
    "skipFailedHosts" : false
  }
}

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/3602bd99-6729-4646-a536-3b0012402a88
Content-Length: 166

{
  "id" : "3602bd99-6729-4646-a536-3b0012402a88",
  "name" : "Add Cluster Workflow",
  "status" : "IN_PROGRESS",
  "creationTimestamp" : "2023-05-22T06:20:43.332Z"
}
  • 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: 2395

{
  "elements" : [ {
    "id" : "8045e44e-974e-4f43-9862-7f0326782655",
    "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,
    "isDefault" : true,
    "isImageBased" : true
  }, {
    "id" : "8045e44e-974e-4f43-9862-7f0326782677",
    "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,
    "isDefault" : true,
    "isImageBased" : false
  }, {
    "id" : "8045e44e-974e-4f43-9861-7f0326782633",
    "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,
    "isDefault" : true,
    "isImageBased" : true
  }, {
    "id" : "8045e44e-974e-4f43-9861-7f0326782677",
    "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,
    "isDefault" : true,
    "isImageBased" : false
  }, {
    "id" : "2345e44e-974e-4f43-9862-7f0326782898",
    "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,
    "isDefault" : true,
    "isImageBased" : false
  }, {
    "id" : "2345e44e-974e-4f43-9862-7f0326782899",
    "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-f9d3bbc9b1c7"
    } ],
    "isStretched" : false,
    "isDefault" : true,
    "isImageBased" : true
  } ]
}

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: 365

{
  "elements" : [ {
    "id" : "2345e44e-974e-4f43-9862-7f0326782898",
    "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
  } ]
}

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: 1742

{
  "elements" : [ {
    "id" : "8045e44e-974e-4f43-9862-7f0326782655",
    "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
  }, {
    "id" : "8045e44e-974e-4f43-9862-7f0326782677",
    "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
  }, {
    "id" : "8045e44e-974e-4f43-9861-7f0326782633",
    "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
  }, {
    "id" : "8045e44e-974e-4f43-9861-7f0326782677",
    "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
  }, {
    "id" : "8045e44e-974e-4f43-9862-7f0326782688",
    "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
  } ]
}

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: 368

{
  "id" : "8045e44e-974e-4f43-9862-7f0326782655",
  "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,
  "isDefault" : true,
  "isImageBased" : true
}

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: 2007

[ {
  "id" : "bbcb8e27-2af5-4662-9631-d7982e132bbc",
  "name" : "sfo-w01-cl01-vds01",
  "isUsedByNsxt" : true,
  "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" : "STATIC",
    "vlanId" : 0
  }, {
    "name" : "sfo-w01-cl01-vds01-pg-vmotion",
    "transportType" : "VMOTION",
    "portBindingType" : "STATIC",
    "vlanId" : 0
  } ],
  "niocBandwidthAllocations" : [ {
    "type" : "vsan",
    "niocTrafficResourceAllocation" : {
      "sharesInfo" : {
        "shares" : 0,
        "level" : "high"
      }
    }
  }, {
    "type" : "vmotion",
    "niocTrafficResourceAllocation" : {
      "sharesInfo" : {
        "shares" : 0,
        "level" : "low"
      }
    }
  }, {
    "type" : "vdp",
    "niocTrafficResourceAllocation" : {
      "sharesInfo" : {
        "shares" : 0,
        "level" : "low"
      }
    }
  }, {
    "type" : "nfs",
    "niocTrafficResourceAllocation" : {
      "sharesInfo" : {
        "shares" : 0,
        "level" : "low"
      }
    }
  }, {
    "type" : "hbr",
    "niocTrafficResourceAllocation" : {
      "sharesInfo" : {
        "shares" : 0,
        "level" : "low"
      }
    }
  }, {
    "type" : "iSCSI",
    "niocTrafficResourceAllocation" : {
      "sharesInfo" : {
        "shares" : 0,
        "level" : "low"
      }
    }
  }, {
    "type" : "virtualMachine",
    "niocTrafficResourceAllocation" : {
      "sharesInfo" : {
        "shares" : 0,
        "level" : "high"
      }
    }
  }, {
    "type" : "management",
    "niocTrafficResourceAllocation" : {
      "sharesInfo" : {
        "shares" : 0,
        "level" : "normal"
      }
    }
  }, {
    "type" : "faultTolerance",
    "niocTrafficResourceAllocation" : {
      "sharesInfo" : {
        "shares" : 0,
        "level" : "low"
      }
    }
  } ],
  "version" : "7.0.3"
} ]

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

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

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

    • License key of ESXi

  • 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" : "eb8df750-a3be-4a59-b650-57c6c372d2c5",
        "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"
          } ]
        }
      } ]
    }
  }
}'

HTTP Request

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

{
  "clusterUpdateSpec" : {
    "clusterExpansionSpec" : {
      "hostSpecs" : [ {
        "id" : "eb8df750-a3be-4a59-b650-57c6c372d2c5",
        "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"
          } ]
        }
      } ]
    }
  }
}

HTTP Response

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

{
  "id" : "bf2b4d88-c811-4332-ac16-df5fcf74b45f",
  "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" : "d97a25b0-8582-4c39-8ed1-e529087a79ba",
      "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"
        } ]
      }
    } ]
  }
}'

HTTP Request

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

{
  "clusterExpansionSpec" : {
    "hostSpecs" : [ {
      "id" : "d97a25b0-8582-4c39-8ed1-e529087a79ba",
      "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"
        } ]
      }
    } ]
  }
}

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" : "d131e7a3-70bf-47df-9f92-f09dfa94f143"
    } ]
  }
}'

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" : "d131e7a3-70bf-47df-9f92-f09dfa94f143"
    } ]
  }
}

HTTP Response

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

{
  "id" : "f511fec5-5b98-42b7-b569-9888c1f0f032",
  "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" : "04d14a28-fe9d-4343-84cb-5c322c061fc6"
    } ]
  }
}'

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" : "04d14a28-fe9d-4343-84cb-5c322c061fc6"
    } ]
  }
}

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 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" : "0f0f539c-0234-446a-9f45-b31dc054e5e4",
      "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
      "username" : "root",
      "hostNetworkSpec" : {
        "vmNics" : [ {
          "id" : "vmnic0",
          "vdsName" : "sfo-w01-cl02-vds01",
          "moveToNvds" : false
        }, {
          "id" : "vmnic1",
          "vdsName" : "sfo-w01-cl02-vds02",
          "moveToNvds" : false
        } ]
      }
    } ],
    "witnessSpec" : {
      "vsanIp" : "10.0.4.88",
      "fqdn" : "witness-vsan.sfo.rainpole.io",
      "vsanCidr" : "10.0.4.0/24"
    },
    "witnessTrafficSharedWithVsanTraffic" : false,
    "secondaryAzOverlayVlanId" : 0
  }
}'

HTTP Request

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

{
  "clusterStretchSpec" : {
    "hostSpecs" : [ {
      "id" : "0f0f539c-0234-446a-9f45-b31dc054e5e4",
      "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
      "username" : "root",
      "hostNetworkSpec" : {
        "vmNics" : [ {
          "id" : "vmnic0",
          "vdsName" : "sfo-w01-cl02-vds01",
          "moveToNvds" : false
        }, {
          "id" : "vmnic1",
          "vdsName" : "sfo-w01-cl02-vds02",
          "moveToNvds" : false
        } ]
      }
    } ],
    "witnessSpec" : {
      "vsanIp" : "10.0.4.88",
      "fqdn" : "witness-vsan.sfo.rainpole.io",
      "vsanCidr" : "10.0.4.0/24"
    },
    "witnessTrafficSharedWithVsanTraffic" : false,
    "secondaryAzOverlayVlanId" : 0
  }
}

HTTP Response

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

{
  "id" : "bb566b92-f051-4667-bbcc-4a5ba221daa2",
  "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" : "3a880dc7-fdc6-47fc-a9e2-b811a01241a0",
      "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
      "username" : "root",
      "hostNetworkSpec" : {
        "vmNics" : [ {
          "id" : "vmnic0",
          "vdsName" : "sfo-w01-cl02-vds01",
          "moveToNvds" : false
        }, {
          "id" : "vmnic1",
          "vdsName" : "sfo-w01-cl02-vds02",
          "moveToNvds" : false
        } ]
      }
    } ],
    "witnessSpec" : {
      "vsanIp" : "10.0.4.88",
      "fqdn" : "witness-vsan.sfo.rainpole.io",
      "vsanCidr" : "10.0.4.0/24"
    },
    "witnessTrafficSharedWithVsanTraffic" : false,
    "secondaryAzOverlayVlanId" : 0
  }
}'

HTTP Request

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

{
  "clusterStretchSpec" : {
    "hostSpecs" : [ {
      "id" : "3a880dc7-fdc6-47fc-a9e2-b811a01241a0",
      "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
      "username" : "root",
      "hostNetworkSpec" : {
        "vmNics" : [ {
          "id" : "vmnic0",
          "vdsName" : "sfo-w01-cl02-vds01",
          "moveToNvds" : false
        }, {
          "id" : "vmnic1",
          "vdsName" : "sfo-w01-cl02-vds02",
          "moveToNvds" : false
        } ]
      }
    } ],
    "witnessSpec" : {
      "vsanIp" : "10.0.4.88",
      "fqdn" : "witness-vsan.sfo.rainpole.io",
      "vsanCidr" : "10.0.4.0/24"
    },
    "witnessTrafficSharedWithVsanTraffic" : false,
    "secondaryAzOverlayVlanId" : 0
  }
}

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/4eb6617a-daba-44bb-b3c9-efe8d4c00e9e
Content-Length: 160

{
  "id" : "4eb6617a-daba-44bb-b3c9-efe8d4c00e9e",
  "name" : "Remove Cluster",
  "status" : "IN_PROGRESS",
  "creationTimestamp" : "2023-05-22T06:20:39.603Z"
}
  • 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.

Last updated 2023-05-21 23:30:49 PDT

Operations
POST
Add Datastore To Cluster
Mount a datastore to a cluster
GET
Assignable Tags To Cluster
get assignable Tags to Cluster
PUT
Assign Tags To Existing 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
GET
Get Cluster Datastores
Get the list of all datastores associated with the cluster.
GET
Get Clusters
Get the 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 Tags Assigned To Cluster
Get Tags assigned to Cluster
GET
Get Tags Assigned To Clusters
Get Tags assigned to Clusters
GET
Get Vdses
Get the list of VDSes of a 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 Existing Cluster
Remove Tags From 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 Operations
Validate input specification for updating given Cluster
POST
Validate Clusters Operations
Validate the input specification for Cluster creation
POST
Validate Vsan Remote Datastore Spec
Validate the input spec for mounting vSAN remote datastore to an existing cluster