Stale IP address allocation in IP Pool after device decommission - VMware NSX
search cancel

Stale IP address allocation in IP Pool after device decommission - VMware NSX

book

Article ID: 401696

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • Within NSX-T IP Pools will show the incorrect number of allocated addresses 
  • The incorrectly listed addresses in use are devices that have since been removed
  • This issue can lead to IP Pool exhaustion prematurely
  • The number of endpoints that consume IP address from the IP Pool is the same, but the number of allocated IPs is increasing.

Environment

VMware NSX-T Data Center3.x
VMware NSX 4.x

Cause

The IP Pool will not update the allocation if a device or virtual machine is removed via unconventional methods

Resolution

Use the NSX API to remove the orphaned entries via the steps below:

  1. List the available IP pools and their Object IDs:

    GET https://<NSX_MANAGER_IP>/api/v1/pools/ip-pools

  2. Identify the object ID of the pool and copy it for the next step:

    SAMPLE OUTPUT:

    "check_overlap_with_existing_pools": false,

    "ip_address_type": "IPV4",

    "resource_type": "IpPool",

    "id": "####-####-####-####-####",  <======= Object ID

    "display_name": "<Name of IP Pool>",           <======= Name of IP Pool

    "description": "<User Provided Description>",

    "_system_owned": true,

    "_create_time": 000000000001,

    "_create_user": "system",

    "_last_modified_time": 0000000000002,

    "_last_modified_user": "system",

    "_protection": "NOT_PROTECTED",
  3. List the allocated IP Addresses within the pool, use the ID from step 2. Take note of the addresses that need to be removed:

    GET https://<NSX_MANAGER_IP>/api/v1/pools/ip-pools/########-####-####-####-############/allocations

  4. Using the POST function issue the following API Call along with the sample field below within the body of the POST API call to release the orphaned entry:

    POST https://<NSX_MANAGER_IP>/api/v1/pools/ip-pools/########-####-####-####-############?action=RELEASE

    Body of POST:
    {
     
    "allocation_id": "<IP Address to be Removed>"
     
    }


  5. Once the entry has been removed, it may take up to 5 minutes for NSX to sync and show the updated allocation, run the command from step 3 to confirm the entry is removed

Additional Information

NSX API Guide