Domains APIs

Domains APIs

APIs for managing Domains

A workload domain is a policy based resource container with specific availability and performance attributes that combines compute (vSphere), storage (vSAN/NFS/VMFS on FC/VVOL) and networking (NSX) into a single consumable entity.

1. Create a Domain

The Create a Domain workflow automatically:

  • Deploys an additional vCenter Server Appliance for the new domain within the management domain.

  • By leveraging a separate vCenter Server instance per domain, software updates can be applied without impacting other domains. It also allows for each domain to have additional isolation as needed.

  • Connects the specified ESXi servers to this vCenter Server instance and groups them into a cluster. Each host is configured with the port groups applicable for the domain.

  • Configures networking on each ESXi host.

  • If vSAN or NFS storage is provided, they are configured on the ESXi hosts. If VMFS on FC storage provided, it's consumed.

  • For the first domain in your environment, the workflow deploys a cluster of three NSX-T Managers in the management domain. The workflow also configures an anti-affinity rule between the managers to prevent them from being on the same host for High Availability. Each subsequent NSX-T domains will share this NSX-T Manager Cluster or create its own.

  • From NSX-T version 3.0 onwards NSX-T manager uses vSphere Distributed Switch(VDS) created by vCenter to configure transport nodes and handle overlay traffic.

  • In case of single vSphere Distributed Switch domain, the same vSphere Distributed Switch will be used for configuring overlay traffic.

  • For a domain which creates multiple vSphere Distributed Switches, the boolean isUsedByNsxt in the VdsSpec should be set to true to identify the vSphere Distributed Switch which should be used by NSX-T for configuring overlay traffic.

    Refer to: VdsSpec.

  • In case of multiple vSphere Distributed Switches, at least one vSphere Distributed Switch has to be marked for use by NSX-T.

  • NSX Edges are needed to enable overlay VI networks and public networks for north-south traffic. Note that edges need to be deployed separately.

  • Clusters part of the domain can be configured to use IP address pools to assign IP addresses for the TEP interfaces of the hosts by specifying IpAddressPoolSpec inside the NsxTClusterSpec. If the IpAddressPoolSpec is not specified in the input spec, IP addresses for the TEP interfaces of the host are assigned from DHCP.

The result is a workload-ready SDDC environment.

1.1. Prerequisites

  • The following data is required

    • Name of the domain

    • vCenter details

      • Name of the vCenter

      • Network details

        • IP Address of the vCenter

        • FQDN of the vCenter

        • Gateway

        • Subnet mask

      • Password for the root user (8-20 characters)

      • Name of the datacenter where vCenter needs to be deployed

    • List of clusters, For each cluster

      • Name of the cluster

      • List of hosts, For each host

        • 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, once added to cluster

      • Datastore details

Note : Only one of "vsanDatastoreSpec" (For VSAN), "nfsDatastoreSpec" (For NFS), "vmfsDatastoreSpec" (For VMFS on FC) or "vvolDatastoreSpec" (For VVOL) 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 Vasa provider is pre-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"
          }
        } ]
      }

* 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 For NSX-T

    * VLAN ID of Geneve

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

      For DHCP

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

      For creating a new IP pool during the 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 the 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.

  • NSX details, For NSX-T

    • NSX Manager virtual machine details

      • Name of the NSX Manager virtual machine

      • Network details

        • IP Address of the virtual machine

        • Fully-qualified domain name

        • Gateway

        • Subnet mask

    • FormFactor of the NSX-T manager. Supported values are "small" , "medium" and "large"

Note : NSX-T manager of "large" form factor will be deployed if nothing is explicitly specified in the payload.

* Virtual IP address which would act as proxy/alias for NSX-T managers

* Fully-qualified domain name for VIP so that common SSL certificates can be installed across all managers

* License key for NSX-T

* NSX-T manager admin Password (basic authorization and SSH)

  {
    "nsxManagerSpecs" : [ {
      "name" : "sfo-w01-nsx01a",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.44",
        "dnsName" : "sfo-w01-nsx01a.sfo.rainpole.io",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    }, {
      "name" : "sfo-w01-nsx01b",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.45",
        "dnsName" : "sfo-w01-nsx01b.sfo.rainpole.io",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    }, {
      "name" : "sfo-w01-nsx01c",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.46",
        "dnsName" : "sfo-w01-nsx01c.sfo.rainpole.io",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    } ],
    "vip" : "10.0.0.166",
    "vipFqdn" : "sfo-w01-nsx01.sfo.rainpole.io",
    "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
    "nsxManagerAdminPassword" : "VMware123!",
    "formFactor" : "large"
  }
  • Network pool should be configured.

Tip : Refer to Create a Network Pool API

  • Hosts should be commissioned.

Tip : Refer to Commission the Hosts API

  • A DHCP server must be configured on the Geneve VLAN of the respective domains. When NSX-T creates VTEPs for the hosts in the domain, they are assigned IP addresses from the DHCP server. Ensure that host configuration has a minimum of two active vmNics.

    There must be a free uplink on each host to be used for the domain.

  • Evaluate if you need to have pNICs on multiple vSphere Distributed Switches if it is NSX-T 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.

Note : The below example is for creating a domain using vSAN storage (i.e "vsanDatastoreSpec" ) and NSX-T (i.e "nsxTSpec" and "nsxTClusterSpec")

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/validations' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "domainName" : "sfo-w01",
  "vcenterSpec" : {
    "name" : "sfo-w01-vc01",
    "networkDetailsSpec" : {
      "ipAddress" : "10.0.0.43",
      "dnsName" : "sfo-w01-vc01.sfo.rainpole.io",
      "gateway" : "10.0.0.250",
      "subnetMask" : "255.255.255.0"
    },
    "rootPassword" : "VMware123!",
    "datacenterName" : "sfo-w01-dc01",
    "vmSize" : "tiny",
    "storageSize" : "lstorage"
  },
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "sfo-w01-cl01",
      "hostSpecs" : [ {
        "id" : "a352708b-ace2-434a-9c64-25a2a54aad09",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "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"
          } ]
        }
      }, {
        "id" : "16bb4c74-9c61-430e-a013-c6618820e48c",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "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"
          } ]
        }
      }, {
        "id" : "2179d7f2-ad59-443c-94ad-b39f6f900679",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "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"
          } ]
        }
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
          "datastoreName" : "sfo-w01-cl01-ds-vsan01"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "sfo-w01-cl01-vds01",
          "portGroupSpecs" : [ {
            "name" : "sfo-w01-cl01-vds01-pg-mgmt",
            "transportType" : "MANAGEMENT"
          }, {
            "name" : "sfo-w01-cl01-vds01-pg-vsan",
            "transportType" : "VSAN"
          }, {
            "name" : "sfo-w01-cl01-vds01-pg-vmotion",
            "transportType" : "VMOTION"
          } ]
        }, {
          "name" : "sfo-w01-cl01-vds02",
          "isUsedByNsxt" : true
        } ],
        "nsxClusterSpec" : {
          "nsxTClusterSpec" : {
            "geneveVlanId" : 2
          }
        }
      }
    } ]
  },
  "nsxTSpec" : {
    "nsxManagerSpecs" : [ {
      "name" : "sfo-w01-nsx01a",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.44",
        "dnsName" : "sfo-w01-nsx01a.sfo.rainpole.io",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    }, {
      "name" : "sfo-w01-nsx01b",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.45",
        "dnsName" : "sfo-w01-nsx01b.sfo.rainpole.io",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    }, {
      "name" : "sfo-w01-nsx01c",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.46",
        "dnsName" : "sfo-w01-nsx01c.sfo.rainpole.io",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    } ],
    "vip" : "10.0.0.166",
    "vipFqdn" : "sfo-w01-nsx01.sfo.rainpole.io",
    "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
    "nsxManagerAdminPassword" : "VMware123!",
    "formFactor" : "large"
  }
}'

HTTP Request

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

{
  "domainName" : "sfo-w01",
  "vcenterSpec" : {
    "name" : "sfo-w01-vc01",
    "networkDetailsSpec" : {
      "ipAddress" : "10.0.0.43",
      "dnsName" : "sfo-w01-vc01.sfo.rainpole.io",
      "gateway" : "10.0.0.250",
      "subnetMask" : "255.255.255.0"
    },
    "rootPassword" : "VMware123!",
    "datacenterName" : "sfo-w01-dc01",
    "vmSize" : "tiny",
    "storageSize" : "lstorage"
  },
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "sfo-w01-cl01",
      "hostSpecs" : [ {
        "id" : "a352708b-ace2-434a-9c64-25a2a54aad09",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "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"
          } ]
        }
      }, {
        "id" : "16bb4c74-9c61-430e-a013-c6618820e48c",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "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"
          } ]
        }
      }, {
        "id" : "2179d7f2-ad59-443c-94ad-b39f6f900679",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "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"
          } ]
        }
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
          "datastoreName" : "sfo-w01-cl01-ds-vsan01"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "sfo-w01-cl01-vds01",
          "portGroupSpecs" : [ {
            "name" : "sfo-w01-cl01-vds01-pg-mgmt",
            "transportType" : "MANAGEMENT"
          }, {
            "name" : "sfo-w01-cl01-vds01-pg-vsan",
            "transportType" : "VSAN"
          }, {
            "name" : "sfo-w01-cl01-vds01-pg-vmotion",
            "transportType" : "VMOTION"
          } ]
        }, {
          "name" : "sfo-w01-cl01-vds02",
          "isUsedByNsxt" : true
        } ],
        "nsxClusterSpec" : {
          "nsxTClusterSpec" : {
            "geneveVlanId" : 2
          }
        }
      }
    } ]
  },
  "nsxTSpec" : {
    "nsxManagerSpecs" : [ {
      "name" : "sfo-w01-nsx01a",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.44",
        "dnsName" : "sfo-w01-nsx01a.sfo.rainpole.io",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    }, {
      "name" : "sfo-w01-nsx01b",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.45",
        "dnsName" : "sfo-w01-nsx01b.sfo.rainpole.io",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    }, {
      "name" : "sfo-w01-nsx01c",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.46",
        "dnsName" : "sfo-w01-nsx01c.sfo.rainpole.io",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    } ],
    "vip" : "10.0.0.166",
    "vipFqdn" : "sfo-w01-nsx01.sfo.rainpole.io",
    "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
    "nsxManagerAdminPassword" : "VMware123!",
    "formFactor" : "large"
  }
}

HTTP Response

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

{
  "id" : "b7a6017a-4972-41eb-9bd6-42ecd05ee7df",
  "description" : "Validating Domain Creation Spec",
  "executionStatus" : "COMPLETED",
  "resultStatus" : "SUCCEEDED",
  "validationChecks" : [ {
    "description" : "DomainCreationSpecValidation",
    "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/domains' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "domainName" : "sfo-w01",
  "vcenterSpec" : {
    "name" : "sfo-w01-vc01",
    "networkDetailsSpec" : {
      "ipAddress" : "10.0.0.43",
      "dnsName" : "sfo-w01-vc01.sfo.rainpole.io",
      "gateway" : "10.0.0.250",
      "subnetMask" : "255.255.255.0"
    },
    "rootPassword" : "VMware123!",
    "datacenterName" : "sfo-w01-dc01",
    "vmSize" : "tiny",
    "storageSize" : "lstorage"
  },
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "sfo-w01-cl01",
      "hostSpecs" : [ {
        "id" : "490baaaf-8184-473b-9faf-39db2ba5de6c",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "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"
          } ]
        }
      }, {
        "id" : "14f513ed-3744-4917-b356-c2b72fba734f",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "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"
          } ]
        }
      }, {
        "id" : "bccd0121-14d6-4d3e-b9dc-e74b5fba6d07",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "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"
          } ]
        }
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
          "datastoreName" : "sfo-w01-cl01-ds-vsan01"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "sfo-w01-cl01-vds01",
          "portGroupSpecs" : [ {
            "name" : "sfo-w01-cl01-vds01-pg-mgmt",
            "transportType" : "MANAGEMENT"
          }, {
            "name" : "sfo-w01-cl01-vds01-pg-vsan",
            "transportType" : "VSAN"
          }, {
            "name" : "sfo-w01-cl01-vds01-pg-vmotion",
            "transportType" : "VMOTION"
          } ]
        }, {
          "name" : "sfo-w01-cl01-vds02",
          "isUsedByNsxt" : true
        } ],
        "nsxClusterSpec" : {
          "nsxTClusterSpec" : {
            "geneveVlanId" : 2
          }
        }
      }
    } ]
  },
  "nsxTSpec" : {
    "nsxManagerSpecs" : [ {
      "name" : "sfo-w01-nsx01a",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.44",
        "dnsName" : "sfo-w01-nsx01a.sfo.rainpole.io",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    }, {
      "name" : "sfo-w01-nsx01b",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.45",
        "dnsName" : "sfo-w01-nsx01b.sfo.rainpole.io",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    }, {
      "name" : "sfo-w01-nsx01c",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.46",
        "dnsName" : "sfo-w01-nsx01c.sfo.rainpole.io",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    } ],
    "vip" : "10.0.0.166",
    "vipFqdn" : "sfo-w01-nsx01.sfo.rainpole.io",
    "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
    "nsxManagerAdminPassword" : "VMware123!",
    "formFactor" : "large"
  }
}'

HTTP Request

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

{
  "domainName" : "sfo-w01",
  "vcenterSpec" : {
    "name" : "sfo-w01-vc01",
    "networkDetailsSpec" : {
      "ipAddress" : "10.0.0.43",
      "dnsName" : "sfo-w01-vc01.sfo.rainpole.io",
      "gateway" : "10.0.0.250",
      "subnetMask" : "255.255.255.0"
    },
    "rootPassword" : "VMware123!",
    "datacenterName" : "sfo-w01-dc01",
    "vmSize" : "tiny",
    "storageSize" : "lstorage"
  },
  "computeSpec" : {
    "clusterSpecs" : [ {
      "name" : "sfo-w01-cl01",
      "hostSpecs" : [ {
        "id" : "490baaaf-8184-473b-9faf-39db2ba5de6c",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "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"
          } ]
        }
      }, {
        "id" : "14f513ed-3744-4917-b356-c2b72fba734f",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "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"
          } ]
        }
      }, {
        "id" : "bccd0121-14d6-4d3e-b9dc-e74b5fba6d07",
        "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
        "username" : "root",
        "hostNetworkSpec" : {
          "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"
          } ]
        }
      } ],
      "datastoreSpec" : {
        "vsanDatastoreSpec" : {
          "failuresToTolerate" : 1,
          "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
          "datastoreName" : "sfo-w01-cl01-ds-vsan01"
        }
      },
      "networkSpec" : {
        "vdsSpecs" : [ {
          "name" : "sfo-w01-cl01-vds01",
          "portGroupSpecs" : [ {
            "name" : "sfo-w01-cl01-vds01-pg-mgmt",
            "transportType" : "MANAGEMENT"
          }, {
            "name" : "sfo-w01-cl01-vds01-pg-vsan",
            "transportType" : "VSAN"
          }, {
            "name" : "sfo-w01-cl01-vds01-pg-vmotion",
            "transportType" : "VMOTION"
          } ]
        }, {
          "name" : "sfo-w01-cl01-vds02",
          "isUsedByNsxt" : true
        } ],
        "nsxClusterSpec" : {
          "nsxTClusterSpec" : {
            "geneveVlanId" : 2
          }
        }
      }
    } ]
  },
  "nsxTSpec" : {
    "nsxManagerSpecs" : [ {
      "name" : "sfo-w01-nsx01a",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.44",
        "dnsName" : "sfo-w01-nsx01a.sfo.rainpole.io",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    }, {
      "name" : "sfo-w01-nsx01b",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.45",
        "dnsName" : "sfo-w01-nsx01b.sfo.rainpole.io",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    }, {
      "name" : "sfo-w01-nsx01c",
      "networkDetailsSpec" : {
        "ipAddress" : "10.0.0.46",
        "dnsName" : "sfo-w01-nsx01c.sfo.rainpole.io",
        "gateway" : "10.0.0.250",
        "subnetMask" : "255.255.255.0"
      }
    } ],
    "vip" : "10.0.0.166",
    "vipFqdn" : "sfo-w01-nsx01.sfo.rainpole.io",
    "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
    "nsxManagerAdminPassword" : "VMware123!",
    "formFactor" : "large"
  }
}

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" with 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 Domains

2.1. Prerequisites

None

2.2. Steps

  • Invoke the API.

cURL Request

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

HTTP Request

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

HTTP Response

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

{
  "elements" : [ {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c5",
    "name" : "sfo-w01",
    "status" : "ACTIVE",
    "vcenters" : [ {
      "id" : "c0703437-6756-470b-9e1c-f9d3bbc9b1c6",
      "fqdn" : "sfo-w01-vc01.sfo.rainpole.io"
    } ],
    "clusters" : [ {
      "id" : "8045e44e-974e-4f43-9862-7f0326782655"
    } ],
    "nsxtCluster" : {
      "id" : "e9a878ef-00b3-4ed3-9f35-de79eb874e9a",
      "vip" : "10.0.0.30"
    },
    "capacity" : {
      "cpu" : {
        "used" : {
          "value" : 21.445999393465698,
          "unit" : "GHz"
        },
        "total" : {
          "value" : 67.03999810397931,
          "unit" : "MHz"
        }
      },
      "memory" : {
        "used" : {
          "value" : 156.0361328125,
          "unit" : "GB"
        },
        "total" : {
          "value" : 312.484375,
          "unit" : "GB"
        }
      },
      "storage" : {
        "used" : {
          "value" : 562.3904687464237,
          "unit" : "MB"
        },
        "total" : {
          "value" : 858.1875,
          "unit" : "GB"
        }
      }
    }
  }, {
    "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c1",
    "name" : "sfo-w02",
    "vcenters" : [ {
      "id" : "c0703437-6846-470b-9e1c-f9d3bbc9b1c9",
      "fqdn" : "sfo-w02-vc01.sfo.rainpole.io"
    } ],
    "clusters" : [ {
      "id" : "8045e44e-974e-4f43-9862-7f0326782677"
    }, {
      "id" : "8045e44e-974e-4f43-9861-7f0326782633"
    } ],
    "nsxtCluster" : {
      "id" : "e9a878ef-00b3-4ed3-9f35-de79eb874e9a",
      "vip" : "10.0.0.30"
    },
    "capacity" : {
      "cpu" : {
        "used" : {
          "value" : 21.445999393465698,
          "unit" : "GHz"
        },
        "total" : {
          "value" : 67.03999810397931,
          "unit" : "GHz"
        }
      },
      "memory" : {
        "used" : {
          "value" : 156.0361328125,
          "unit" : "GB"
        },
        "total" : {
          "value" : 312.484375,
          "unit" : "GB"
        }
      },
      "storage" : {
        "used" : {
          "value" : 562.3904687464237,
          "unit" : "GB"
        },
        "total" : {
          "value" : 858.1875,
          "unit" : "GB"
        }
      }
    }
  } ]
}

3. Get a Domain

3.1. Prerequisites

The following data is required

  • ID of the domain

3.2. Steps

  • Invoke the API using the ID of the domain

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/c0703437-6746-470b-9e1c-f9d3bbc9b1c5' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/domains/c0703437-6746-470b-9e1c-f9d3bbc9b1c5 HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

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

{
  "id" : "c0703437-6746-470b-9e1c-f9d3bbc9b1c5",
  "name" : "sfo-w01",
  "status" : "ACTIVE",
  "vcenters" : [ {
    "id" : "c0703437-6756-470b-9e1c-f9d3bbc9b1c6",
    "fqdn" : "sfo-w01-vc01.sfo.rainpole.io"
  } ],
  "clusters" : [ {
    "id" : "8045e44e-974e-4f43-9862-7f0326782655"
  } ],
  "nsxtCluster" : {
    "id" : "e9a878ef-00b3-4ed3-9f35-de79eb874e9a",
    "vip" : "10.0.0.30"
  },
  "capacity" : {
    "cpu" : {
      "used" : {
        "value" : 21.445999393465698,
        "unit" : "GHz"
      },
      "total" : {
        "value" : 67.03999810397931,
        "unit" : "MHz"
      }
    },
    "memory" : {
      "used" : {
        "value" : 156.0361328125,
        "unit" : "GB"
      },
      "total" : {
        "value" : 312.484375,
        "unit" : "GB"
      }
    },
    "storage" : {
      "used" : {
        "value" : 562.3904687464237,
        "unit" : "MB"
      },
      "total" : {
        "value" : 858.1875,
        "unit" : "GB"
      }
    }
  }
}

4. Get Domain Endpoints

4.1. Prerequisites

The following data is required

  • ID of the domain

4.2. Steps

  • Invoke the API.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/10d11ea8-b407-49fd-9d49-29a6f700672d/endpoints' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/domains/10d11ea8-b407-49fd-9d49-29a6f700672d/endpoints HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

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

{
  "elements" : [ {
    "type" : "VCENTER",
    "url" : "https://sfo-w01-vc01.sfo.rainpole.io"
  }, {
    "type" : "NSX_MANAGER",
    "url" : "https://sfo-w01-nsx01.sfo.rainpole.io"
  } ]
}

5. Rename a Domain

5.1. Prerequisites

  • Domain must exist.

5.2. Steps

  • Get the ID of the domain. Filter the response by the domain's current name to get the corresponding ID.

Tip : Get the Domains

  • Create a domain update spec. Create a JSON with the "name" field containing the desired new name.

Note : When renaming a domain, the "name" field must be the only value in the update spec.

Tip : DomainUpdateSpec

  • Invoke the validate update domain spec API to ensure the requested new name is valid.

cURL Request

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

HTTP Request

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

{
  "name" : "new_name"
}

HTTP Response

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

{
  "id" : "e64532ce-9489-4bd2-b7f3-5d54bcd80fca",
  "description" : "Validating Domain Update Spec",
  "executionStatus" : "COMPLETED",
  "resultStatus" : "SUCCEEDED",
  "validationChecks" : [ {
    "description" : "DomainUpdateSpecValidation",
    "resultStatus" : "SUCCEEDED"
  } ]
}

Tip : If "resultStatus" is "FAILED", make changes to the input specification and re-validate using a new API invocation.

  • Invoke the domain rename (update) task using the validated input spec and domain ID.

cURL Request

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

HTTP Request

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

{
  "name" : "new_name"
}

HTTP Response

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

{
  "status" : "SUCCESSFUL"
}

6. Delete a Domain

When you delete a domain, the clusters within the domain are deleted and the hosts are returned to the free pool.

Note : A domain cannot be deleted if the clusters of the domain have remote vSAN datastores configured. If so, unmount the remote vSAN datastores from vCenter and then retry domain deletion. Please refer to the 'VMware Cloud Foundation Administration Guide' for more details.

Warning : Deleting a domain is an irreversible operation. All clusters and VMs within the domain are deleted and the underlying datastores are destroyed.

Warning : Deleting a domain puts the host "status" to UNASSIGNED_UNUSEABLE . Cleanup the hosts to change the "status" to UNASSIGNED_USEABLE.

Note : The network pools used by the domain are not deleted as part of task and must be deleted separately.

6.1. Prerequisites

The following data is required

  • ID of the domain that has to be deleted.

Tip : Back up the data on the domain.

Tip : Migrate the VMs that you want to retain, to another domain.

6.2. Steps

  • Initialize the deletion.

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

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/f74c2d97-621a-4984-9ab6-5d84effde82f' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "markForDeletion" : true
}'

HTTP Request

PATCH /v1/domains/f74c2d97-621a-4984-9ab6-5d84effde82f 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
Content-Type: application/json
Content-Length: 341

{
  "name" : "Mark domain with ID f74c2d97-621a-4984-9ab6-5d84effde82f for deletion",
  "localizableDescriptionPack" : {
    "component" : "VCF",
    "messageKey" : "MARK_DOMAIN_FOR_DELETION",
    "arguments" : [ "f74c2d97-621a-4984-9ab6-5d84effde82f" ],
    "message" : "Mark Domain with ID %s for deletion"
  },
  "status" : "SUCCESSFUL"
}
  • Trigger the deletion.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/domains/f74c2d97-621a-4984-9ab6-5d84effde82f' -i -X DELETE \
    -H 'Content-Type: application/json' \
    -H 'Accept-Language: fr' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

DELETE /v1/domains/f74c2d97-621a-4984-9ab6-5d84effde82f HTTP/1.1
Content-Type: application/json
Accept-Language: fr
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/6d628f5e-d4ed-4c14-a657-32f404a2baa0
Content-Length: 161

{
  "id" : "6d628f5e-d4ed-4c14-a657-32f404a2baa0",
  "name" : "Removing domain",
  "status" : "IN_PROGRESS",
  "creationTimestamp" : "2022-01-24T14:09:57.210Z"
}
  • 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 2022-01-24 06:18:36 PST

Operations
POST
Assign Tags To Domain
Assign Tags to Domain
GET
Attachable Tags To Domain
get Attachable Tags to Domain
POST
Create Domain
Create a Domain
DELETE
Delete Domain
Delete a Domain if it has been previously initialized for deletion
POST
Detach Tags From Domain
Detach Tags From Domain
GET
Get Cluster Criteria
Get all cluster criteria
GET
Get Cluster Criterion
Get a criterion to query for cluster
GET
Get Cluster Query Response
Get cluster query response
GET
Get Clusters Query Response
Get clusters query response
GET
Get Domain
Get a Domain
GET
Get Domain Endpoints
Get Endpoints of a Domain
GET
Get Domains
Get the Domains
GET
Get Domain Tag Manager Url
Get Domain Tag Manager Url
GET
Get Tags Assigned To Domain
Get Tags assigned to Domain
POST
Post Cluster Query
Post a cluster query
POST
Post Clusters Query
Post clusters query
PATCH
Update Domain
Update a Domain
POST
Validate Domains Operations
Validate the input spec for domains operations