You deallocate IP addresses that are currently allocated to an Edge Gateway to free them for allocation to a different Edge Gateway.

When you deallocate IP addresses from an Edge Gateway, you must specify the list of IP addresses. Optionally, you can specify the external network associated with those IP addresses.

Verify that you are logged into the vCloud API endpoint as an Account Administrator or a Network Administrator.

Verify that you can retrieve the id for the Edge Gateway.

Verify that those IP addresses are not currently used in a rule on that Edge Gateway. For steps on how to retrieve the list of IP addresses currently allocated to the Edge Gateway, see Retrieve a List of an Edge Gateway's IP Addresses and Their Usage Status.

1

Retrieve the id for the Edge Gateway.

Use a request like this one:

GET https://vcloud.example.com/api/vchs/query?type=edgeGateway
2

Examine the response to locate the VchsEdgeGatewayRecord element for the Edge Gateway.

3

In the VchsEdgeGatewayRecord element, locate the Link element that contains the URL for managing IP addresses of that Edge Gateway.

This element has a rel attribute value of manageExternalIpAddresses.


<Link
   href="https://vcloud.example.com/api/admin/edgeGateway/2000/action/manageExternalIpAddresses"
   rel="manageExternalIpAddresses"/>
4

Create an ExternalIpAddressActionList element.

Deallocate IP addresses, giving the list of IP addresses and without specifying the external network. This example specifies the deallocation of two IP addresses.


<ExternalIpAddressActionList
   xmlns="http://www.vmware.com/vcloud/networkservice/1.0">
   <Deallocation>
      <ExternalIpAddress>10.133.44.5</ExternalIpAddress>
      <ExternalIpAddress>10.133.55.4</ExternalIpAddress>
   </Deallocation>
</ExternalIpAddressActionList>

Deallocate IP addresses from a specified external network.


<ExternalIpAddressActionList
   xmlns="http://www.vmware.com/vcloud/networkservice/1.0">
   <Deallocation>
      <ExternalNetworkName>externlnet</ExternalNetworkName>
      <ExternalNetworkRef>https://vcloud.example.com/api/admin/.../network/1213</ExternalNetworkRef>
      <ExternalIpAddress>10.133.44.5</ExternalIpAddress>
      <ExternalIpAddress>10.133.55.4</ExternalIpAddress>
   </Deallocation>
</ExternalIpAddressActionList>
5

Make a PUT request to the URL in the value of the href attribute of the manageExternalIpAddresses link described in Step 3.

Supply the ExternalIpAddressActionList element as the request body.

This example deallocates two IP addresses without specifying the external network.


PUT https://vcloud.example.com/api/admin/edgeGateway/2000/action/manageExternalIpAddresses
Content-Type: application/vnd.vmware.vchs.edgeGatewayIpAllocation.list+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<ExternalIpAddressActionList
   xmlns="http://www.vmware.com/vcloud/networkservice/1.0">
   <Deallocation>
      <ExternalIpAddress>10.133.44.5</ExternalIpAddress>
      <ExternalIpAddress>10.133.55.4</ExternalIpAddress>
   </Deallocation>
</ExternalIpAddressActionList>

This example deallocates two IP addresses from the specified external network.


PUT https://vcloud.example.com/api/admin/edgeGateway/2000/action/manageExternalIpAddresses
Content-Type: application/vnd.vmware.vchs.edgeGatewayIpAllocation.list+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<ExternalIpAddressActionList
   xmlns="http://www.vmware.com/vcloud/networkservice/1.0">
   <Deallocation>
      <ExternalNetworkName>externlnet</ExternalNetworkName>
      <ExternalNetworkRef>https://vcloud.example.com/api/admin/.../network/1213</ExternalNetworkRef>
      <ExternalIpAddress>10.133.44.5</ExternalIpAddress>
      <ExternalIpAddress>10.133.55.4</ExternalIpAddress>
   </Deallocation>
</ExternalIpAddressActionList>

The server takes the requested action and returns a Task element that tracks the progress of the request.

When the task completes successfully, the IP addresses are deallocated from the Edge Gateway.

If the action fails, the server returns an ErrorType element. The action can fail If the specified IP addresses are in use, or an Edge Gateway with the specified id does not exist.