Avi LB - Remove Orphaned Pools and Policysets

Share on:

In my home lab I am continuosly tearing stuff up and down which might leave resources in an orphaned state. The other day after removing Workload Management in vSphere which I had enabled with the NSX Advanced Loadbalancer (a.k.a Avi) I noticed that the Virtual Services was left in the Load Balancer.

Previously these have been removed as well when disabling Workload Management, but this time my Supervisor Cluster was in an unhealty state before disabling so I suspect this messed up the removal of the Avi services.

While I could delete the Virtual Services, the LB Pools where left even though I selected to remove related resources when deleting the services.

Orphaned pools

When trying to remove those I got the following error

Removal error

The L4Policysets are not found in the UI (at least I couldn't locate it), and the Avi documentation instructs to use the CLI (or API) for interacting with them

So, let's head over to the Avi shell to see if we can find our L4 Policy sets with the show l4policyset command

L4 Policy sets

We find three policysets. Note that this might not correspond with the number of Pools, a Pool can use multiple Policy Sets.

We can also examine a Policy set with the show l4policyset <policy-name> command. Use TAB for navigating the commands and available resources

Policy set detail

To delete a Policy set we use the delete l4policyset <policy-name> command

Delete Policy set

Now we can head over to the Avi UI and delete our pool

Delete Pool from UI

And the Pool should be deleted

Pool deleted

Now let's delete the remaining L4Policysets, and since we're already in the shell we can also delete the pools from there

Delete remaining Policy sets and Pools


This post showed how we can clean up orphaned L4 policy sets and LB Pools after removing Workload Management from vSphere.

This page was modified on September 18, 2021: Publish Avi l4policyset post