Commit Graph

687 Commits

Author SHA1 Message Date
Gregory Thiemonge f5349aca00 Check haproxy status on reload
When reloading haproxy, check if a "<service> is not active, cannot
reload." error is triggered by systemd, it means that haproxy crashed
during the reload. When this error is detected, verify if haproxy has
reloaded correctly (check the socket and its uptime).

Related-Bug: #2054666

Change-Id: Ibadf6e529d53fb5a45b73af57243cee5a3f70d9b
2024-04-24 05:31:00 -04:00
Zuul b4e8727159 Merge "pyupgrade changes for Python3.8+ (7)" 2024-04-15 10:46:27 +00:00
Sergey Kraynev 85cfb6c2ae Fix negative or 0 limit parameter in pagination
Octavia replace "limit" with None when it is less 1. (for example 0, -1)
However the further code failed to compare None and int values.
This patch fixes it by validation, that limit is None.

Co-Authored-By: Roman Goncharov <gadzhet007@gmail.com>

Closes-Bug: #2060917
Change-Id: I9bb45a1aca6b7b18644752a3dccc3ebfb7c106ef
2024-04-12 19:23:28 +00:00
Sergey Kraynev 824b51a1da
Handle empty delay on update healthmonitor
Check that delay field is not UnsetType before further validation

Closes-Bug: #2059894
Change-Id: Ia853d43dc273019c76da09104f31aa7e1b154fec
2024-04-10 17:22:50 +04:00
Tom Weininger 6bbdd48815 pyupgrade changes for Python3.8+ (7)
Result of running

$ pyupgrade --py38-plus $(git ls-files | grep ".py$")

This was inspired by Nova [1]

Fixed PEP8 errors introduced by pyupgrade by running:

$ autopep8 --select=E127,E128,E501 --max-line-length 79 -r \
  --in-place octavia

and manual updates.

[1]: https://review.opendev.org/c/openstack/nova/+/896986

Change-Id: I9399730fed16b85686caa586788a1bc03ebd123a
2024-04-10 10:35:37 +02:00
Zuul fa7cc01787 Merge "Fix fully-populated API with allowed_cidrs" 2024-03-20 20:29:29 +00:00
OpenStack Release Bot e4d7186776 Update master for stable/2024.1
Add file to the reno documentation build to show release notes for
stable/2024.1.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2024.1.

Sem-Ver: feature
Change-Id: I744c29c1a03aba952b98a9fa3b6772073fa3805c
2024-03-14 19:54:08 +00:00
Gregory Thiemonge 5d9b23c602 Fix fully-populated API with allowed_cidrs
When creating a LB + a listener with an allowed_cidr with the
fully-populated API, an issue happened when Octavia validated that the
allowed_cidrs and the VIP ip address have the same IP version. The
vip.ip_address value was not updated in the load balancer object,
forcing the expiration of the DB object before entering _graph_create
fixes this issue.

Note: there's no change in the tests, the test function for this feature
exists, looks correct, and passes successfully, the bug is only
reproducible in octavia-api.

Closes-Bug: 2057751
Change-Id: Ia106d81c1b2588e5d938d2238c8a2f6660bf5ef1
2024-03-13 04:36:49 -04:00
Takashi Kajinami 4342c31ae2 dib: Remove Ubuntu Forcal support
Ubuntu Focal is no longer part of the tested environments, because of
newer LTS available now (Jammy).

Change-Id: I7a6df974762abdd94784416609304618ce702b6e
2024-03-13 12:16:59 +09:00
Zuul 2abab95fa0 Merge "Fix neutron setting overrides" 2024-03-11 16:47:28 +00:00
Zuul 46ce3ef2d0 Merge "Add release note about redis jobboard driver updates" 2024-03-08 14:11:15 +00:00
Zuul a26c452f6f Merge "fix: specify endpoint info. for neutron client" 2024-03-08 09:14:52 +00:00
Takashi Kajinami b7c293656b Add release note about redis jobboard driver updates
This adds a release note to explain updates made recently in redis
jobboard driver[1][2].

[1] 16f6b2e8f6
[2] bd3ef61a0c

Change-Id: I6c43a0a810f01632696f254a31e9a17c2f2cd73d
2024-03-07 16:45:07 +00:00
Zuul edfc9803f5 Merge "reno: Update master for unmaintained/victoria" 2024-03-06 09:09:49 +00:00
Zuul dc168aee83 Merge "reno: Update master for unmaintained/xena" 2024-03-06 08:47:57 +00:00
OpenStack Release Bot 5179cc3a2e reno: Update master for unmaintained/xena
Update the xena release notes configuration to build from
unmaintained/xena.

Change-Id: I611b21c6a03b01c8dff364b223da324d6e2fb1ac
2024-03-05 18:59:44 +00:00
OpenStack Release Bot 1d411539bb reno: Update master for unmaintained/wallaby
Update the wallaby release notes configuration to build from
unmaintained/wallaby.

Change-Id: If0336f59e8aa68298cd3efb9b8ee2dd391b90387
2024-03-05 18:58:35 +00:00
OpenStack Release Bot 959297dba0 reno: Update master for unmaintained/victoria
Update the victoria release notes configuration to build from
unmaintained/victoria.

Change-Id: I1e830e9c06f87125835afe2115d6b32a84fc2b80
2024-03-05 18:57:25 +00:00
Zuul 115b18effd Merge "Enable nftables rules for SR-IOV VIPs" 2024-02-29 09:45:29 +00:00
Zuul 346e65cfee Merge "Add nftables support for SR-IOV VIPs" 2024-02-29 09:28:17 +00:00
Michael Johnson fc37d8303d Enable nftables rules for SR-IOV VIPs
This patch enables setting the nftables rules in Amphora using SR-IOV VIPs.

Change-Id: I554aac422371abafb4bb04e2d0df3fce3fa169d4
2024-02-28 17:07:05 +00:00
Michael Johnson d83999f4ed Add nftables support for SR-IOV VIPs
This patch adds the initial nftables support in the amphora for SR-IOV
VIPs. Followup patches will add rules to the nftables chain. As this
point in the patch chain, SR-IOV VIPs will not pass any traffic.

Change-Id: Ib2a1c3f49a26690d2e0e9c7330e047748c0b5105
2024-02-28 16:00:12 +00:00
Zuul b2f3f77d9e Merge "Honor connection_recycle_timeout in MysqlPersistenceDriver" 2024-02-28 05:27:01 +00:00
OpenStack Release Bot c8e5e46e47 reno: Update master for unmaintained/yoga
Update the yoga release notes configuration to build from
unmaintained/yoga.

Change-Id: I8ce1ff627a7d50583f6d2dbca123eb7a88c857f5
2024-02-19 06:36:44 +00:00
Mohammed Naser 7352dc8f1e fix: specify endpoint info. for neutron client
Closes bug: #2049551

Change-Id: I80a266e500958415a70d462ddfe57e9e03e6ef13
2024-02-15 14:28:47 +08:00
Gregory Thiemonge 7bb6096ecc Fix neutron setting overrides
Since 2023.2, we deprecated some settings in the [neutron] section
('endpoint', 'endpoint_type' and 'ca_certificates_file'), they are
respectively replaced by 'endpoint_override', 'valid_interfaces' and
'cafile'. There's some code in Octavia that automatically sets the new
settings if the user still has the old settings (it is required because
keystoneauth uses the CONF objects to establish the sessions).
But some corner cases were not correctly addressed in that patch.

Now Octavia ensures that the override of the parameters is correctly
handled.

Change-Id: Ic37e9f699e32431ae1735ddc9642689967ddc696
Closes-Bug: 2051604
2024-02-01 14:32:11 +01:00
Zuul 5750e4512d Merge "Provide Amphora stats for Octavia no-op drivers" 2024-01-10 19:16:14 +00:00
Zuul 490a65fceb Merge "Fix issue with certificates with no subject or CN" 2024-01-06 15:54:20 +00:00
Michael Johnson 73cdee503f Fix issue with certificates with no subject or CN
This patch fixes an issue where if the user attempts to use a
certificate that does not have a subject or CN, we would fail to create
a listener using the certificate.
Per the x.509 specification, a blank subject is allowed as long as the
subjectAltName extension is present in the certificate.
Octavia will now check for the a valid subAltName if the subject CN can
not be retrieved. If both are missing an appropriate error is raised for
the user.

Closes-Bug: #2043582
Change-Id: I06911f42b9bf29cf9a5f2e76d8333d8a2f1bc60b
2023-12-01 00:36:03 +00:00
Zuul 57e494c4be Merge "Fix TLS-HELLO healthmonitors in the amphora-driver" 2023-11-30 00:46:54 +00:00
Zuul 20bbafa0a6 Merge "Fix health-monitors with ALPN members" 2023-11-30 00:35:32 +00:00
Gregory Thiemonge a81cf552ce Added olso_middleware.sizelimit support
Change-Id: I484e4a88993196f63c8c9285dc2772507cc4d8c5
2023-11-28 07:10:53 -05:00
Gregory Thiemonge 8e7c2737b6 Fix TLS-HELLO healthmonitors in the amphora-driver
TLS-HELLO HMs were based on the ssl-hello-chk option of haproxy, which
uses SSLv3 messages. SSLv3 is deprecated and most distributions have
disabled it, remove this option and rely only on the default checker
when ssl is enabled [0]

[0] https://docs.haproxy.org/2.8/configuration.html#5.2-check

Related-Bug: #2043812

Change-Id: Ia681679e24437832e1e23e7399e1a34da8ab54c5
2023-11-21 02:24:51 -05:00
Gregory Thiemonge c28eb84dca Fix health-monitors with ALPN members
Using HTTP or HTTPS health-monitor on a ALPN pool failed with SSL
errors.
haproxy doc mentions that when using "check" with ALPN servers, the
check-alpn option must be enabled.

[0] https://docs.haproxy.org/2.8/configuration.html#5.2-check

Closes-Bug: #2043812

Change-Id: I5698558857cbaa585f8a3d7ac37aaa31c0189d46
2023-11-20 02:58:52 -05:00
Takashi Kajinami ff1b201d58 Honor connection_recycle_timeout in MysqlPersistenceDriver
The taskflow library allows us to customize idle_timeout. This change
makes the option set according to the equivalent option in oslo.db
similarly to the other options such as max_overflow.

Change-Id: I1c50f232c4f0c5c10a3dd5a928466f7ef67a9763
2023-11-15 01:55:14 +09:00
Omer 0c367b4fed Provide Amphora stats for Octavia no-op drivers
So far, when Octavia was running with noop drivers, there were no
amphora statistics data provided and 404 was returned as the
AmphoraStatistics object was not created, and therefore not found.

This patch adds fake statistics to amphora noop driver.

Closes-Bug: #2030774
Change-Id: Ib65e459bcd10a5ab877c0cf6f234d634d25d1e55
2023-11-02 12:07:13 +01:00
Omer 7310986de9 Add Noop Certificate Manager
So far, Octavia noop drivers were using real certificate managers, which
have validated the cerifitates for every certificate required operation,
sometimes without any need.

Octavia should have a Noop Certificate Manager for faster testing
purposes.

This patch adds it.

Closes-Bug: #2034711

Change-Id: I700c65fb17bad28b2b922e03d9c94c4716de9cbe
2023-11-02 12:07:11 +01:00
Zuul c91ffe0e49 Merge "Fix Amphora Configure API call" 2023-10-17 19:02:41 +00:00
Gregory Thiemonge e756866a7b Fix Amphora Configure API call
The Amphora Configure API call failed because  a new sqlalchemy
transaction was created but a transaction was already begun.
Remove the nested begin() calls to fix the issue.

Closes-Bug: #2039281
Change-Id: Ie20cce4e8355737711a9def7470550e4e43c0c35
2023-10-13 10:19:18 -04:00
Nguyen Ngoc Hieu 7261730dff Fix health monitor information retrieval in API response
Closes bug: #2038367

Behavior: In the response body of the LB API when creating
a new load balancer, the information about the health
monitor is always null, even though it has been configured.

Reproduce: Using the Octavia API to create a new LB with
all components. You cannot see any information about the
health monitor that will be returned.

Proposed Fix: Modify the assignment to use
`data_model.health_monitor` instead of `pool.healthmonitor`.

Change-Id: Ia914ad89b6fdf3606c3d4bff0a4c425348c15e0c
2023-10-13 11:55:57 +07:00
Zuul 860d2f6aad Merge "Fix incorrect masquerade rules in multivip LBs" 2023-10-11 12:54:03 +00:00
Zuul 6a02e0a48e Merge "Fix error when deleting LB with broken amp" 2023-10-11 12:42:08 +00:00
Zuul d3f6c99f09 Merge "Fix amphorae in ERROR during the failover" 2023-10-09 18:05:58 +00:00
Zuul 1f71d1fd96 Merge "Retry to set loadbalancer prov status on failures" 2023-10-09 16:16:35 +00:00
Zuul 3f2903d0b2 Merge "Reduce duration of failovers with amphora in ERROR" 2023-10-09 15:35:27 +00:00
Zuul b01f7f9725 Merge "Fix timeout duration in start_vrrp_service during failovers" 2023-10-09 12:10:36 +00:00
Gregory Thiemonge 248cf2893e Fix amphorae in ERROR during the failover
When 2 amps were down, the failover flow created the first one and
needed to update both amp to configure VRRP, but as the 2nd was missing,
it was set to ERROR. Then the health-manager could not trigger a
failover becasue amphorae in ERROR are excluded from the automated
failover process.

This commit changes the tasks that must be run on both amphorae during a
failover of one amphora, it doesn't mark the secondary amphora in ERROR
if it is not reachable.

Closes-Bug: #2033734

Change-Id: I4bd027346c61b93b537ab53810c2ecb6160b6be2
2023-10-09 11:39:17 +00:00
Gregory Thiemonge ca70587f0b Reduce duration of failovers with amphora in ERROR
In the failover flow, there are multiple tasks for the configuration of
VRRP for the other amphorae of the load balancer, but during outage the
other amps may not be available. To prevent the tasks from attempting
connections to unreachable amphorae, we can detect in the first task
that an amp is unreachable and pass this information to the other tasks.

Those connection attempts could have taken a lot of time, between 15 min
and 40 min depending on the configuration of Octavia and the provider
driver (amphorav1 or amphorav2)

Closes-Bug: #2033894

Change-Id: Ib33a0b8d2875e4ff97c65933fe9360bb06994d32
2023-10-09 13:37:18 +02:00
Gregory Thiemonge be91493332 Retry to set loadbalancer prov status on failures
In case of DB outages when a flow is running, an exception is caught and
the flow is reverted. In most of the flows, the revert function of the
first task's (the last to be reverted) unlocks the load balancer by
setting its provisioning status (to ERROR or ACTIVE, depending on the
flow), but it fails if the DB is not reachable, leaving the LB in
a PENDING_* state.
This commit adds tenacity.retry to those functions, Octavia retries to
set the status during ~2h45 (2000 attempts, 1 sec initial delay, 5 sec
max delay).

Closes-Bug: #2036952
Change-Id: I458dd6d6f5383edc24116ea0fa27e3a593044146
2023-10-03 06:13:34 -04:00
Gregory Thiemonge 5c051a6ab6 Fix incorrect masquerade rules in multivip LBs
The up scripts of the interface files were called only when the
interface moved from down to up, it means that they were not called
during the update of the configuration of an interface. So if during an
update, if an ipv6 subnet was plugged while the ipv4 subnet was already
there, the up script that sets the masquerade rules was not called.

It broke connectivity for either ipv4 or ipv6 between the client and the
members in UDP listeners in multivip load balancers.

Closes-Bug: #2037943

Change-Id: Iad78de1764bc3a3f699b5feef9e58999d2efe613
2023-10-02 03:11:31 -04:00