Bug 1526755 - DVR: a test which adds a router to L3 agent fails with a conflict
Summary: DVR: a test which adds a router to L3 agent fails with a conflict
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tempest
Version: 10.0 (Newton)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 10.0 (Newton)
Assignee: Slawek Kaplonski
QA Contact: Toni Freger
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-17 09:33 UTC by Arie Bregman
Modified: 2019-04-30 16:59 UTC (History)
11 users (show)

Fixed In Version: openstack-tempest-13.0.0-22.bafe630git.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-04-30 16:59:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1817696 0 None None None 2019-02-26 11:40:59 UTC
OpenStack gerrit 639316 0 None None None 2019-02-26 11:53:15 UTC
Red Hat Product Errata RHBA-2019:0922 0 None None None 2019-04-30 16:59:48 UTC

Description Arie Bregman 2017-12-17 09:33:07 UTC
Description of problem:

The following test fails in OSP 10 DVR environment:

neutron.tests.tempest.api.admin.test_l3_agent_scheduler.L3AgentSchedulerTestJSON.test_add_list_remove_router_on_l3_agent


Version-Release number of selected component (if applicable): Latest OSP 10


How reproducible: 100%


Steps to Reproduce:
1. Deploy OSP 10 with DVR
2. Run neutron test: neutron.tests.tempest.api.admin.test_l3_agent_scheduler.L3AgentSchedulerTestJSON.test_add_list_remove_router_on_l3_agent

Actual results:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/neutron/tests/tempest/api/admin/test_l3_agent_scheduler.py", line 91, in test_add_list_remove_router_on_l3_agent
    self.router['id'])
  File "/usr/lib/python2.7/site-packages/neutron/tests/tempest/services/network/json/network_client.py", line 470, in add_router_to_l3_agent
    resp, body = self.post(uri, body)
  File "/home/stack/tempest-dir/tempest/lib/common/rest_client.py", line 276, in post
    return self.request('POST', url, extra_headers, headers, body, chunked)
  File "/home/stack/tempest-dir/tempest/lib/common/rest_client.py", line 664, in request
    self._error_checker(resp, resp_body)
  File "/home/stack/tempest-dir/tempest/lib/common/rest_client.py", line 776, in _error_checker
    raise exceptions.Conflict(resp_body, resp=resp)
tempest.lib.exceptions.Conflict: An object with that identifier already exists
Details: {u'message': u'The router 2a61126e-5548-4984-a71b-5a63d61d4709 has been already hosted by the L3 Agent 4b036b53-3039-472d-8e05-f24dc22a9f23.', u'type': u'RouterHostedByL3Agent', u'detail': u''}


Expected results: Test passed successfully

Comment 3 Brian Haley 2017-12-18 17:32:00 UTC
Jenkins is unstable, need to wait for further triaging.

Comment 5 Brian Haley 2018-01-05 14:16:16 UTC
Downstream jenkins was unstable from what I remember right before the shutdown, with failures unrelated to neutron.  I will look at this again now.

Comment 8 Slawek Kaplonski 2019-02-26 10:40:32 UTC
So there is bug in tempest test in https://github.com/openstack/tempest/blob/master/tempest/api/network/admin/test_l3_agent_scheduler.py#L68
In case when router is not HA router it should be scheduled only to one L3 agent at a time. Sometimes in multimode environment it may happen that router is scheduled automatically to eg. agent 1 but test tries to add it to agent 2. That will fail with conflict, which is raised in neutron: https://github.com/openstack/neutron/blob/f6c6be78eeab6a4f621d3ecf95875c539cf4f0b2/neutron/db/l3_agentschedulers_db.py#L134
In case when router is HA, then there is no this problem as router can be then scheduled to more than one L3 agent.
It don't happens in our OSP-13 and OSP-14 CI because we have there configured l3_ha=True in neutron config. So every router is HA by default. In OSP-10 we have this option configured to false so that's why it is failing sometimes.
I think that this should be fixed on tempest side and we should always create ha router there - that will avoid similar issues regardless of neutron config.

Comment 12 errata-xmlrpc 2019-04-30 16:59:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:0922


Note You need to log in before you can comment on or make changes to this bug.