Procedure to safely delete unused security groups in NSX to optimize datapath IP counts or clean up obsolete configurations.
Deletion attempts may fail if the target security group is still actively referenced by other platform components, violating relational integrity constraints.
Important Checks Before Deleting:
If the UI or API returns a failure, you must locate and remove the group from the following configurations before retrying:
Distributed Firewall (DFW) Rules or Policies
Gateway Firewall Rules
Nested parent Security Groups
Endpoint Protection or Service Insertion Rules.
To identify active dependencies, click the hyperlinked number under the References column in the NSX Manager UI to trace the exact policies preventing deletion.
VMware NSX
Delete Unused Security Groups via NSX Manager UI
Log in to the NSX Manager user interface with administrative privileges.
Navigate to Inventory > Groups.
Locate the unused group you intend to delete. Use the search or filter functions to isolate the specific object.
Verify the References column for the group. The reference count must be 0 before deletion is permitted.
Note: To identify active dependencies, click the hyperlinked number under the References column to trace the exact policies preventing deletion. You must remove the group from these configurations before retrying.
Click the vertical ellipsis (three dots) next to the target group and select Delete.
Confirm the action in the prompt by clicking Delete.
Delete Unused Security Groups via Policy API For environments requiring programmatic deletion or bulk removal, utilize the NSX Policy API:
Identify the target group-id.
Execute the following DELETE payload against the NSX Manager: DELETE https://<REDACTED_IPS>/policy/api/v1/infra/domains/default/groups/<group-id>