An organization vDC network with a direct connection provides direct layer 2 connectivity to machines and networks outside of the organization vDC. Machines outside of this organization vDC can connect to machines within the organization vDC directly.

An organization vDC network with a direct connection is configured as a child network of one of the external networks provisioned to the cloud by the system administrator.

Verify that you are logged in to the vCloud API as a system administrator.

Retrieve the list of external networks. For information about how to retrieve this list, see External Networks and Network Pools.

1

Choose the external network to which this organization vDC network will connect.

This external network must be one of the ones listed in the AvailableNetworks element of the Provider vDC that backs the organization vDC in which you are creating the new network. Follow these steps to find a suitable external network.

a

Retrieve the XML representation of the organization vDC in which you are creating the new network.

Use a request like this one:

GET https://vcloud.example.com/api/admin/vdc/44

The ProviderVdcReference element in the response contains a reference to the Provider vDC that backs this organization vDC.

<AdminVdc ...>
   ...
   <ProviderVdcReference
         type="application/vnd.vmware.admin.providervdc+xml"
         name="PvDC-Example"
         href="https://vcloud.example.com/api/admin/extension/providervdc/35"
...
</AdminVdc>
b

Retrieve the the XML representation of the Provider vDC.

Use a request like this one:

GET https://vcloud.example.com/api/admin/extension/providervdc/35

The AvailableNetworks element in the response lists the external networks that are available to that Provider vDC, and to all the organization vDCs that it supports.

<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>
2

Create an OrgVdcNetwork element.

a

Specify the href of the external network you chose in Step 1 in the ParentNetwork element.

The type and name attributes are optional here.

b

Set the FenceMode to bridged.

This creates a direct connection to the parent network.

See the request portion of Example: Create an Organization vDC Network With a Direct Connection.

3

POST the OrgVdcNetwork element you created in Step 2 to the URL for adding networks to the organization vDC.

See the request portion of Example: Create an Organization vDC Network With a Direct 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 Direct Connection.

This example adds a directly-connected network to the organization vDC created in Add a vDC to an Organization. Because the network has a Configuration whose ParentNetwork element specifies an external network to connect to and sets the FenceMode to bridged, it provides a direct connection to the parent network.

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="Internet"
   xmlns="http://www.vmware.com/vcloud/v1.5">
   <Description>Bridged to the public Internet</Description>
   <Configuration>
      <ParentNetwork
         href="https://vcloud.example.com/api/admin/network/297" />
      <FenceMode>bridged</FenceMode>
   </Configuration>
</OrgVdcNetwork>

Response:

201 Created
Content-Type: application/vnd.vmware.vcloud.orgVdcNetwork+xml
...
<OrgVdcNetwork
   xmlns="http://www.vmware.com/vcloud/v1.5"
   name="Internet"
   type="application/vnd.vmware.vcloud.orgVdcNetwork+xml"
   href="https://vcloud.example.com/api/admin/network/54" ...>
   <Link
      rel="edit"
      type="application/vnd.vmware.vcloud.orgVdcNetwork+xml"
      href="https://vcloud.example.com/api/admin/network/54" />
   <Link
      rel="remove"
      href="https://vcloud.example.com/api/admin/network/54" />
   <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/54/metadata" />
   <Link
      rel="down"
      type="application/vnd.vmware.vcloud.allocatedNetworkAddress+xml"
      href="https://vcloud.example.com/api/admin/network/54/allocatedAddresses/" />
   <Description>Bridged to the public Internet</Description>
   <Tasks>
      <Task
         name="task"
         status="running"
         operation="Creating Network Internet(54)"
         ...
      </Task>
   </Tasks>
   <Configuration>
      ...
   </Configuration>
</OrgVdcNetwork>