Commit Graph

160 Commits

Author SHA1 Message Date
Rodolfo Alonso Hernandez fa3223bb9d [OVN] Remove OVN_GATEWAY_INVALID_CHASSIS artifact
This artifact is no longer used in the "Logical_Router" registers (in
the "options" field) to mark this "Logical_Router" as unhosted. A
"Logical_Router" is considered as unhosted if the gateway
"Logical_Router_Ports" have no "chassis" set.

This artifact is also used to create a "Gateway_Chassis" register
pointing to a inexisting invalid chassis called
"neutron-ovn-invalid-chassis". Any "Logical_Router_Port" not bound
to a chassis will have no value in "gateway_chassis" (NOTE1).

NOTE1: this is valid now with the current two OVN L3 schedulers that
use "gateway_chassis" to schedule the "Logical_Router_Port" of a
router. In a future, we can consider using "ha_chassis_group" for
scheduling.

Partial-Bug: #2052821
Related-Bug: #2019217
Change-Id: I12717936fe2bc188545309bacb8a260981f14c88
2024-03-01 07:03:26 +00:00
Frode Nordahl 8df5ee61d9
[ovn] Apply soft anti-affinity for LRs with multiple LRPs when scheduling
Move scheduling logic from OVNClient._create_lrouter_port to an
ovsdbapp command so that scheduling decisions are made on up to
date information as the transaction applies.

One of the main use cases for routers with multiple gateway
ports are resiliency.  Whenever there are multiple LRPs present in
a LR, we want to ensure diverse placement of the ports to
minimize impact of chassis failure.

Partial-Bug: #2002687
Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
Change-Id: I36860b739a8cb99ba0e7fc65950ea252ad6803c4
2024-02-27 11:06:08 +01:00
Yann Morice a29ea3724e [ovn] AZs distribution in L3 port scheduler
Update l3 ovn schedulers (chance, leastloaded) to ensure that LRP gateways are distributed over chassis in the different eligible AZs.

Previous version already ensure that LRP gateways were scheduled over chassis in eligible AZs. But, depending on the deployment characteristics, all these chassis could be in the same AZ. In some use-cases, it could be needed to have LRP gateways in different AZs to be resilient on failures.

This patch re-order the list of eligible chassis to add a priority on selecting chassis in different AZs.

This should provide a solution for users who need to have their router gateways scheduled on chassis from different AZs.

Closes-Bug: #2030741
Change-Id: I72973abbb8b0f9cc5848fd3b4f6463c38c6595f8
2024-01-26 15:22:34 +01:00
Felix Huettner b5f5f3def3 ovn-l3 scheduler: calculate load of chassis per priority
previously we calculated the "load" of a chassis across the highest
priority of each of the chassis. This can lead to suboptimal results in
the following situation:
* you have gateway chassis: hv1, hv2, hv3
* you have routers:
   * g1: with priority 3 on hv1, priority 2 on hv2, priority 1 on hv3
   * g2: with priority 3 on hv1, priority 2 on hv2, priority 1 on hv3
   * g3: with priority 3 on hv3, priority 2 on hv2, priority 1 on hv1
   * g4: with priority 3 on hv3, priority 2 on hv2, priority 1 on hv1

When now creating a new router the previous algorythm would have placed
prio 3 of it either on hv1 or hv3 since their count of highest
priorities (2 of prio 3) is lower than the count of the higest priority
of hv2 (4 of prio 2). So it might have looked like:
* g5: with priority 3 on hv3, priority 2 on hv1, priority 1 on hv3
(This case has been implemented as `test_least_loaded_chassis_per_priority2`).

However this is actually a undesired result. In OVN the gateway chassis
with the highest priority actually hosts the router and processes all of
its external traffic. This means it is highly important that the highest
priority is well balanced.

To do this now we no longer blindly use the count of routers of the
highest priority per chassis, but we only count the routers of the
priority we are currently searching a chassis for. This ensures that in
the above case we would have picked hv2 for priority 3, since it has not
actually active router running.

The algorithm implemented now is based upon the assumption, that amount
of priorities scheduled per router is equal over all routers. This means
it will perform suboptimally if some phyiscal network is available on 5
gateway chassis, while another one is only available on 2. (It is
however unclear if the previous implementation would have been better
there).

In this commit we also adopt the testcases in test_l3_ovn_scheduler to match
to this assumption. Previously the distribution data used for testing
had been unrelasitic as it mostly scheduled one gateway chassis for each
router.

It also fixes the previously broken priority calculation in the
testcase, that would just assign prio 0 to all gateways.

Partial-Bug: #2023993
Change-Id: If2afcd546a1da9964704bcebbfa39d8348e14fe8
2024-01-17 12:04:09 +01:00
Rodolfo Alonso Hernandez 413044f253 [OVN] The L3 scheduler does not use all chassis by default
Any OVN scheduler, inheriting from ``OVNGatewayScheduler``, calls
``_schedule_gateway`` to make the decision of in what chassis the
router gatweway should be located. Before this patch, if the list
of candidates was empty, the scheduler used all available chassis
as candidate list. This patch is removing this default behaviour.
In a deployment, only those chassis marked explicitly with
"ovn-cms-options=enable-chassis-as-gw" can be used as gateway
chassis.

After enabling this patch, any existing router gateway port will
preserve the assigned chassis; any new router gateway will be
scheduled only on the chassis configured as gateways.

If a router gateway port cannot find any chassis to be scheduled,
the "neutron-ovn-invalid-chassis" will be used instead and a
warning message will be printed in the logs.

Closes-Bug: #2019217
Change-Id: If0f843463edfd7edc5c897cc098de31444f9d81b
2023-05-25 15:26:31 +02:00
ushen d4654e3011 Filter out unsatisfied routers in SQL
We saw auto_schedule_routers took over 40 seconds
for a DVR enabled environment with option
auto_schedule_routers enabled.

Adding new arguments to get_router_agents_count and
dealing with routers separately depending on whether
it is a regular router or HA. The benefits are
we do not need to loop over every router available in
environment. Another reason for doing this is that
get_router_agents_count is used solely to heal
routers with less than required agents so number of
routers with less agents is small for most of the times.

Related-Bug: #1973656

Change-Id: Ic29275815a8c32cee7a6470509687a18fa594514
2023-03-29 21:25:10 +08:00
Zuul aface4c9bc Merge "Improve scheduling L3/DHCP agents, missing lower binding indexes" 2023-02-16 22:14:15 +00:00
Rodolfo Alonso Hernandez 5250598c80 Improve scheduling L3/DHCP agents, missing lower binding indexes
This patch is covering an edge case that could happen when the number
of DHCP agents ("dhcp_agents_per_network") or L3 agents
("max_l3_agents_per_router") has been reduced and there are more agents
assigned than the current number. If the user removes any agent
assignation from a L3 router or a DHCP agent, it is possible to remove
first the lower binding assigned registers.

Now the method ``get_vacant_binding_index`` calculates the number of
agents bound and the number required. If a new one is needed, the
method returns first the lower binding indexes not used.

Closes-Bug: #2006496
Change-Id: I25145c088ffdca47acfcb7add02b1a4a615e4612
2023-02-08 13:14:19 +01:00
Rodolfo Alonso Hernandez 8f7cc690a9 Remove ``L3Scheduler._bind_routers`` method
This method is not used in the Neutron repository nor other project:
https://codesearch.openstack.org/?q=_bind_routers&i=nope&literal=nope&files=&excludeFiles=&repos=

Trivial-Fix

Change-Id: Ieb4f6ce6d4adacd6bb5af4cc0303899dad27676b
2023-02-08 12:03:04 +01:00
Brian Haley f77c7c9584 Fix some pylint indentation warnings
Running with a stricter .pylintrc generates a lot of
C0330 warnings (hanging/continued indentation). Fix
the ones in neutron/scheduler.

Trivialfix

Change-Id: Ic131cd49307471982b8bd09f823809261d246c0d
2022-11-02 10:26:11 -04:00
Dr. Jens Harbott 7c3d6c414d Fix return value in BaseScheduler class
The return value of BaseScheduler.schedule() is expected to be iterable,
fix this for the special case that no resource_filter is defined.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I98bf7a752506deb3343fca64c2e5d2427c4136f9
2022-08-02 08:53:30 +02:00
zhouhenglc b5253b224b [OVN] Reschedule router GW chassis when AZ updated
when chassis's available zone updated, triger rescheduler router
gateway chassis.

Closes-bug: #1958225

Change-Id: If7cf55f2c12b388fc34fa942b6b0bf70cb9eb866
2022-03-14 00:33:23 +00:00
Rodolfo Alonso Hernandez 668b1cc652 Do not fail if the agent load is not bumped
When a new network and its first subnet is created, the DHCP agent
bumps the "load" parameter to reflect the number of networks handled.
This "load" parameter is modified when:
- As commented, when the first subnet of a network is created. The
  "load" value is bumped.
- When periodically the DHCP agent sends the status, informing about
  the current number of networks handled.

If during the subnet creation this "load" value is not updated, it will
be in the next periodic update of the agent.

This "load" value is used by the scheduler to equally distribute the
objects to be managed by any agent type (DHCP agents manage networks).

The bug refers to DHCP but is valid for any other agent.

Change-Id: Ief402048d99d40b64d81fcf58eb2e39b1ba7ebbb
Closes-Bug: #1939432
2021-08-25 13:06:28 +00:00
zhouhenglc 7988ab5df0 "default_availability_zones" need to be considered when validate az
If not set availability_zone_hits when create router, should use
configuration parameter default_availability_zones.
At present, only the creation parameters are validate, and the default
availability zones not validate.
Creating a network is the same as creating a route.

Closes-bug: #1938261

Change-Id: I1c7f50b69a31d725b762e3061f09a0bd5b077a58
2021-08-16 00:14:49 +00:00
Slawek Kaplonski d7371e13e4 Revert "Set system_scope='all' in elevated context"
This reverts commit 062336e59b.

Now, we have proper fix for the system_scope='all' in elevated context
in the neutron-lib so we can revert temporary fix made at the end of the
Wallaby cycle.

Related-Bug: #1920001

Conflicts:
    neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py
    neutron/common/utils.py
    neutron/db/address_group_db.py
    neutron/services/segments/db.py

Change-Id: Ife9b647b403bdd76a8a99984ea8858bf95c96bc3
2021-06-15 10:29:20 +02:00
Slawek Kaplonski 062336e59b Set system_scope='all' in elevated context
In case when enforce_new_defaults is set to True and new policy rules
are used, context.is_admin flag isn't really working as it was with old
rules.
But in case when elevated context is needed, it means that we need
context which has full rights to the system. So we should also set
"system_scope" parameter to "all" to be sure that system scope queries
can be done with such elevated context always.

It is needed e.g. when elevated context is used to get some data from
db. In such case we need to have db query which will not be scoped to
the single project_id and with new defaults to achieve that system_scope
has to be set to "all".

Proper fix for that should be done in neutron-lib and it is proposed
in [1] already but as we are have frozen neutron-lib version for
stable/wallaby already this patch for neutron is temporary fix for that
issue.
We can revert that patch as soon as we will be in Xena development cycle
and [1] will be merged and released.

[1] https://review.opendev.org/c/openstack/neutron-lib/+/781625

Related-Bug: #1920001
Change-Id: I0068c1de09f5c6fae5bb5cd0d6f26f451e701939
2021-03-19 12:05:56 +01:00
Slawek Kaplonski bf35cf65c8 Finish the new DB engine facade migration
This patch implements the last code bits pending to
conclude the new DB engine facade migration.

Due to the resultant interactions in the modified code, is
not possible to submit smaller patches; this code must be
migrated at once.

Partially-Implements blueprint: enginefacade-switch

Signed-off-by: Slawek Kaplonski <skaplons@redhat.com>
Co-Authored-By: Rodolfo Alonso Hernandez <ralonsoh@redhat.com>

Change-Id: Id3f09b78c8d0a8daa7ec4fa6f5bf79f7d5ab8f8b
2020-11-24 09:20:35 +00:00
Rodolfo Alonso Hernandez 2bb514f2d7 L3 agent scheduler should return a valid index if manual scheduling
When retrieving a vacant L3 agent binding index, if
"is_manual_scheduling" is set, the method "get_vacant_binding_index"
should always return a valid binding index. If the existing binding
indexes are sequentially aligned, the method will return a new one
on top; if there is a gap in the binding indexes list, the first
free index will be returned.

Closes-Bug: #1884906

Change-Id: I0a89bca0734d3e735fb357e488f85589e81d709f
2020-06-24 15:37:23 +00:00
Rodolfo Alonso Hernandez ed56429548 DhcpFilter should always return a valid index if "force_scheduling"
WHen retrieving a vacant DHCP agent binding index, if
"force_scheduling" is set, the method should return a valid binding
index. If the existing binding indexes are sequentially aligned,
the method will return a new one on top; if there is a gap in the
binding indexes list, the first free index will be returned.

Change-Id: Ib4cbeb7c9f0c1e959ad53570320610925ff3d88f
Closes-Bug: #1883513
2020-06-23 13:38:25 +00:00
Brian Haley 08a60f7483 Remove usage of six.add_metaclass
With python 3.x, classes can use the metaclass= logic
to not require usage of the six library.

One step in removing all of six usage from neutron.

Change-Id: I2f815e412d9a96eb5faf2b3bb3a1e393a9db9309
2020-05-21 14:41:18 -04:00
Maciej Józefczyk be1bdd4342 [OVN] Import OVN Client, L3 and QoS related code
This patch moves the OVN Client, L3 and QoS related code:
Previous paths in networking-ovn tree:
./networking_ovn/ml2/qos_driver.py -> neutron/services/qos/drivers/ovn/qos_driver.py
./networking_ovn/common/ovn_client.py -> neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py
./networking_ovn/l3/l3_ovn_scheduler.py -> neutron/scheduler/l3_ovn_scheduler.py
./networking_ovn/l3/l3_ovn.py -> neutron/services/ovn_l3/plugin.py

Co-Authored-By: Amitabha Biswas <abiswas@us.ibm.com>
Co-Authored-By: Andrew Austin <aaustin@redhat.com>
Co-Authored-By: Anh Tran <anhtt@vn.fujitsu.com>
Co-Authored-By: Armando Migliaccio <armamig@gmail.com>
Co-Authored-By: Arslan Qadeer <arslanq@xgrid.co>
Co-Authored-By: Boden R <bodenvmw@gmail.com>
Co-Authored-By: Brian Haley <bhaley@redhat.com>
Co-Authored-By: Cao Xuan Hoang <hoangcx@vn.fujitsu.com>
Co-Authored-By: Chandra S Vejendla <csvejend@us.ibm.com>
Co-Authored-By: Changxun Zhou <zhoucx@dtdream.com>
Co-Authored-By: Daniel Alvarez <dalvarez@redhat.com>
Co-Authored-By: Dong Jun <dongj@dtdream.com>
Co-Authored-By: Doug Hellmann <doug@doughellmann.com>
Co-Authored-By: Gary Kotton <gkotton@vmware.com>
Co-Authored-By: Guoshuai Li <ligs@dtdream.com>
Co-Authored-By: Han Zhou <zhouhan@gmail.com>
Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
Co-Authored-By: Jakub Libosvar <libosvar@redhat.com>
Co-Authored-By: John Kasperski <jckasper@us.ibm.com>
Co-Authored-By: Kamil Sambor <ksambor@redhat.com>
Co-Authored-By: Kevin Benton <kevin@benton.pub>
Co-Authored-By: Kyle Mestery <mestery@mestery.com>
Co-Authored-By: LIU Yulong <liuyulong@le.com>
Co-Authored-By: Lucas Alvares Gomes <lucasagomes@gmail.com>
Co-Authored-By: Maciej Józefczyk <mjozefcz@redhat.com>
Co-Authored-By: Miguel Angel Ajo <majopela@redhat.com>
Co-Authored-By: Na <nazhu@cn.ibm.com>
Co-Authored-By: Numan Siddique <nusiddiq@redhat.com>
Co-Authored-By: Richard Theis <rtheis@us.ibm.com>
Co-Authored-By: Russell Bryant <rbryant@redhat.com>
Co-Authored-By: Sławek Kapłoński <slawek@kaplonski.pl>
Co-Authored-By: Terry Wilson <twilson@redhat.com>
Co-Authored-By: Yunxiang Tao <taoyunxiang@cmss.chinamobile.com>
Co-Authored-By: lzklibj <lzklibj@cn.ibm.com>
Co-Authored-By: melissaml <ma.lei@99cloud.net>
Co-Authored-By: reedip <rbanerje@redhat.com>
Co-Authored-By: venkata anil <anilvenkata@redhat.com>
Co-Authored-By: xurong00037997 <xu.rong@zte.com.cn>
Co-Authored-By: zhufl <zhu.fanglei@zte.com.cn>

Change-Id: I52bc2785d815b3f04efbda3b78a28861ca9e8fe1
Related-Blueprint: neutron-ovn-merge
2019-12-14 19:17:40 +00:00
Lujin 69b3762dda Add binding_index to NetworkDhcpAgentBinding
The patch proposes adding a new binding_index to the
NetworkDhcpAgentBinding table, with an additional Unique
Constraint that enforces a single <network_id, binding_index>
per network.

1. When a network is triggered to be auto-scheduled to DHCP
agents, the number of DHCP agents is constrained by
dhcp_agents_per_network in neutron.conf. This prevents
too many DHCP agents from being scheduled in the first place.

2. If users manually schedule a network to specific DHCP
agents, the binding_index increments to show the number of
DHCP agents hosting this network.

Co-Authored-By: Oleg Bondarev <obondarev@mirantis.com>
Change-Id: I1bc3f8b69c337f7c1cf7375509a0da61def9baf1
Closes-Bug: #1535554
2019-08-29 12:52:07 +04:00
Brian Haley b79842f289 Start enforcing E125 flake8 directive
Removed E125 (continuation line does not distinguish itself
from next logical line) from the ignore list and fixed all
the indentation issues.  Didn't think it was going to be
close to 100 files when I started.

Change-Id: I0a6f5efec4b7d8d3632dd9dbb43e0ab58af9dff3
2019-07-19 23:39:41 -04:00
Rodolfo Alonso Hernandez 93d75d89a0 Switch to new engine facade for BaseResourceFilter
Partially-Implements blueprint: enginefacade-switch

Change-Id: I1785ee36ef2a74c8673d6834ac4227a67c55daa3
2019-06-22 15:24:43 +00:00
Rodolfo Alonso Hernandez b71cd851dc Switch to new engine facade for Schedulers
* DhcpAgentSchedulerDbMixin
* L3AgentSchedulerDbMixin
* AutoScheduler
* DhcpFilter
* L3Scheduler

Partially-Implements blueprint: enginefacade-switch

Change-Id: I26a0e651a5c9d30004e2e5a7cfc6b866415cc87b
2019-06-12 19:46:25 +00:00
Rodolfo Alonso Hernandez d01a1deca9 Add log information in agent schedulers
Added log information about the hostable DHCP agents per network.
Added log information when an agent is declared "down" because the
heartbeat is too old.

Those log messages are included according to [1].

[1] https://bugs.launchpad.net/neutron/+bug/1799555/comments/8

Change-Id: I7b30499a86e5ae5de49813dfca01788fd5fce139
Related-Bug: #1799555
2019-06-07 17:08:38 +00:00
Rodolfo Alonso Hernandez b3404d900e Add debug information to AutoScheduler and BaseScheduler
These new debug lines can be helpful to resolve the mentioned bug.
Sometimes the DHCP agent does not reschedule and the log does not
contain enough information to debug the problem.

Spotted error during fullstack tests:
Traceback (most recent call last):
File "/opt/stack/new/neutron/neutron/tests/base.py", line 151, in func
  return f(self, *args, **kwargs)
File "/opt/stack/new/neutron/neutron/tests/fullstack/test_dhcp_agent.py",
  line 168, in test_reschedule_network_on_new_agent
  self._wait_until_network_rescheduled(network_dhcp_agents[0])'
File "/opt/stack/new/neutron/neutron/tests/fullstack/test_dhcp_agent.py",
  line 137, in _wait_until_network_rescheduled
  common_utils.wait_until_true(_agent_rescheduled)
File "/opt/stack/new/neutron/neutron/common/utils.py", line 646,
  in wait_until_true
  raise WaitTimeout(_("Timed out after %d seconds") % timeout)
  neutron.common.utils.WaitTimeout: Timed out after 60 seconds

Change-Id: I794e737c30f597519fba873e36f26b82b6f2c799
Related-Bug: #1799555
2019-05-30 09:58:11 +00:00
Brian Haley eaf990b2bc Fix pep8 E128 warnings in non-test code
Reduces E128 warnings by ~260 to just ~900,
no way we're getting rid of all of them at once (or ever).
Files under neutron/tests still have a ton of E128 warnings.

Change-Id: I9137150ccf129bf443e33428267cd4bc9c323b54
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
2019-03-12 21:22:33 +00:00
venkata anil 72ef0e7814 Fetch specific columns rather than full ORM entities
Michael Bayer while analysing neutron process function call trace,
suggested to run queries against specific columns rather than full
ORM entities as it can help reduce load both at the DB level and
in the Python level since they are much faster to fetch as
non-ORM entities. In this patch we are trying that on simpler
queries to improve neutron performance.

Co-Authored-By: Joe Talerico <jtaleric@redhat.com>
Change-Id: I6a41e9487a4427f876442bbeeae61974e892225e
2018-08-22 10:14:09 +00:00
Boden R f4a684cdcb use autonested_transaction from neutron-lib
A publically consumed db api is available in neutron-lib. This patch
consumes the autonested_transaction by removing it's def from neutron
and replacing all such usages to now use neutron-lib's version of
autonested_transaction.

NeutronLibImpact

Change-Id: I8d7cbb9b90151d252959e9fce8937f3e4e456811
2018-07-26 07:41:34 -06:00
Boden R e4348eb1e1 use retry_db_errors from neutron-lib
The externally consumed APIs from neutron.db.api were rehomed into
neutron-lib with https://review.openstack.org/#/c/557040/

This patch consumes the retry_db_errors function from lib by:
- Removing retry_db_errors from neutron.db.api
- Updating the imports for retry_db_errors to use it from lib
- Using the DB API retry fixture from lib in the UTs where applicable
- Removing the UTs for neutron.db.api as they are now covered in lib

NeutronLibImpact

Change-Id: I1feb842d3e0e92c945efb01ece29856335a398fe
2018-07-16 08:10:54 -06:00
Brian Haley 7cfdf4aa81 Fix all pep8 E129 errors
Fixed all pep8 E129 errors and changed tox.ini to no longer
ignore them.

Change-Id: I0b06d99ce1d473b79a4cfdd173baa4f02e653847
2018-05-03 13:44:04 +09:00
Brian Haley c3b83a9ca6 Fix all pep8 E265 errors
Fixed all pep8 E265 errors and changed tox.ini to no longer
ignore them.  Also removed an N536 comment missed from a
previous change.

Change-Id: Ie6db8406c3b884c95b2a54a7598ea83476b8dba1
2018-04-30 16:35:52 -04:00
Zuul bfaae98396 Merge "use l3 api def from neutron-lib" 2017-12-16 13:01:14 +00:00
Zuul e6207a8d37 Merge "Remove router_ids argument to auto_schedule_routers()" 2017-12-16 03:48:34 +00:00
Boden R 54444407f4 use l3 api def from neutron-lib
Commit I81748aa0e48b1275df3e1ea41b1d36a117d0097d added the l3 extension
API definition to neutron-lib and commit
I2324a3a02789c798248cab41c278a2d9981d24be rehomed the l3 exceptions,
while Ifd79eb1a92853e49bd4ef028e7a7bd89811c6957 shims the l3
exceptions.

This patch consumes the l3 api def by:
- Removing the code from neutron that's now in lib.
- Using lib's version of the code where applicable.
- Tidying up the related unit tests as now that the l3 api def from lib
is used the necessary fixture is already setup in the parent chain when
setting up the unit test class.

NeutronLibImpact

Change-Id: If2e66e06b83e15ee2851ea2bc3b64ad366e675dd
2017-12-15 07:03:14 -07:00
Brian Haley d00b7ddec5 Remove router_ids argument to auto_schedule_routers()
The router_ids argument to auto_schedule_routers() is
unused, and was marked for deprecation in Queens.

Change-Id: Ie97b1ad05e294b5fe763ae8d7319800eb16ea3dc
2017-12-04 15:07:29 -05:00
Vu Cong Tuan 8b381c7324 Use Agent OVO in agents_db and test_agents_db
Agent object has been merged [1].
This patch uses Agent object in agents_db and test_agents_db.

We also introduce a new function (get_agents_object) and keep
the old function (get_agents_db) for backward compatibility.

[1] https://review.openstack.org/#/c/297887/

Co-Authored-By: Nguyen Phuong An <AnNP@vn.fujitsu.com>
Change-Id: I4c4283cb1aa05d52dca00cc249e094ea7d55b1d3
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
2017-11-03 16:46:09 +07:00
Zuul 680fa41054 Merge "Refactoring db config options" 2017-11-01 23:58:06 +00:00
Boden R e88f1e6fd5 use availability zone api def from lib
Commit I1d4ded9959c05c65b04b118b1c31b8e6db652e67 rehomed the
availability zone extension's API definition into neutron-lib. This
patch consumes it, removing the rehomed logic in neutron and switching
over to lib's version of it.

NeutronLibImpact

Change-Id: I761381de0d6e26a0380386700e7921b824991669
2017-10-27 06:45:58 +00:00
sindhudevale 3a098ea0e8 Refactoring db config options
Refactoring neutron db config opts to be in neutron/conf/db/ and
neutron/conf/agent/database/ so that all the configuration options
reside in a centralized location. This simplifies the process of
looking up the config opts and provides an easy way to import.

Change-Id: I4da9bb48d49b99e8c2b34a5c1b83e7eb95b70b82
Partial-Bug: #1563069
2017-10-04 15:42:50 -04:00
Armando Migliaccio 5567ef73bb Remove dead code in L3 HA scheduler
This was removed in I227ca60422545e40d3bbb8baf2b41a8ce14f4294 and
it is no longer being exercised.

TrivialFix

Change-Id: Idf9611675be871fac31d4cf9b4335c7ace911bb1
2017-10-02 12:11:12 -07:00
Jenkins e03744c335 Merge "OVO for NetworkDhcpAgentBinding" 2017-09-11 23:10:41 +00:00
Jenkins f83f4c4034 Merge "OVO for L3HARouter" 2017-09-11 05:54:15 +00:00
Nakul Dahiwade 7c7b2d75aa OVO for NetworkDhcpAgentBinding
This patch introduces and implements Oslo-Versioned Objects for
NetworkDhcpAgentBinding

Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
Co-Authored-By: Manjeet Singh Bhatia <manjeet.s.bhatia@intel.com>

Change-Id: Ie6220f8a1455ea721f0d9c7a1b58240cc5fde05a
2017-09-08 15:48:00 +00:00
sindhudevale c761a08473 OVO for L3HARouter
This patch introduces and integrates OVO for L3 HA Router.

Co-Authored-By: Nguyen Phuong An <AnNP@vn.fujitsu.com>
Co-Authored-By: Vu Cong Tuan <tuanvc@vn.fujitsu.com>
Change-Id: I3463921dec415dd073503ab9470588193d08ce87
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
2017-09-08 14:43:20 +07:00
venkata anil 5b0165e940 Avoid redundant HA port creation during migration
When a router is migrated between DVR+HA and HA(i.e DVR+HA->HA and
HA->DVR+HA), redundant "network:router_ha_interface" ports are created.
For binding a HA router to a agent, existing code can create multiple
ports, but is using only one port and other ports remain still in DB
until router is deleted.

In this patch, when duplicate entry is detected while binding,
we remove the port which is created at that time for binding.

Closes-Bug: 1715370
Change-Id: I0c6c5f9dfce1bf2d99672b5cf9e072bfb0228a17
2017-09-07 05:24:06 +00:00
Inessa Vasilevskaya 7322bd6efb Make code follow log translation guideline
Since Pike log messages should not be translated.
This patch removes calls to i18n _LC, _LI, _LE, _LW from
logging logic throughout the code. Translators definition
from neutron._i18n is removed as well.
This patch also removes log translation verification from
ignore directive in tox.ini.

Change-Id: If9aa76fcf121c0e61a7c08088006c5873faee56e
2017-08-14 02:01:48 +00:00
Jenkins af308ca0da Merge "Use flake8-import-order plugin" 2017-07-06 02:01:36 +00:00
Akihiro Motoki f64110f652 Use flake8-import-order plugin
In reviews we usually check import grouping but it is boring.
By using flake8-import-order plugin, we can avoid this.
It enforces loose checking so it sounds good to use it.
This flake8 plugin is already used in tempest.

Note that flake8-import-order version is pinned to avoid unexpected
breakage of pep8 job.

Setup for unit tests of hacking rules is tweaked to disable
flake8-import-order checks. This extension assumes an actual file exists
and causes hacking rule unit tests.

Change-Id: Ib51bd97dc4394ef2b46d4dbb7fb36a9aa9f8fe3d
2017-07-05 03:15:27 +00:00