Description of problem: RHOSP16.2 The command "openstack baremetal node remove <node>" was run instead of "openstack overcloud node delete --stack overcloud <node>" and now are unable to delete the network agent associated with it. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. delete a node with "openstack baremetal node remove <node>" 2. try to delete the network agent of that node Actual results: Failed to delete network agent with ID '0a4bd346-56d5-4793-b1f7-ce98f3dd4318': BadRequestException: 400: Client Error for url: http://10.27.1.200:9696/v2.0/agents/0a4bd346-56d5-4793-b1f7-ce98f3dd4318, Bad agent request: OVN agents cannot be deleted. 1 of 1 network agents failed to delete. Expected results: Be able to delete the network agent even if it is not the right procedure Additional info:
I don't believe deleting OVN network agents is required in train. In fact, I'm not sure if there is even a code path for it since it was added in Ussuri: https://github.com/openstack/neutron/commit/da3ce7319866e8dc874d405e91f9af160e2c3d31 In your case, the ovn-controller is still running on the node which we can see in the agent list as it appears as UP. If you just shutdown the node so that ovn-controller is no longer running, I believe it should clean the agent list up itself.
Actually, looks like it's more complex than that. There were some issues that were addressed on this BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1849166#c32 So, the agent won't disappear on its own. But it looks like the ovn-controller does indeed need to be stopped before it can be removed. For reference: https://access.redhat.com/solutions/5393161
*** This bug has been marked as a duplicate of bug 1849166 ***