Bug 2168403

Summary: [RHOSP 16.2] Ran baremetal node delete instead of overcloud delete
Product: Red Hat OpenStack Reporter: camorris@redhat.co <camorris>
Component: python-tripleoclientAssignee: OSP Team <rhos-maint>
Status: CLOSED DUPLICATE QA Contact: David Rosenfeld <drosenfe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16.2 (Train)CC: bshephar, cmuresan, hbrock, hjensas, jslagle, mburns, sbaker
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-02-12 23:55:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description camorris@redhat.co 2023-02-08 22:16:43 UTC
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:

Comment 5 Brendan Shephard 2023-02-12 23:38:48 UTC
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.

Comment 6 Brendan Shephard 2023-02-12 23:53:47 UTC
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

Comment 7 Brendan Shephard 2023-02-12 23:55:13 UTC

*** This bug has been marked as a duplicate of bug 1849166 ***