Commit Graph

123 Commits (65e132a734f005f090a384bfa129482d195c6d6e)

Author SHA1 Message Date
Carlos Goncalves c4faac25de Add Python 3.7 support
In order to support Python 3.7, pylint has to be updated to 2.0.0
minimum. Newer versions of Pylint enforce additional checkers which can
be addressed with some code refactoring rather than silently ignoring
them in pylintrc; except useless-object-inheritance which is required to
be silented so that we stay compatible with Python 2.x.

Story: 2004073
Task: 27434

Change-Id: I52301d763797d619f195bd8a1c32bc47f1e68420
4 years ago
Zuul e001c664c9 Merge "Fix invalid query selector with list_ports" 4 years ago
Gregory Thiemonge 5fb79c9495 Fix invalid query selector with list_ports
Fixed an exception thrown by neutron_client's list_ports when the
deletion of the VIP security group fails.

Story 2005355
Task 30309

Change-Id: I7d972dcc6b43406523063f2082b42e2d9a2b50c9
4 years ago
Carlos Goncalves e0c45ce4d2 Fix setting of VIP QoS policy
Load balancers were going in to ERROR when updating vip_qos_policy_id in
two different cases:

- QoS extension enabled: the VIP DB data model was incorrectly
  constructed ('vip_qos_policy_id' where it should have been
- QoS extension disabled: setting an UUID or None would fail in the LB
  update flow as the extension is disabled, and the API would return
  HTTP 202 to the user.

Story: 2004602
Task: 28512

Change-Id: Ie974afa52fe70cbab72b7e7f75bf7ee1015e148c
4 years ago
Michael Johnson 1f709e3355 Fix parallel plug vip
A recent patch[1] introduced parallel network configuration on load
balancer boot. However, this patch has a race condition between the
parallel booting amphora.
This patch corrects this by making the get amphora network configurations
task to work on a single amphora if one is presented to the task.

Change-Id: Ideb050a215b0b0335ea94163650959994f987008
Story: 2005080
Task: 29659
4 years ago
German Eichberger 06baf6d542 Refactor the pluggin of the VIP
This aims to make plugging the vip based on the amphora instead
the LB for the LB create flows.

Change-Id: I0eaae7b60333d2e720acc9570a0d398a06be46e5
4 years ago
Michael Johnson 0b1fe6a526 Adds flavor support to the amphora driver
This patch adds support for flavor metadata validation by the amphora driver
and support for setting the load balancer topology via a flavor.
It also adds "flavor_id" to the load balancer table in the database.

Change-Id: I8eae870abdb20dc32917957e32606deef387ec88
4 years ago
German Eichberger 79cd851548 Refactor the AAP driver to not depend on nova
Replace calls to the nova client with calls to the compute driver.
This will help non vm efforts (e.g. zune) and also make the code
easier to break up later.

Change-Id: I7ee175c5ecb98af0ca5e299c2ac10e43eb40ed30
5 years ago
Michael Johnson 9f9bc9630a Fix neutron "tenat_id" compatibility
Octavia had a regression where it was not longer compatible with older
versions of neutron due to a change for the VIP port ownership.

This patch fixes that regression by checking if the project-id extension
to neutron is persent.

Change-Id: Iee405ceaee91f58d6163679b4c8809d1d27f855b
Story: 2003278
Task: 24219
5 years ago
ZhaoBo a890f2ba35 UDP for [2]
These files will split with the current Octavia repo, before other parts
are ok.

Patch List:

[1] Finish keepalived LVS jinja template for UDP support
[2] Extend the ability of amp agent for upload/refresh the keepalived
[3] Extend the db model and db table with necessary fields for met the new
udp backend
[4] Add logic/workflow elements process in UDP cases
[5] Extend the existing API to access udp parameters in Listener API
[6] Extend the existing pool API to access the new option in
session_persistence fields

Change-Id: Ib4924e602d450b1feadb29e830d715ae77f5bbfe
5 years ago
Zuul 625ac5b69e Merge "Ignore a port not found when deleting an LB" 5 years ago
German Eichberger 81f2ebb7f2 Ignore a port not found when deleting an LB
There seems to be a case where we successfully retrieve the port
but when we try to update it might be gone because someone deleted
the vip port manually while our delete was scheduled.

Octavia does the right thing and marks the LB in ERROR bu this
will make our delete a bit more resilient to outside interference.

Change-Id: I847e46a674ba31c3e9669a99bf5c0268a3e26d23
5 years ago
Doug Hellmann 0322cbc5c3 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

This patch also updates pylint to 1.5.6 which is compatible with
In updating pylint we have some issues to correct, this patch addresses
those issues so the Octavia code passes pylint 1.5.6.

Change-Id: Iec21f4c803a427059d595612336d67a35ebf9585
Signed-off-by: Doug Hellmann <>
5 years ago
Adam Harwell 254d4d4d86 When SG delete fails on vip deallocate, try harder
Go out and find the ports that are using the SG and remove them.

Change-Id: I2f97f969ea4ff699bef6a7fcd86d5aac6ad3b423
5 years ago
Mohammed Naser b4632d7fe9 Remove PluggedVIPNotFound references
The PluggedVIPNotFound exception is no longer being raised anywhere
so we can drop any references to it.

Change-Id: Ida424233a3a7fbb372a837ba3f484abd089d38aa
5 years ago
Michael Johnson 538cfdd256 Fix a no-op network driver bug on plug_port
The base meta-class and no-op network driver had an incorrect plug_port
parameter compared to the allowed-address-pairs driver. This patch corrects
this and aligns the driver signatures.

Change-Id: I74a57ab1374a3cea431fa750aa464d5628e4ef85
5 years ago
Jacky Hu 649b33d247 Add license for empty
This also fix build-openstack-sphinx-docs, there was a change introduced
in sphinx 1.6.6:

If the size of is less than 2, then the module would be
skipped which will cause the sphinx consistency checking failing later.

Change-Id: I9d8764b6e907aceed8bb8a9b04711145d0eb32ad
5 years ago
Michael Johnson d1e9c56128 Fix network no-op driver get_network_configs
The network no-op driver was not returning the required data for a
get_network_configs call which causes load balancer failover tests to
fail when using the no-op driver.

Change-Id: I52b5651a7b33aae42760b850f913b6b591367207
5 years ago
Michael Johnson 4fb6fa2106 Handle missing security groups on listener delete
On listener create or delete we update the VIP security group rules to
reflect the addition or removal of the TCP port on the VIP.
In the unusual event that the security group is missing in neutron, even
listener delete calls would fail.
This patch allows listener deletes to continue if the security group is
missing from the VIP.

Change-Id: Ic0186c34d3215869f1b92bcd4c8e015e0dd54053
Story: 2001381
Task: 5955
5 years ago
Adam Harwell b10668a21a Add unit tests for neutron utils, add model/util for floating_ip
Floating IP model isn't used yet in-tree, but the conversion is tested,
and it could be used by various drivers (it is already used by the FLIP

Change-Id: I5f54c5ea5e70ea03f830548d61a2afee205f7f63
5 years ago
Carlos Goncalves 72de2d4d4a Fix exception when querying for non-existing items
An IndexError exception is raised when trying to get non-existing and
unique item resources via Neutron network driver.

Even though the exception is caught and raises a base.NetworkException
exception, it should raise an exception from
neutron_client_exceptions.NotFound instead.

Story: 2001424
Task: 6130

Change-Id: I0e99e846bb58b88d98598f2f2b52c7c1f8ea0967
5 years ago
Bar RH 32206f77f6 Remove reliance on NeutronException message field
The 'message' class member in Exception was deprecated in PY2.6 and
removed in PY3.0 [1]. Should Neutron code abandon its use of this
field, it will break current Octavia code.
This patch shields Octavia of such change, replacing exc.message
calls with exc.__str__().

[1] -

Change-Id: Ia7836f0d68e20d9964334bc41f7789efd1007939
6 years ago
ZhaoBo 51f6f7258b Extend api to accept qos_policy_id
This patch extend Octavia v2 API to access qos_policy_id from neutron.
Users can pass it as 'vip_qos_policy_id' to Octavia request body to
create/update Loadbalancers, and the vrrp ports will have the qos

This patch modifies the Loadbalancer Post/Put request body and response
body. It also extends the 'vip' table with the new column named
'qos_policy_id' to store the qos_id from neutron.

Co-Authored-By: Reedip <>

Change-Id: I43aba9d2ae816b1498d16da077936d6bdb62e30a
6 years ago
Bar RH da9ab7a958 Improve Neutron driver _get_resource()
* Add support to resource names that contain underscores (e.g. qos_policy)
* Update _get_resources_by_filters to return a list of matches
  by default.
* Add mock constants

Change-Id: Idc193a2ba7df29025b12da8335efebb8d6b4b5af
6 years ago
German Eichberger 0f4a5e2170 Adds the user's project id to the VIP port creation
This brings Octavia in line with what n-lbaas does for VIP port and
allows a user to attach a FIP to the VIP port generated by Octavia.

Change-Id: Ib7e6374cad49a16a733dacb2ea1ca096d8c4e6e4
6 years ago
Zuul 62c398c5cb Merge "Handle race condition deleting security group rule" 6 years ago
Mohammed Naser 709a23cdce Handle race condition deleting security group rule
It is possible that during the `_update_security_group_rules` operation,
the security group rule which is to be deleted gets removed by some
other external operation.   If this happens, it raises a NotFound
exception is not handled which can lead to a load balancer stuck in

Depends-On: I97b52b80efb33749647229a55147a08afa112dd2
Change-Id: Ic9ebe8392758f3de5fc6a94f815f83d6de113188
Story: 2001300
Task: 5851
6 years ago
Michael Johnson ab0fe776d8 Make the allowed_address_pairs driver better
The allowed address pairs network driver did not handle having objects
already deleted properly and would prematurely fail.
This patch improves the edge case handling of the driver.

Change-Id: Ice15aa2d6309648da43d6a40ce0286d5dce17500
Story: 2001258
Task: 5791
6 years ago
Dong Jun ff20b3faf4 import _ from octavia.i18n
builtin _ is deprecated and pylint will throw an error for it.

Change-Id: Ia5599dd2c65455eae13fadfac277f590dcaa2df5
6 years ago
Jenkins 1421d451ee Merge "Use flake8-import-order plugin" 6 years ago
Nir Magnezi 4f7c541793 Use flake8-import-order plugin
This addition automates the process, as opposed to relying on review inputs.
Inspired by Ib51bd97dc4394ef2b46d4dbb7fb36a9aa9f8fe3d

Change-Id: I1d6051cf6678b6d5db774fc884390fec626c1f2c
6 years ago
Michael Johnson c1afc15863 Stop masking VIP allocate neutron errors
Previously the neutron network driver was masking the actual error being
returned from neutron while doing a VIP port allocation.
This patch will pass through the neutron error to the user if it is
an API ready exception giving the user more useful information about the
error neutron is reporting. For example that the requested VIP address is
already allocated.

Change-Id: Ic327b06ff9ccf9ae0c9931a8e6569c20d03c4a79
Closes-Bug: #1714593
Story: 1714593
Task: 5005
6 years ago
Michael Johnson 7c986df83d Fix LB creation with VIP port
Octavia v2 API was failing to create the load balancer when the user
specified a VIP port ID.
This also improves the user experience when specifying a VIP address.
It also removes the un-used nova_network directory.

Change-Id: I8b533094df1e5425f824fff0454335709ce05447
Closes-Bug: #1709922
6 years ago
Jenkins 738f3f78a6 Merge "Properly store VIP data on LB Create" 6 years ago
Jenkins 7ab5b27413 Merge "Fix sg_rule didn't set protocol field" 6 years ago
ZhaoBo 7f5749d534 Fix sg_rule didn't set protocol field
If the lb security group contains 1 rule without protocol, worker may
raise error in _update_security_group_rules when listener creation.

Change-Id: Idc826d251296435119ae963c832de29160062967
6 years ago
Adam Harwell c28d212a17 Properly store VIP data on LB Create
Right now the vip data isn't actually stored back to the DB, it just
looks like it is... So, actually it will create a port and then orphan
it, then create another port with a different IP later.

Change-Id: Ibb7b2bd89155e37fb41a5f62ba2cda6e233a127a
6 years ago
cheng e797e8763f Add allocate vip port when create loadbalancer in server side
Closes-Bug: #1666559
Closes-Bug: #1695331
Change-Id: I102efb9a22ac1cdcffc0f959d0b04401e34f425c
Signed-off-by: cheng <>
6 years ago
Ngo Quoc Cuong b3506fa3eb Enable H904 check
H904 allows the logging package to skip creating the formatted log
message if the message is not going to be emitted because of the
current log level.

Change-Id: Id6e27d8fefacd93bde41db21a20c8eaf3d3d6880
6 years ago
Michael Johnson 93c8e006ce Update Octavia docs for documentation migration
This patch updates the Octavia documentation in support of the
OpenStack documentation migration[1].

[1] \

Change-Id: I97fd038b8050bfe776c3fca8336d9090f8236362
Depends-On: Ia750cb049c0f53a234ea70ce1f2bbbb7a2aa9454
6 years ago
Erik Olof Gunnar Andersson adfe2fec38 Handle log message interpolation by the logger
According to OpenStack Guideline[1], logged string message should be
interpolated by the logger.


Change-Id: I532fe2537fcd2ae6b4344d214a308b1a26416745
6 years ago
Adam Harwell 5a9e1dddb3 Noop network driver should provide a more hydrated network
This allows LB creates with the noop driver when providing a network_id,
because it tries to validate the subnet.

Closes-Bug: #1687584
Change-Id: I4ebcbaae659bb6ee76e74ec7564e01a7a5a92a3c
6 years ago
e dc882e9d27 Remove log translations from octavia
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

This patch also adds hacking rules for the translation tags.


Co-Authored-By: Michael Johnson <>
Change-Id: Ic95111d09e38b3f44fd6c85d0bcf0355c21ef545
6 years ago
johnsom 412fb302a6 Fix a bug where ports may not be deleted
A loop to delete vip ports had an improperly scoped try block that
could, under the right circumstance lead to ports not getting deleted.
This patch fixes that scoping.

Co-Authored-By: Adam Harwell <>
Change-Id: I162eed5e48b361ed9f4c5b10edcf90bd8a7d4818
6 years ago
Adam Harwell 5f6ffc4b14 Fix dumb error message typo
Change-Id: I7f77532dd13f8200d8b2ccfc6bbe740a31f996a9
6 years ago
Adam Harwell e1ec15c9a8 Allow to create vip in lb-mgmt-net
Change-Id: Ie2c916bd557190e5dfead12c2635955da92c52ff
Closes-Bug: #1659488
6 years ago
Adam Harwell 2ec4460cd9 Add network_id to VIP to match neutron-lbaas
Change-Id: I5d9e46ddd38d41c0c535a2da6a62a57c71b105ba
6 years ago
Adam Harwell c26697898c Cleanup noop network driver to fix py3x
Change-Id: I52258116122ff64373ef709d3d43d1ee9563e2a5
6 years ago
ZhaoBo b021862d50 Add check when plug vrrp port in LB creation
Currently, we can create LB instance with vip-subnet. But we create vrrp
port with neutron network using the default neutron behavior. So the port
may be different subnet with vip. This may be useless.

This patch create the vrrp in the same subnet.

Change-Id: If912a9686fe072eb9288b348bb818082363e6c0b
Closes-Bug: #1653943
6 years ago
Jenkins 71f0aea35f Merge "Save neutron calls if plugin does not support dns-integration" 6 years ago