An organization VDC network with a routed connection provides controlled access to machines and networks outside of the organization VDC. Virtual Infrastructure Administrators and Network Administrators can configure network address translation (NAT) and firewall settings on the VDC's Edge Gateway to make specific virtual machines in the VDC accessible from an external network.

Verify that you are logged in to the vCloud API endpoint as an Account Administrator.

1

Retrieve a reference to the Edge Gateway in the organization VDC in which you plan to create the routed network.

You can use a query like this one, where href is the value of the href attribute of your organization VDC:

https://vcloud.example.com/api/query?type=edgeGateway&format=records&filter=vdc==href

An organization VDC can contain at most one EdgeGateway. If this organization VDC does not contain an Edge Gateway, you cannot create a routed organization VDC network in it.

2

Create an OrgVdcNetwork element.

a

Specify a value of natRouted in the FenceMode element of the network Configuration.

You can specify additional Configuration parameters, as noted in the schema reference.

b

Specify the href of this VDC's Edge Gateway in the EdgeGateway element.

See the request portion of Example: Create an Organization VDC Network With a Routed Connection.

3

POST the OrgVdcNetwork element to the URL for adding networks to the organization VDC.

See the request portion of Example: Create an Organization VDC Network With a Routed Connection

The server takes the requested action and returns an XML representation of the partially-created object. This representation includes an href attribute, properties specified in the creation request, and an embedded Task element that tracks the creation of the object. When the task completes, the object has been created, and you can use the value of the href attribute with a GET request to retrieve the XML representation of the object.

See the response portion of Example: Create an Organization VDC Network With a Routed Connection.

This example adds a routed network to an organization VDC that contains an Edge Gateway. Because the creation request sets the value of the IsShared element to true, the new network is made available in all VDCs in this organization.

Request:

POST https://vcloud.example.com/api/admin/vdc/44/networks
Content-Type: application/vnd.vmware.vcloud.orgVdcNetwork+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<OrgVdcNetwork
   name="RoutedOVDCNet"
   xmlns="http://www.vmware.com/vcloud/v1.5">
   <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>
            <Dns1>10.147.115.1</Dns1>
            <DnsSuffix>example.com</DnsSuffix>
            <IpRanges>
               <IpRange>
                  <StartAddress>192.168.0.100</StartAddress>
                  <EndAddress>192.168.0.199</EndAddress>
               </IpRange>
            </IpRanges>
         </IpScope>
      </IpScopes>
      <FenceMode>natRouted</FenceMode>
   </Configuration>
   <EdgeGateway
      href="https://vcloud.example.com/api/admin/gateway/2000" />
   <IsShared>true</IsShared>
</OrgVdcNetwork>

Response:

201 Created
Content-Type: application/vnd.vmware.vcloud.orgVdcNetwork+xml
...
<OrgVdcNetwork
   xmlns="http://www.vmware.com/vcloud/v1.5"
   name="RoutedOVDCNet"
   type="application/vnd.vmware.vcloud.orgVdcNetwork+xml"
   href="https://vcloud.example.com/api/admin/network/59" ...>
   <Link
      rel="edit"
      type="application/vnd.vmware.vcloud.orgVdcNetwork+xml"
      href="https://vcloud.example.com/api/admin/network/59" />
   <Link
      rel="remove"
      href="https://vcloud.example.com/api/admin/network/59" />
   <Link
      rel="up"
      type="application/vnd.vmware.admin.vdc+xml"
      href="https://vcloud.example.com/api/admin/vdc/44" />
   <Link
      rel="down"
      type="application/vnd.vmware.vcloud.metadata+xml"
      href="https://vcloud.example.com/api/admin/network/59/metadata" />
   <Link
      rel="down"
      type="application/vnd.vmware.vcloud.allocatedNetworkAddress+xml"
      href="https://vcloud.example.com/api/admin/network/59/allocatedAddresses/" />
   <Description>Routed through an Edge Gateway</Description>
   <Tasks>
      <Task
         status="running"
         ...
         operation="Creating Network RoutedOVDCNet(59)"
         ...
         href="https://vcloud.example.com/api/task/999">
      </Task>
   </Tasks>
   <Configuration>
      ...
      <RetainNetInfoAcrossDeployments>false</RetainNetInfoAcrossDeployments>
   </Configuration>
   <EdgeGateway
      type="application/vnd.vmware.admin.edgeGateway+xml"
      name="theEdge"
      href="https://vcloud.example.com/api/admin/edgeGateway/2000" />
   <IsShared>true</IsShared>
</OrgVdcNetwork>