If the system includes more than one Provider VDC, and at least two of those Provider VDCs use a common set of storage profiles, a VMWVdcTemplate in that system can include multiple ProviderVdcReference elements. Each time this sort of template is instantiated, the system evaluates the current resource commitments of each of the referenced Provider VDCs and chooses the one best able to support a new organization VDC.
- Two or more candidate Provider VDCs that share at least one storage profile. Each of the Provider VDCs must have at least one available external network.
- A reference to a Provider VDC storage profile defined in all candidate Provider VDCs
- A network pool specification.
When you specify multiple Provider VDCs in a template that includes networking, you must also add a Binding element to each ProviderVdcReference. A Binding associates a symbolic name with an external network in the Provider VDC. You use this symbolic name as the value of the href attribute of the Network configured in the template. When the template is instantiated, the system replaces the symbolic name with a reference to the network specified in the Value element of the Binding.
Prerequisites
This operation is restricted to system administrators.
Use a procedure like the one shown in Create a VDC Template or Create a VDC Template That Includes Routed Networking to create a VMWVdcTemplate request body. You can specify multiple Provider VDCs in a VDC template whether or not the template includes routed networking. The procedure shown here adds another Provider VDC to the template shown in Create a VDC Template That Includes Routed Networking.
Procedure
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 With Routed Networking and Multiple Provider VDCs
This request creates a VDC template that is identical to the one shown in Create a VDC Template That Includes Routed Networking, but adds a second ProviderVdcReference and includes Binding elements that provide symbolic references to external networks.
<Network href="urn:vcloud:binding:35c80ae2-36ef-4e2f-a430-ca704db9709f"/>When the template is instantiated, this URN is replaced by the network URL in the Value part of the Binding associated with the ProviderVdcReference that the system selects during instantiation.
This example also uses the AutomaticNetworkPoolReference flag to specify that organization VDCs created by instantiating this template use the VXLAN network pool that was created automatically when the Provider VDC was created. If you decide not to use AutomaticNetworkPoolReference in a VDC template that specifies multiple Provider VDCs, you must specify a network pool that exists in one of the candidate Provider VDCs. All organization VDCs that are created from this template use that pool, regardless of the Provider VDC that is chosen during instantiation.
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-2PVDCs"> <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:Binding> <vmext:Name>urn:vcloud:network:35c80ae2-36ef-4e2f-a430-ca704db9709f</vmext:Name> <vmext:Value href="https://vcloud.example.com/api/admin/network/297"></vmext:Value> </vmext:Binding> </vmext:ProviderVdcReference> <vmext:ProviderVdcReference href="https://vcloud.example.com/api/admin/providervdc/39" name="vCenter02" type="application/vnd.vmware.admin.providervdc+xml"> <vmext:Binding> <vmext:Name>urn:vcloud:network:35c80ae2-36ef-4e2f-a430-ca704db9709f</vmext:Name> <vmext:Value href="https://vcloud.example.com/api/admin/network/99"></vmext:Value> </vmext:Binding> </vmext:ProviderVdcReference> <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="urn:vcloud:binding:35c80ae2-36ef-4e2f-a430-ca704db9709f"/> <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:AutomaticNetworkPoolReference/> <CpuAllocationMhz>2048</CpuAllocationMhz> <CpuLimitMhzPerVcpu>1000</CpuLimitMhzPerVcpu> <MemoryAllocationMB>2048</MemoryAllocationMB> <CpuGuaranteedPercentage>1</CpuGuaranteedPercentage> <MemoryGuaranteedPercentage>1</MemoryGuaranteedPercentage> </vmext:VdcTemplateSpecification> </vmext:VMWVdcTemplate>