netplugin
netplugin copied to clipboard
"Policy is being used" despite not being used by an EndpointGroup
Ran into an issue while trying to add a policy to one of my EPGs, where it said the policy didn't exist. To try and fix the issue, I went through manually deleting the EPGs, ANPs, and then the Policies. But even though I had deleted the other objects, I still can't delete the rogue Policy.
ERRO[0000] Policy is being used [github.com/contiv/netplugin/netmaster/objApi.(*APIController).PolicyDelete apiController.go 1396]


Any ideas on how to cleanup and avoid the issue?
can you try
netctl policy inspect <policy-name>
And check EndpointGroups associated ?
[root@netmaster ~]# netctl policy inspect testapp1-exp-policy Inspecting policy: testapp1-exp-policy tenant: default ERRO[0000] Key not found [github.com/contiv/netplugin/state.(*EtcdStateDriver).Read etcdstatedriver.go 121]
Looks like etcd is out of sync with the environment.
check network netctl net inspect <network>
and see if there are any endpoint groups (epg) associated.
check contiv etcd cluster health etcdctl -C http://localhost:6666 cluster-health
dump keys to check epg, etcdctl -C http://localhost:6666 ls --recursive