[{"label":"Latest (4.4.0)","version":"latest"},{"version":"4.3.1"},{"link":"https://developer.vmware.com/apis/1126/vmware-cloud-foundation","version":"4.3"},{"link":"https://developer.vmware.com/apis/1077/vmware-cloud-foundation","version":"4.2"},{"link":"https://developer.vmware.com/apis/1032/vmware-cloud-foundation","version":"4.1"},{"link":"https://developer.vmware.com/apis/1002/vmware-cloud-foundation","version":"4.0.1"},{"link":"https://developer.vmware.com/apis/921/vmware-cloud-foundation","version":"4.0"},{"link":"https://developer.vmware.com/apis/925/vmware-cloud-foundation","version":"3.10"},{"link":"https://developer.vmware.com/apis/891/vmware-cloud-foundation","version":"3.9.1"},{"link":"https://developer.vmware.com/apis/723/vmware-cloud-foundation","version":"3.9.0"},{"link":"https://developer.vmware.com/apis/711/vmware-cloud-foundation","version":"3.8.1"},{"link":"https://developer.vmware.com/apis/685/vmware-cloud-foundation","version":"3.8"}]
vcf
VMware Cloud Foundation API Reference Guide

Domains

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 should not be specified in the input spec.

    * 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",
    "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"
      } ]
    }
  }
  • 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" : "33a49fdb-0692-4a4c-9fa6-28c293bd0fbd",
        "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" : "b77954a4-ceb3-4940-9d86-e6d0a63ac472",
        "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" : "721f6b59-1631-4d16-8b0e-e48f052b6d19",
        "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",
    "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"
      } ]
    }
  }
}'

HTTP Request

POST /v1/domains/validations HTTP/1.1
Content-Type: application/json
Content-Length: 4288
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" : "33a49fdb-0692-4a4c-9fa6-28c293bd0fbd",
        "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" : "b77954a4-ceb3-4940-9d86-e6d0a63ac472",
        "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" : "721f6b59-1631-4d16-8b0e-e48f052b6d19",
        "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",
    "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"
      } ]
    }
  }
}

HTTP Response

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

{
  "id" : "1f881d0b-78e3-4596-90fd-fed1605b9349",
  "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" : "4d1fd614-3fac-444c-912a-239dcbb11b67",
        "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" : "6bc8b253-0e1c-4c9a-8457-3b6efd46a007",
        "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" : "75afa692-fb28-4c06-96bc-1c7f61aca755",
        "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",
    "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"
      } ]
    }
  }
}'

HTTP Request

POST /v1/domains HTTP/1.1
Content-Type: application/json
Content-Length: 4288
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" : "4d1fd614-3fac-444c-912a-239dcbb11b67",
        "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" : "6bc8b253-0e1c-4c9a-8457-3b6efd46a007",
        "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" : "75afa692-fb28-4c06-96bc-1c7f61aca755",
        "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",
    "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"
      } ]
    }
  }
}

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/af5cacdf-9bb6-4b96-8a42-112da32c16c2
Content-Length: 142

{
  "id" : "af5cacdf-9bb6-4b96-8a42-112da32c16c2",
  "name" : "",
  "status" : "UNKNOWN",
  "creationTimestamp" : "2021-11-03T11:56:32.410Z"
}
  • 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/3b53074a-10d2-4650-a1ed-cc4146c042c2/endpoints' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/domains/3b53074a-10d2-4650-a1ed-cc4146c042c2/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" : "27c7e932-1774-4e68-85bd-9be1abf7989d",
  "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: 113

{
  "name" : "Mark domain with id f74c2d97-621a-4984-9ab6-5d84effde82f 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 'Authorization: Bearer etYWRta....'

HTTP Request

DELETE /v1/domains/f74c2d97-621a-4984-9ab6-5d84effde82f HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/f545cc0a-0967-48e7-98bd-642d092b83f4
Content-Length: 142

{
  "id" : "f545cc0a-0967-48e7-98bd-642d092b83f4",
  "name" : "",
  "status" : "UNKNOWN",
  "creationTimestamp" : "2021-11-03T11:56:29.668Z"
}
  • 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 2021-11-03 05:03:41 PDT

Operations



[{"label":"Latest (4.4.0)","version":"latest"},{"version":"4.3.1"},{"link":"https://developer.vmware.com/apis/1126/vmware-cloud-foundation","version":"4.3"},{"link":"https://developer.vmware.com/apis/1077/vmware-cloud-foundation","version":"4.2"},{"link":"https://developer.vmware.com/apis/1032/vmware-cloud-foundation","version":"4.1"},{"link":"https://developer.vmware.com/apis/1002/vmware-cloud-foundation","version":"4.0.1"},{"link":"https://developer.vmware.com/apis/921/vmware-cloud-foundation","version":"4.0"},{"link":"https://developer.vmware.com/apis/925/vmware-cloud-foundation","version":"3.10"},{"link":"https://developer.vmware.com/apis/891/vmware-cloud-foundation","version":"3.9.1"},{"link":"https://developer.vmware.com/apis/723/vmware-cloud-foundation","version":"3.9.0"},{"link":"https://developer.vmware.com/apis/711/vmware-cloud-foundation","version":"3.8.1"},{"link":"https://developer.vmware.com/apis/685/vmware-cloud-foundation","version":"3.8"}]
vcf
Feedback

Was this page helpful?