A system administrator can allocate resources from a provider vDC to a vDC in an organization by POSTing a CreateVdcParams element to an organization’s add URL for vDCs.

Verify that you are logged in to the vCloud API as a system administrator.

Retrieve the list of network pools. Several types of organization vDC networks require the vDC to include a network pool, which you can specify when you create or update the vDC. See Retrieve a List of External Networks and Network Pools for information about how to retrieve this list.

1

Retrieve the XML representation of the organization to which you want to add the vDC.

Use a request like this one:

GET https://vcloud.example.com/api/admin/org/26
2

Examine the response to locate the Link element that contains the URL for adding vDCs to the organization.

This element has a rel attribute value of add and a type attribute value of application/vnd.vmware.admin.createVdcParams+xml, as shown here:

<Link
   href="https://vcloud.example.com/api/admin/org/26/vdcsparams"
   rel="add" 
   type="application/vnd.vmware.admin.createVdcParams+xml"/>
3

Choose a provider vDC to supply resources for the new organization vDC.

a

Retrieve the XML representation of the VCloud object and examine the ProviderVdcReferences element it contains.

The following request retrieves the representation of the VCloud object:

GET https://vcloud.example.com/api/admin

The VCloud element contains a ProviderVdcReferences element. Each provider vDC in the system is represented in that element by a ProviderVdcReference element, as shown here:

<ProviderVdcReference
   type="application/vnd.vmware.admin.providervdc+xml"
   name="Main Provider"
   href="https://vcloud.example.com/api/admin/providervdc/2"/>
b

(Optional) List the organization vDCs that each ProviderVdc supports.

The following request retrieves the list of organization vDCs that .../providervdc/2 supports:

GET https://vcloud.example.com/api/admin/providervdc/2/vdcReferences

Taking this optional step can help you allocate ProviderVdc resources equitably across the organization vDCs in a cloud.

4

Create a CreateVdcParams request body.

a

Include an AllocationModel element that specifies how compute resources are allocated by this vDC.

Choose one of the following values for AllocationModel:

AllocationVApp

Pay as you go. Resources are committed to the organization vDC only when vApps are created in it. When you use this allocation model, any Limit values you specify for Memory and CPU are ignored when you create a vApp and returned as 0 when you retrieve a vApp. Resources available to this kind of organization vDC can grow or shrink as needed when its provider vDC has multiple resource pools.

AllocationPool

Only a percentage of the resources you allocate are committed to the organization vDC.

ReservationPool

All the resources you allocate are committed as a pool to the organization vDC. vApps in vDCs that support this allocation model can specify values for resources and limitations.

b

Include at least one VdcStorageProfile element that specifies a ProviderVdcStorageProfile defined in the Provider vDC you chose in Step 3.

c

Include a NetworkPoolReference element.

The vDC must include a network pool if you want to create routed or isolated networks in it.

d

Include a ProviderVdcReference element that contains a reference to the Provider vDC you chose in Step 3.

See the request portion of Example: Create an Organization vDC.

5

POST the CreateVdcParams request body to the organization's add link for vdcs.

See the request portion of Example: Create an Organization vDC.

The server creates the new vDC in the specified organization and returns an AdminVdc element that includes a set of Link elements that you can use to access, remove, or modify the new vDC. Users can reference this vDC using the URL specified in the href attribute in the Link where rel="alternate". See the response portion of Example: Create an Organization vDC.

This example adds an AllocationvApp vDC to the organization created in Example: Create an Organization. The new organization vDC is provisioned from the Provider vDC created in Create a Provider vDC, and includes a storage profile named Silver, which is backed by one of the storage profiles available in the Provider vDC. It also includes a network pool, so that it is capable of supporting routed and isolated organization vDC networks. See Retrieve a List of External Networks and Network Pools for information on how to find a NetworkPoolReference to use.

Request:

POST https://vcloud.example.com/api/admin/org/26/vdcsparams
Content-Type: application/vnd.vmware.admin.createVdcParams+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<CreateVdcParams
   name="org26vdc1"
   xmlns="http://www.vmware.com/vcloud/v1.5">
   <Description>Example vDC</Description>
   <AllocationModel>AllocationVApp</AllocationModel>
   <ComputeCapacity>
      <Cpu>
         <Units>MHz</Units>
         <Allocated>2048</Allocated>
         <Limit>2048</Limit>
      </Cpu>
      <Memory>
         <Units>MB</Units>
         <Allocated>2048</Allocated>
         <Limit>2048</Limit>
      </Memory>
   </ComputeCapacity>
   <NicQuota>0</NicQuota>
   <NetworkQuota>100</NetworkQuota>
   <VdcStorageProfile>
   <Enabled>true</Enabled>
      <Units>MB</Units>
      <Limit>20480</Limit>
      <Default>true</Default>
      <ProviderVdcStorageProfile
         href="https://vcloud.example.com/api/admin/pvdcStorageProfile/101" />
   </VdcStorageProfile>
   <ResourceGuaranteedMemory>1</ResourceGuaranteedMemory>
   <ResourceGuaranteedCpu>1</ResourceGuaranteedCpu>
   <VCpuInMhz>2048</VCpuInMhz>
   <IsThinProvision>false</IsThinProvision>
   <NetworkPoolReference
      href="https://vcloud.example.com/api/admin/extension/networkPool/313"/>
   <ProviderVdcReference
      name="Main Provider"
      href="https://vcloud.example.com/api/admin/providervdc/35" />
   <UsesFastProvisioning>true</UsesFastProvisioning>
</CreateVdcParams>

The response, a subset of which appears here, contains information extracted from the request, and includes a Task element that tracks creation of the vDC. The response also includes Link elements that enable administrative operations on the vDC, and a Capabilities element that lists the VMware virtual hardware architectures that the vDC supports. These elements are retrieved from the Provider vDC that you specified when you created the CreateVdcParams. While the vDC is under construction, its status remains 0.

Response:

201 Created
Content-Type: application/vnd.vmware.admin.vdc+xml
...
<AdminVdc
   xmlns="http://www.vmware.com/vcloud/v1.5"
   status="0"
   name="org26vdc1"
   id="urn:vcloud:vdc:44"
   type="application/vnd.vmware.admin.vdc+xml"
   href="https://vcloud.example.com/api/admin/vdc/44" ... >
   <Link
      rel="up"
      type="application/vnd.vmware.admin.organization+xml"
      href="https://vcloud.example.com/api/admin/org/26" />
   <Link
      rel="down"
      type="application/vnd.vmware.vcloud.metadata+xml"
      href="https://vcloud.example.com/api/admin/vdc/44/metadata" />
   <Link
      rel="alternate"
      type="application/vnd.vmware.vcloud.vdc+xml"
      href="https://vcloud.example.com/api/vdc/44" />
   <Link
      rel="down"
      type="application/vnd.vmware.admin.OrganizationVdcResourcePoolSet+xml"
      href="https://vcloud.example.com/api/admin/extension/vdc/44/resourcePools" />
   <Description>Example vDC</Description>
   ...
   <Tasks>
      <Task
         name="task"
         status="running"
         operation="Creating Virtual Datacenter org26vdc1(44)"
         ...
      </Task>
   </Tasks>
   <AllocationModel>AllocationVApp</AllocationModel>
   ...
   <Capabilities>
      <SupportedHardwareVersions>
         <SupportedHardwareVersion>vmx-04</SupportedHardwareVersion>
         <SupportedHardwareVersion>vmx-08</SupportedHardwareVersion>
      </SupportedHardwareVersions>
   </Capabilities>
   ...
</AdminVdc>

When construction is complete, the status changes to 1 and the Task is no longer included in representation. The following changes in the AdminVdc are also evident:

A reference to the vSphere resource pool that supports the vDC appears in a VCloudExtension element.

There is an empty ResourceEntities element, because the vDC contains no Media, VAppTemplate, or Disk entities. For information about adding them, see Provisioning an Organization.

There is an empty AvailableNetworks element. To add networks to this organization vDC, see Create an Organization vDC Network.

Additional Link elements are included for operations that are now valid, but that were not valid while the vDC was under construction.

<AdminVdc
   xmlns="http://www.vmware.com/vcloud/v1.5"
   xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5"
   status="1"
   name="org26vdc1"
   id="urn:vcloud:vdc:44"
   type="application/vnd.vmware.admin.vdc+xml"
   href="https://vcloud.example.com/api/admin/vdc/44" ... >
   <VCloudExtension
      required="false">
      <vmext:VimObjectRef>
         <vmext:VimServerRef
            type="application/vnd.vmware.admin.vmwvirtualcenter+xml"
            name="vc1"
            href="https://vcloud.example.com/api/admin/extension/vimServer/9" />
         <vmext:MoRef>resgroup-949</vmext:MoRef>
         <vmext:VimObjectType>RESOURCE_POOL</vmext:VimObjectType>
      </vmext:VimObjectRef>
   </VCloudExtension>
     <Link
      rel="up"
      type="application/vnd.vmware.admin.organization+xml"
      href="https://vcloud.example.com/api/admin/org/e0b93bca-5dc2-453c-b3dc-bba8067d32b6" />
   <Link
      rel="edit"
      type="application/vnd.vmware.admin.vdc+xml"
      href="https://vcloud.example.com/api/admin/vdc/44" />
   <Link
      rel="disable"
      href="https://vcloud.example.com/api/admin/vdc/44/action/disable" />
   <Link
      rel="down"
      type="application/vnd.vmware.vcloud.metadata+xml"
      href="https://vcloud.example.com/api/admin/vdc/44/metadata" />
   <Link
      rel="alternate"
      type="application/vnd.vmware.vcloud.vdc+xml"
      href="https://vcloud.example.com/api/vdc/44" />
   <Link
      rel="add"
      type="application/vnd.vmware.admin.edgeGateway+xml"
      href="https://vcloud.example.com/api/admin/vdc/44/edgeGateways" />
   <Link
      rel="edgeGateways"
      type="application/vnd.vmware.vcloud.query.records+xml"
      href="https://vcloud.example.com/api/admin/vdc/44/edgeGateways" />
   <Link
      rel="add"
      type="application/vnd.vmware.vcloud.orgVdcNetwork+xml"
      href="https://vcloud.example.com/api/admin/vdc/44/networks" />
   <Link
      rel="orgVdcNetworks"
      type="application/vnd.vmware.vcloud.query.records+xml"
      href="https://vcloud.example.com/api/admin/vdc/44/networks" />
   <Link
      rel="down"
      type="application/vnd.vmware.admin.OrganizationVdcResourcePoolSet+xml"
      href="https://vcloud.example.com/api/admin/extension/vdc/44/resourcePools" />
   <Link
      rel="edit"
      type="application/vnd.vmware.admin.updateVdcStorageProfiles+xml"
      href="https://vcloud.example.com/api/admin/vdc/44/vdcStorageProfiles" />
   ...
   <ResourceEntities />
   <AvailableNetworks />
   ...
   <VdcStorageProfiles name="Silver">
      <Units>MB</Units>
      <Limit>20480</Limit>
      <Default>false</Default>
   </VdcStorageProfiles>
   ...
</AdminVdc>