Unable to delete IP block due to allocated subnets
search cancel

Unable to delete IP block due to allocated subnets

book

Article ID: 428375

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • You are unable to remove an IP block in the NSX Manager UI and with API:
    DELETE https://<nsx-manager-fqdn>/api/v1/infra/ip-blocks/<IP block name>
  • The IP block is a manager object
  • The following error message is displayed:
    IP block cannot be deleted as it has allocated subnets.

Environment

VMware NSX

Cause

This error is shown because the IP block has subnets allocated from it. The system prevents the deletion of an IP block that contains active subnets.
NSX prevents the deletion of the parent IP block object while these child subnet objects exist.

Resolution

To resolve this issue, you must delete the allocated subnets using the NSX API before deleting the IP block.

  1. Identify the subnet-id for the subnets allocated from the affected IP block in the UI
    In Manager view: Networking > IP Address Pools > IP Blocks > Subnets
  2. Use a REST API client (such as Postman or curl) to delete the subnets individually using the following method:
  3. DELETE https://<nsx-mgr>/api/v1/pools/ip-subnets/{subnet-id}
    Note: Replace <nsx-mgr> with your NSX Manager IP or FQDN and {subnet-id} with the actual ID of the subnet.
  4. Repeat this step for all allocated subnets associated with the block.
  5. Log in to the NSX Manager UI.
  6. Navigate to the IP block and delete it.

Additional Information

NSX-T Data Center REST API - 4.2.3
NSX-T API usage
Troubleshooting NSX API Calls