Bug 1838989

Summary: OVN agents cannot be disabled by CLI
Product: Red Hat OpenStack Reporter: Eduardo Olivares <eolivare>
Component: python-networking-ovnAssignee: Assaf Muller <amuller>
Status: CLOSED DUPLICATE QA Contact: Eran Kuris <ekuris>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 16.1 (Train)CC: apevec, jlibosva, lhh, majopela, scohen
Target Milestone: ---Keywords: FutureFeature
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: 2020-09-18 09:11:21 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 Eduardo Olivares 2020-05-22 09:21:25 UTC
Description of problem:
The following command does not work with any OVN agent:
(overcloud) [stack@undercloud-0 ~]$ openstack network agent set --disable d7d1747f-d027-42b5-914c-d87a3e94df03                                                                                               
BadRequestException: 400: Client Error for url: http://10.46.21.197:9696/v2.0/agents/d7d1747f-d027-42b5-914c-d87a3e94df03, Bad agent request: OVN agent status cannot be updated.

Neutron server.log shows the following:
2020-05-22 08:46:06.132 28 INFO neutron.api.v2.resource [req-cc00637e-34db-4492-9129-786d0931a41d 2c55585c08bf4a76aacfa08f42edab67 9935477692284774acb4f5d020c1e408 - default default] update failed (client error): The server could not comply with the request since it is either malformed or otherwise incorrect.


This example corresponds with an networking-ovn-metadata-agent, but it happens with any OVN agent.



Behavior of ML2/OVS agents is different (and it is correct):
(overcloud) [stack@site-undercloud-0 ~]$ openstack network agent list | grep 8c9f4f2b-f79c-4fb9-817d-b30a60c53f56
| 8c9f4f2b-f79c-4fb9-817d-b30a60c53f56 | DHCP agent         | overcloud-compute1-0.redhat.local    | nova              | :-)   | UP    | neutron-dhcp-agent        |


(overcloud) [stack@site-undercloud-0 ~]$ openstack network agent set --disable 8c9f4f2b-f79c-4fb9-817d-b30a60c53f56
(overcloud) [stack@site-undercloud-0 ~]$ openstack network agent list | grep 8c9f4f2b-f79c-4fb9-817d-b30a60c53f56
| 8c9f4f2b-f79c-4fb9-817d-b30a60c53f56 | DHCP agent         | overcloud-compute1-0.redhat.local    | nova              | :-)   | DOWN  | neutron-dhcp-agent        |









Version-Release number of selected component (if applicable):
RHOS-16.1-RHEL-8-20200520.n.0
python3-networking-ovn-7.1.1-0.20200507153427.fd1c0c3.el8ost.noarch


How reproducible:
100%

Steps to Reproduce:
1. openstack network agent list (check agent status is UP)
2. openstack network agent set --disable <agent-id>
3. openstack network agent list (check agent status is DOWN)

Actual results:
Command 2 is rejected

Expected results:
Command 2 sets agent status to DOWN

Additional info:

Comment 1 Assaf Muller 2020-05-22 13:30:10 UTC
The agent admin API is read only at this time - update/delete weren't implemented. At least in that sense this is an RFE, not a bug. Can you add some context - what is the particular use case for disabling an agent?

Comment 3 Jakub Libosvar 2020-09-18 09:11:21 UTC

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