To create a VLAN-backed network pool, create a VMWNetworkPool element whose type attribute has the value VlanPoolType, and POST the element to your cloud's add link for networkPools.

A VLAN-backed network pool is backed by a range of VLAN IDs.

Prerequisites

Procedure

  1. Choose a vCenter server to provide a switch for the network pool.
  2. Create a VMWNetworkPool element that specifies the properties of the network pool.
    See the request portion of Create a VLAN-Backed Network Pool.
  3. POST the VMWNetworkPool element you created in Step 2 to your cloud's add URL for networkPools.
    See the request portion of Create a VLAN-Backed Network Pool.

Example: Create a VLAN-Backed Network Pool

Use the query service to retrieve a list of DV Switch objects available on vCenter servers registered to this cloud.

https://vcloud.example.com/api/query?type=dvSwitch&format=records

The query response includes the values you'll need for the VimServerRef and MoRef elements. The VimObjectType for a DV Switch is always DV_SWITCH.

Request:
POST https://vcloud.example.com/api/admin/extension/networkPools
Content-Type: application/vnd.vmware.admin.networkPool+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<vmext:VMWNetworkPool
   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"
   xsi:type="vmext:VlanPoolType"
   name="example-Vlan-pool">
   <vcloud:Description>Example VLAN-backed network pool</vcloud:Description>
   <vmext:VlanRange>
      <vmext:Start>1</vmext:Start>
      <vmext:End>4</vmext:End>
   </vmext:VlanRange>
   <vmext:VimSwitchRef>
      <vmext:VimServerRef
         href="https://vcloud.example.com/api/admin/extension/vimServer/9" />
      <vmext:MoRef>dvs-33</vmext:MoRef>
      <vmext:VimObjectType>DV_SWITCH</vmext:VimObjectType>
   </vmext:VimSwitchRef>
</vmext:VMWNetworkPool>

The response includes a Task that tracks the creation of the network pool, and a set of Link elements that you can use to operate on or modify it.

Response:
201 Created
Content-Type: application/vnd.vmware.admin.networkPool+xml
...
<vmext:VMWNetworkPool
   xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5"
   xmlns:vcloud="http://www.vmware.com/vcloud/v1.5"
   xsi:type="vmext:VlanPoolType"
   name="example-Vlan-pool"
   id="urn:vcloud:networkpool:67"
   type="application/vnd.vmware.admin.networkPool+xml"
   href="https://vcloud.example.com/api/admin/extension/networkPool/67" ... >
   <vcloud:Link
      rel="up"
      type="application/vnd.vmware.admin.vmwNetworkPoolReferences+xml"
      href="https://vcloud.example.com/api/admin/extension/networkPoolReferences" />
   <vcloud:Link
      rel="edit"
      type="application/vnd.vmware.admin.networkPool+xml"
      href="https://vcloud.example.com/api/admin/extension/networkPool/67" />
   <vcloud:Link
      rel="remove"
      href="https://vcloud.example.com/api/admin/extension/networkPool/67" />
   <vcloud:Description>Example VLAN-backed network pool</vcloud:Description>
   <vcloud:Tasks>
      <vcloud:Task
         status="running"
         ...
         operation="Creating Network Pool 67"
         ...
      </vcloud:Task>
   </vcloud:Tasks>
   ...
</vmext:VMWNetworkPool>