A VDC template can specify configurations for an Edge Gateway and organization VDC network. Each time this kind of template is instantiated, the resulting organization VDC contains an Edge Gateway and routed network. An organization administrator can then configure Edge Gateway services and add routed or isolated organization VDC networks as needed.

A VDC template with routed networking must include references to the following objects:
  • A Provider VDC
  • A Provider VDC storage profile defined in that Provider VDC
  • An external network available in that Provider VDC
  • A network pool associated with that Provider VDC
When it is instantiated, this form of VDC template creates an organization VDC that includes an Edge Gateway with a single uplink interface to the specified external network, and a single routed organization VDC network.

Prerequisites

This operation is restricted to system administrators.

Create a VMWVdcTemplate request body. The procedure shown here adds routed networking capability to a template like the one created in Create a VDC Template.

Procedure

  1. List the external networks and network pools associated with the Provider VDC referenced in the template's ProviderVdcReference element.
    Use a request like this one to retrieve the XML representation of the Provider VDC:
    GET https://vcloud.example.com/api/admin/extension/providervdc/35
    The AvailableNetworks element in the response lists the external networks associated with that Provider VDC. The NetworkPoolReferences element in the response lists references to all network pools associated with that Provider VDC.
    <vmext:VMWProviderVdc ... >
       ...
       <vcloud:AvailableNetworks>
          <vcloud:Network
             type="application/vnd.vmware.admin.network+xml"
             name="VC1-VLAN48"
             href="https://vcloud.example.com/api/admin/network/297" />
          <vcloud:Network ... />
          <vcloud:Network ... />
       </vcloud:AvailableNetworks>
       ...
       <vcloud:NetworkPoolReferences>
          <vcloud:NetworkPoolReference
             type="application/vnd.vmware.admin.networkPool+xml"
             name="VC1-VXLAN"
             href="https://vcloud.example.com/api/admin/extension/networkPool/313" />
       </vcloud:NetworkPoolReferences>
    </vmext:VMWProviderVdc>
    .
  2. Add a GatewayConfiguration element to the VdcTemplateSpecification.
    This GatewayConfiguration must include exactly one GatewayInterface. Its Network element must reference an external network from the list you retrieved in Step 1 and its InterfaceType must have a value of uplink. You cannot specify a BackwardCompatibilityMode or any SubnetParticipation in this GatewayConfiguration.
    1. Include a Network element that configures the initial organization VDC network for organization VDCs created from this template
      This Network must specify a FenceMode of natRouted, and cannot include any of the following elements:
      • BackwardCompatibilityMode
      • EdgeGateway
      • NetworkFeatures
      • RouterInfo
      • ServiceConfig
      • SyslogServerSettings
      Its IpScopes element must contain exactly one IpScope, which must have an IsInherited value of false and an IsEnabled value of true. This IpScope cannot include any of the following elements:
      • AllocatedIpAddresses
      • Dns1
      • Dns2
      • DnsSuffix
      • SubAllocations
      See the request portion of Create a VDC Template That Includes Routed Networking.
  3. Specify a network pool for the organization VDCs created from this template to use.
    You can add a NetworkPoolReference element from the list you retrieved in Step 1 or you can add an empty AutomaticNetworkPoolReference element to specify that organization VDCs created from this template will use the automatically created VXLAN pool associated with the Provider VDC specified in this template. See the request portion of Create a VDC Template That Includes Routed Networking.
  4. POST the VMWVdcTemplate request body to the system's add link for vdcTemplates.

Results

The system creates the new 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 That Includes Routed Networking

This example extends the one in Create a VDC Template to create a VDC template that, when instantiated, adds a VDC that contains an Edge Gateway and a routed organization VDC network to the organization. An organization VDC that is created by instantiating this template has properties similar to the one created in Create an Organization VDC with Pay As You Go Reservation Allocation Model. The Edge Gateway and organization VDC network it contains are similar to the ones created in Create an Edge Gateway and Create an Organization VDC Network With a Routed Connection.

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:vmext="http://www.vmware.com/vcloud/extension/v1.5"
   xmlns="http://www.vmware.com/vcloud/v1.5"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   name="example-vdc-template">
   <Description>Example AllocationVapp VDC Template with Gateway</Description>
   <vmext:TenantName>PayAsYouGo-VDCTemplate</vmext:TenantName>
   <vmext:TenantDescription>PayAsYouGo-VdcTemplate</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>
      <GatewayConfiguration>
         <Gateway name="theEdge">
            <Description>Edge Gateway defined by VDC template</Description>
            <Configuration>
               <GatewayBackingConfig>compact</GatewayBackingConfig>
               <GatewayInterfaces>
                  <GatewayInterface>
                     <Name>uplink1</Name>
                     <DisplayName>Uplink interface defined by VDC template</DisplayName>
                     <Network href="https://vcloud.example.com/api/admin/network/297"/>
                     <InterfaceType>uplink</InterfaceType>
                  </GatewayInterface>
               </GatewayInterfaces>
               <HaEnabled>false</HaEnabled>
               <UseDefaultRouteForDnsRelay>false</UseDefaultRouteForDnsRelay>
            </Configuration>
         </Gateway>
         <Network name="RoutedOVDCNet">
            <Description>Routed through an Edge Gateway</Description>
            <Configuration>
               <IpScopes>
                  <IpScope>
                     <IsInherited>false</IsInherited>
                     <Gateway>192.168.0.1</Gateway>
                     <Netmask>255.255.255.0</Netmask>
                     <IpRanges>
                        <IpRange>
                           <StartAddress>192.168.0.100</StartAddress>
                           <EndAddress>192.168.0.199</EndAddress>
                        </IpRange>
                     </IpRanges>
                  </IpScope>
               </IpScopes>
               <FenceMode>natRouted</FenceMode>
            </Configuration>
            <IsShared>false</IsShared>
         </Network>
      </GatewayConfiguration>
      <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>
      <vmext:NetworkPoolReference
         href="https://vcloud.example.com/api/admin/extension/networkPool/313"/>
      <CpuAllocationMhz>2048</CpuAllocationMhz>
      <CpuLimitMhzPerVcpu>1000</CpuLimitMhzPerVcpu>
      <MemoryAllocationMB>2048</MemoryAllocationMB>
      <CpuGuaranteedPercentage>1</CpuGuaranteedPercentage>
      <MemoryGuaranteedPercentage>1</MemoryGuaranteedPercentage>
   </vmext:VdcTemplateSpecification>
</vmext:VMWVdcTemplate>

The response is similar to the one shown in Create a VDC Template.