To create a VDC template, POST a VMWVdcTemplate element to the system URL for adding VDC templates.

In its simplest form, a VDC template must include references to the following objects:
  • A Provider VDC
  • A Provider VDC storage profile defined in that Provider VDC
When this form of VDC template is instantiated in an organization, it creates an organization VDC that has no Edge Gateway or routed networking capability. An organization administrator can create isolated networks in it. A system administrator can add networking capability to an organization VDC, whether or not it was created from a template, by following the procedures documented in Create an Edge Gateway and Create an Organization VDC Network.

Prerequisites

This operation is restricted to system administrators.

Procedure

  1. Retrieve the XML representation of the vSphere platform extensions.
    Use a request like this one.
    GET https://vcloud.example.com/api/admin/extension
  2. Examine the response to locate the Link element that contains the URL for adding VDC templates to the system.
    This element has a rel attribute value of add and a type attribute value of application/vnd.vmware.admin.vmwVdcTemplate+xml, as shown here:
    <Link
       rel="add"
       href="https://vcloud.example.com/api/admin/extension/action/vdcTemplates"
       type="application/vnd.vmware.admin.vmwVdcTemplate+xml"/>
  3. Choose a provider VDC to supply resources for organization VDCs that are created by instantiating this template.
    You can use a query like this one to list all the Provider VDCs in the system.
    GET https://vcloud.example.com/api/query?type=providerVdc&format=references
  4. Create a VMWVdcTemplate request body.
    1. Include a ProviderVdcReference that references the Provider VDC that you chose in Step 3.
    2. Include a VdcTemplateSpecification element that specifies how compute resources are allocated by organization VDCs created from this template.
      Each resource allocation model is defined in a subtype of VMWVdcTemplateSpecificationType. Specify one of the following allocation models by setting the value of the VdcTemplateSpecification element's type attribute as shown.
      AllocationVapp
      <VdcTemplateSpecification
            type="VMWAllocationVappVdcTemplateSpecificationType">
      
      Specifies an AllocationVApp (Pay as you go) allocation model. Resources are committed to the organization VDC only when vApps are created in it. When you use this allocation model, Limit values that you specify for Memory and CPU are ignored when you create a vApp, and are 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
      <VdcTemplateSpecification
            type="VMWAllocationPoolVdcTemplateSpecificationType">
      
      Specifies an AllocationPool allocation model. Only a percentage of the resources you allocate are committed to the organization VDC.
      ReservationPool
      <VdcTemplateSpecification
            type="VMWReservationPoolVdcTemplateSpecificationType">
      
      Specifies a ReservationPool allocation model. 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.
    3. Include at least one VdcStorageProfile element that specifies a ProviderVdcStorageProfile defined in the Provider VDC you chose in Step 3.
      You can use a query like this one to list all the Provider VDC storage profiles in the system. A filter expression constrains the output to just those Provider VDC storage profiles that are associated with a single Provider VDC, vCenter01, in this case.
      GET https://vcloud.example.com/api/query?type=providerVdc&format=references&filter=providerVdc==vCenter01
      The specified Provider VDC storage profiles are made available in organization VDCs created from this template.
  5. POST the VMWVdcTemplate request body to the system's add link for vdcTemplates.
    See the request portion of Create a VDC Template.

Results

The system creates the VDC template and returns a VMWVdcTemplate element that includes a set of Link elements that you can use to access, remove, or modify the new template.

Example: Create a VDC Template

This request creates a VDC template that, when instantiated, adds an AllocationVapp VDC to an organization. An organization VDC created by instantiating this template has many of the same properties as the one created in Create an Organization VDC with Pay As You Go Reservation Allocation Model.

Request:
POST https://vcloud.example.com/api/admin/extension/vdcTemplates
Content-Type: application/vnd.vmware.admin.vmwVdcTemplate+xml
<?xml version="1.0" encoding="UTF-8"?>
<vmext:VMWVdcTemplate
   ...
   xmlns="http://www.vmware.com/vcloud/v1.5"
   xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   name="example-vdc-template">
   <Description>Example AllocationVapp VDC Template without Edge Gateway</Description>
   <vmext:TenantName>PayAsYouGo-VDCTemplate-no-net</vmext:TenantName>
   <vmext:TenantDescription>PayAsYouGo VDC with no networking</vmext:TenantDescription>
   <vmext:ProviderVdcReference
      href="https://vcloud.example.com/api/admin/providervdc/35"
      name="vCenter01"
      type="application/vnd.vmware.admin.providervdc+xml" />
   <vmext:VdcTemplateSpecification
      xsi:type="vmext:VMWAllocationVappVdcTemplateSpecificationType">
      <NicQuota>100</NicQuota>
      <VmQuota>50</VmQuota>
      <ProvisionedNetworkQuota>100</ProvisionedNetworkQuota>
      <StorageProfile name="Bronze">
         <Enabled>true</Enabled>
         <Units>MB</Units>
         <Limit>2097152</Limit>
         <Default>true</Default>
      </StorageProfile>
      <vmext:ThinProvision>false</vmext:ThinProvision>
      <vmext:FastProvisioningEnabled>false</vmext:FastProvisioningEnabled>
      <CpuAllocationMhz>2048</CpuAllocationMhz>
      <CpuLimitMhzPerVcpu>1000</CpuLimitMhzPerVcpu>
      <MemoryAllocationMB>2048</MemoryAllocationMB>
      <CpuGuaranteedPercentage>1</CpuGuaranteedPercentage>
      <MemoryGuaranteedPercentage>1</MemoryGuaranteedPercentage>
   </vmext:VdcTemplateSpecification>
</vmext:VMWVdcTemplate>
Response:
201 Created
Content-Type: application/vnd.vmware.admin.vmwVdcTemplate+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<vmext:VMWVdcTemplate
   xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5"
   xmlns:vcloud="http://www.vmware.com/vcloud/v1.5"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   name="example-vdc-template" ...>
   <vcloud:Link
      rel="edit"
      href="https://vcloud.example.com/api/admin/extension/vdcTemplate/100"
      type="application/vnd.vmware.admin.vmwVdcTemplate+xml"/>
   <vcloud:Link
      rel="remove"
      href="https://vcloud.example.com/api/admin/extension/vdcTemplate/100"/>
   <vcloud:Link
      rel="down"
      href="https://vcloud.example.com/api/admin/extension/vdcTemplate/100/controlAccess/"
      type="application/vnd.vmware.vcloud.controlAccess+xml"/>
   <vcloud:Link
      rel="controlAccess"
      href="https://vcloud.example.com/api/admin/extension/vdcTemplate/100/action/controlAccess"
      type="application/vnd.vmware.vcloud.controlAccess+xml"/>
   <vcloud:Link
      rel="alternate"
      href="https://vcloud.example.com/api/vdcTemplate/100"
      type="application/vnd.vmware.admin.vdcTemplate+xml"/>
   <vcloud:Description>Example AllocationVapp VDC Template without Edge Gateway</vcloud:Description>
   <vmext:TenantName>PayAsYouGo-VDCTemplate-no-net</vmext:TenantName>
   <vmext:TenantDescription>PayAsYouGo VDC with no networking</vmext:TenantDescription>
   <vmext:ProviderVdcReference
      href="https://vcloud.example.com/api/admin/providervdc/35"
      name="pvdc"
      type="application/vnd.vmware.admin.providervdc+xml"/>
   <vmext:VdcTemplateSpecification
      xsi:type="vmext:VMWAllocationVappVdcTemplateSpecificationType">
      ...
   </vmext:VdcTemplateSpecification>
</vmext:VMWVdcTemplate>