IP Pool shows stale addresses still allocated after device has been decommissioned/removed
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
Environment
3.x 4.x
Cause
The IP Pool will not update the allocation if a device or virtual machine is removed via unconventional methods
Resolution
Utilization of the NSX API will be required to remove the orphaned entries via the steps below:
List the available IP pools and their Object IDs:
GET https://<NSX_MANAGER_IP>/api/v1/pools/ip-pools
Identify the object ID of the desired 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", "_revision": 0
List the allocated IP Addresses within the pool, you will utilize the ID from step 2. Take note of the addresses you wish to remove:
GET https://<NSX_MANAGER_IP>/api/v1/pools/ip-pools/########-####-####-####-############/allocations
Utilizing a POST function you will issue the following API Call along with the sample field below within the body os 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>"
}
Once the entry has been removed, it will 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