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:
■
| |
■
|
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.
1 | Retrieve the XML representation of the vSphere platform extensions. 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.
| ||||||
5 | POST the VMWVdcTemplate request body to the system's add link for vdcTemplates. See the request portion of Example: Create a VDC Template. |
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.
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 Example: Create an Organization VDC.
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>
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>