Commit Graph

5495 Commits

Author SHA1 Message Date
Pham Le Gia Dai ec5fae9976 Remove unused `WSGIService` class
This class have been stayed in source code for a long
time and not used since it created. The API service used `senlin.api.common.wsgi.Server`, not this class . It should be cleaned up.

Change-Id: I71196af4ad5ce0c975bec1c8c80be19b43ccbd2d
2024-04-08 07:46:51 +00:00
Zuul 02e4acdc6c Merge "Fix error can't do rebuild nova instances" 2024-04-05 11:18:38 +00:00
Bo Tran 450bd35136 Fix error can't do rebuild nova instances
Currently, the python openstacksdk changed rebuild_server function's
parameters. So, when the senlin-engine handle rebuild nova instance, it
will raise this error like: "rebuild_server() got multiple values
for argument 'image'"

This patch will fix above error

Change-Id: Ibc03fe6d5ca6db2b02ece5d0b3aab00dff157de1
2024-03-25 13:48:29 +07:00
Tyler Adams 4eda307207 The utils module and its LazyPluggable class are abandoned and need to be cleaned up. A search of the code base shows no from senlin.db import utils. Database calls are done through senlin.db.api
Change-Id: I89055876fab6d1a060b9609ce883f0e6812fc478
2024-03-23 18:05:24 +00:00
Tyler Adams 6b15b97689 Remove executable permissions from files that don't need it
Many python files have their executable permissions flag set but they shouldn't Removed executable flag from files that did not need it

Closes-Bug: #2055736
Change-Id: Ic04051fdc597b2f915f76e4c4c47f392354ddfe1
2024-03-02 00:14:48 +00:00
Zuul 7fa6ae780c Merge "Removing CLUSTER_RESIZE from pre-op skip List at min threshold" 2024-01-18 06:52:10 +00:00
Pham Le Gia Dai 2d6f537b38 Fix: `TrustMiddleware` unable to fetch trusts/credentials from identity service
When using token to init a new openstacksdk connection, the SDK try to fetch
another token from it, causing keystone raise exception and return 500 status
response. Refer: https://bugs.launchpad.net/keystone/+bug/1959674
Switch from `token` to `admin_token` to make the SDK session use the provided
token directly instead of fetching a new one.

Closes-bug: #2048452
Depends-On: https://review.opendev.org/c/openstack/senlin/+/905555
Change-Id: I8f9b2db3d4851cf54c2113b2fb0ae97ae38ac286
2024-01-15 02:04:29 +00:00
Nguyen Ngoc Hieu 7ef513dd79 Removing CLUSTER_RESIZE from pre-op skip List at min threshold
Excluding CLUSTER_RESIZE from the list of actions that skip
pre-operation checks if the cluster is already at the minimum threshold.

When the cluster is at the minimum threshold, pre-op LB will function
with actions such as CLUSTER_DEL_NODES, CLUSTER_SCALE_IN, NODE_DELETE,
and will skip actions like CLUSTER_REPLACE_NODES and CLUSTER_RESIZE.

Closes-Bug: #2049191
Change-Id: I00a7ea40f69bafc94ca2bba9f268af7b03344997
2024-01-15 02:23:07 +07:00
Zuul 5552e197b3 Merge "Fix: ServerProfile._validate_volume_type() missing 1 required positional argument: 'name_or_id'" 2024-01-14 18:50:11 +00:00
Pham Le Gia Dai 3aa3959e08 Fix: ServerProfile._validate_volume_type() missing 1 required positional argument: 'name_or_id'
Pass `obj` param to `_validate_volume_type` method call in `_resolve_bdm` method.
Add missing param `ignore_missing` in `volume_type_get` of `cinder_v2` driver

Closes-bug: #2048726
Depends-On: https://review.opendev.org/c/openstack/senlin/+/905555
Change-Id: I667e2bf1ae5dbabbb9e75d59f10c56b4a355cb44
2024-01-14 16:42:16 +07:00
Pham Le Gia Dai eb1899b830 Remove SSL Middleware tests
The SSL Middleware got removed from the `oslo.middleware` lib.  Refer: 67b9c23f16
This cause zuul jobs failed.

Change-Id: Iba896057e16843739e3a395edf8df97fbac6107d
2024-01-14 16:20:57 +07:00
Zuul 29f2e885e7 Merge "fix: SCALE_IN action not honoring specified node count" 2024-01-10 06:37:50 +00:00
Nguyen Ngoc Hieu 23f3bd708b Skip pre_op LB if cluster is already at min size
In cases where the cluster's desired capacity equals
the minimum size, executing an action causing node
(exception: CLUSTER_REPLACE_NODES) reduction led to
premature removal of the node's IP from the load
balancer during the pre_op step.

The commit addresses this issue by introducing a check
to skip the pre_op step if the cluster is already at
its minimum size. Now, when desired_capacity equals min_size,
the pre_op step is bypassed, preventing unnecessary
removal of IPs from the load balancer.

Closes-Bug: #2048100
Change-Id: Ia7389e8c555497cfa5ccbdca77258f4165dfc62d
2024-01-07 04:57:27 +07:00
Nguyen Ngoc Hieu 2b66935763 fix: SCALE_IN action not honoring specified node count
The SCALE_IN action in the lb_policy module was removing only
one node from the load balancer, regardless of the specified
count when the count was greater than 1. This was due to a
hard-coded count of 1 in the _get_delete_candidates function.

The root cause has been addressed by updating the
_get_delete_candidates function to dynamically handle the count
for SCALE_IN. The count is now retrieved from the action inputs,
and if not specified or invalid, it defaults to 1.

Closes-Bug: #2048099
Change-Id: I9ff12dec26f4c558ef5ef84de87668e9668cec80
2024-01-06 14:14:49 +07:00
Zuul 5c0fae0453 Merge "Add upgrade test coverage" 2024-01-04 17:41:19 +00:00
Pham Le Gia Dai 541498724b TypeError: 'OSError' object is not subscriptable raised when terminate senlin-api process unexpectedly
When terminate senlin-api process the `evenlet.wsgi.server` raised OSError exception that is not a list or a tuple which make TypeError raised and the senlin-api process may not be terminated properly

Closes-Bug: #2047914
Change-Id: Id02befe51e9118c8d8dafc3c926398fbf7e1258e
2024-01-04 04:22:27 +00:00
Erik Olof Gunnar Andersson 3696403941 Add upgrade test coverage
Adding additional test upgrade coverage.

Change-Id: I14dfa9371070927b335649f00c15716d935da776
2023-12-31 00:01:51 +00:00
Erik Olof Gunnar Andersson de1ab6d96b Fixed sqlalchemy 2.x support
Re-arranged sessions to always be at the top level to make
it easier to know the origin of the current session. This
is important now that we no longer have autocommit enabled.

- Added zuul job testing sqlalchemy 2.x.
- Added new db api for service cleanup.
- Removed broken sqlite cleanup step during testing.

Change-Id: I168f3d9518611ac66cb9eec1132a7add19e92d5f
2023-12-29 12:06:57 -08:00
Thomas Goirand 9d36ff5c29 Use assert_has_calls not has_calls
has_calls was removed from Python 3.12, as starts failing in Debian
unstable. This patch fixes it.

Change-Id: Id594856ad39c17e2eb105e6ad5067fa9a66a04a3
2023-12-13 12:56:08 +01:00
Dmitriy Rabotyagov 4125b34e0a Do not use deperecated MetaData.bind
Sqlaclhemy metadata bind is deperecated from version 1.4 and will
be removed in SQLAlchemy 2.0 [1]. It can be easily replaced with
metadata reflect which works for SQLAlchemy 2.0.

Also current metadata.bind does not result in fetching all tables from
the database, so metadata.tables is an empty mapping, which leads
to db_sync failures.

[1] https://docs.sqlalchemy.org/en/14/core/metadata.html#sqlalchemy.schema.MetaData.bind
[2] https://docs.sqlalchemy.org/en/14/core/reflection.html#reflecting-all-tables-at-once

Change-Id: I2b6f5f7e58567759b631baad87861d3a135f60fa
2023-08-23 11:53:24 +02:00
Bui Doan Dang a5c28aeec3 Add volume type to bdm_v2
This patch support user create volume with volume type.

Change-Id: I8f841cf3cd92bf901e218f92e553aa0b0405f3b6
2023-07-10 08:10:32 +07:00
Bui Doan Dang 6eee2f4153 Support create profile with subnet
This patch allow to define subnet in profile,
Default network port will find a random subnet to create port on, user can define specific subnet.

Change-Id: I8a29dcb7c8b92c8bd1b8c9111134c3ace6ea9a76
2023-04-26 14:01:40 +07:00
Erik Olof Gunnar Andersson 18540721f4 Switch Senlin to Alembic database migrations
sqlalchemy-migrate is no longer supported and we need to switch
to alembic for database migrations.

Change-Id: I2e51b4027f7af63944b5504ddcf50e9e48818259
2023-03-26 22:47:22 +00:00
Erik Olof Gunnar Andersson 55ac1c9928 Add cleanup step for orphaned health checks
This adds a cleanup task on the health manager to
help prevent orphaned health checks.

Change-Id: Ia5d7a3afdb1e610b0f8463857c69ce35efb966ed
2023-03-10 05:45:43 +00:00
Tobias Urdin a6bc01a7f9 Use new get_rpc_client API from oslo.messaging
Use the new API that is consistent with
the existing API instead of instantiating the client
class directly.

This was introduced in release 14.1.0 here [1] and
added into oslo.messaging here [2]

[1] https://review.opendev.org/c/openstack/requirements/+/869340
[2] https://review.opendev.org/c/openstack/oslo.messaging/+/862419

Change-Id: Ibb44b96108ef6029fe693d0765d59aa15570107e
2023-01-21 15:45:44 -08:00
OpenStack Proposal Bot 59c5ef4b45 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I009338d1b0a618eedba91d4763e2cc9d05148bb8
2022-06-21 04:15:54 +00:00
Erik Olof Gunnar Andersson ee2959af3c Fixed service manage not cleaning properly
When spliting the engine up into multiple services
the cleanup job was left on the conductor, but in
reality each service needs to handle their own clean
up, as the service startup order is never guaranteed.

This patch refactors the service workflow and moves
all cleanup logic to the base class.

Closes-Bug: 1975440
Change-Id: I718910a124780804ec8e14c2e99697025e4c4df0
2022-05-23 09:41:42 +00:00
Erik Olof Gunnar Andersson d8070bcf77 Fix tests failing due to sql tracing
Because of how sql tracing was implemented, the
order of operations was very important, this made
it difficult to run tests from an IDE. This patch
makes the tracing code safer so that it won't break
depending on how the code is executed.

Change-Id: Id4e82ba8f0abafb527dd811b190d2355f9fce71d
2022-05-22 21:14:48 -07:00
Erik Olof Gunnar Andersson 26c07ef261 Fix support for openstacksdk 0.99
We can no longer use flavor id from server_get and now
always use either flavor name or original_name as a
fallback.

Change-Id: I4e34fe4911abfb3c8ed59104ff67f6a1f27cda24
2022-05-22 15:33:33 -07:00
Zuul 66d1464197 Merge "Removed two previously unused config options" 2022-05-21 06:12:24 +00:00
Erik Olof Gunnar Andersson d2e6d5e940 Fixed incorrect sql in cluster_policy_get_all
The call cluster_policy_get_all did not properly
implement the and_ sqlalchemy method so it didn't
properly respect the contraint.

Change-Id: I71a9a6f4fbf5e6177ddad65709ea995728a89d6f
2022-05-18 22:09:22 -07:00
Erik Olof Gunnar Andersson 9e70dd30e8 Removed two previously unused config options
The following unused configuration options were removed.
- periodic_interval_max
- periodic_fuzzy_delay

Change-Id: Ifbd520a88156ec52a1f998b0b7fae4db27a3debb
2022-05-16 19:19:38 -07:00
Corey Bryant 39105af559 Switch to collections.abc abstract base classes
The standard library's collections abstract base classes have been
moved from the collections module to the collections.abc module. The
abstract data clases in the collections module have been deprecated
since Python 3.3 and are removed in Python 3.10.

Closes-Bug: #1954319
Change-Id: I27b3ddb38c677cce2966554d625791f02c0e11df
2021-12-09 14:16:24 -05:00
wangyu c0883a1f3b Use 'health check' as 2 words in log and error messages
Change-Id: I03a1984f9dcebce4c20f42c6507f03e98d100a93
2021-11-29 04:52:26 +00:00
wu.shiming 479e5ca8f9 Replace deprecated assertRaisesRegexp
The assertRaisesRegexp method has been deprecated since it was renamed
to assertRaisesRegex in Python 3.2 .

https: //docs.python.org/3/library/unittest.html#deprecated-aliases
Change-Id: I9b6e6283301dfb6d1874b81bb5f26db56568bd5a
2021-11-08 14:47:49 +08:00
wu.shiming 2216af7834 Replace deprecated inspect.getargspec
inspect.getargspec was deprecated since Python 3.0 and
inspect.getfullargspec is its replacement with correct handling of
function annotations and keyword-only parameters[1].

[1] https://docs.python.org/3/library/inspect.html#inspect.getargspec

Change-Id: I2411be23a83aef9550d58ead51b4caf2f8c5409f
2021-08-13 16:57:56 +08:00
hamza alqtaishat cd33c1256f senlin.policy.loadbalance module fix key error
the pool can be created without setting the var below
session_persistence[type|cookie_name]

Closes-Bug: 1934543

Change-Id: I08eecb2c45d2cb1f730e6b9d8bb549306b3a2f89
2021-07-02 22:30:52 +00:00
Hang Yang 5922e74a61 Fix LB creation failure with cluster name
Change Ibc0c6e7adc6cbdf87c1d1c5ec42f6954d6995253 has a bug for the
order of args which failed the lb creation with policy attach. This
change fixes the issue.

Change-Id: I38a0c768a16527d7f36f81f1e7ffddb8aa3b0146
2021-06-24 16:02:55 -05:00
Zuul ea7899758e Merge "add senlin cluster_name for lb/pool/listener name for creation" 2021-04-07 19:35:57 +00:00
Satish Patel 7404f76ae3 add senlin cluster_name for lb/pool/listener name for creation
We are passing senlin cluster_name to lb/pool/listener for name,
That way we have proper name relationship between all 3 components.
specially for troubleshooting when we have many loadbalancers.

Example:
$ openstack cluster list -c name -c status
+-----------+--------+
| name      | status |
+-----------+--------+
| mycluster | ACTIVE |
+-----------+--------+
$ openstack loadbalancer list -c name -c vip_address
+---------------------+-------------+
| name                | vip_address |
+---------------------+-------------+
| senlin-lb-mycluster | 10.69.1.173 |
+---------------------+-------------+
$ openstack loadbalancer pool list -c name -c provisioning_status
+-----------------------+---------------------+
| name                  | provisioning_status |
+-----------------------+---------------------+
| senlin-pool-mycluster | ACTIVE              |
+-----------------------+---------------------+


Change-Id: Ibc0c6e7adc6cbdf87c1d1c5ec42f6954d6995253
2021-04-07 16:25:34 +00:00
Satish Patel 755421a652 When session_persistence type NONE set option None
This patch is missing part of existing patch [1]. when type=NONE
set session_persistence to None.

[1] https://review.opendev.org/c/openstack/senlin/+/777855

Change-Id: I41fb34e3c0a72bda459517e656ddc4705f90d03b
2021-03-31 20:12:17 +00:00
Zuul 7ecb5b8819 Merge "Fix health policy attach/detach action when messaging.MessagingTimeout occurred" 2021-03-30 04:52:54 +00:00
Zuul 3753c52f24 Merge "Update error in install-rdo.rst and update default port" 2021-03-30 03:43:54 +00:00
Zuul fcd3c58527 Merge "Adding PERSISTENCE_TYPES option NONE" 2021-03-30 03:34:40 +00:00
Satish Patel e111000aab Fixed support of session_persistence for lbaas/octavia
This patch will fix broken support of session_persistence and
only add cookie_name when type is APP_COOKIE.

Change-Id: I32ad7840208bcc20091abcc1df68a7a707a7c4ac
2021-03-13 02:30:48 +00:00
Zuul 68c1b31768 Merge "Add placeholder for lowercase node names" 2021-03-08 07:14:08 +00:00
Duc Truong 7d6eebf5c3 Add placeholder for lowercase node names
Add placeholder 'r' in node.name.format cluster config option to use
only lowercase random letters for node name.

Change-Id: I49a90dc60649e01e6fead031b90f49fd29b2518e
2021-03-04 01:02:33 +00:00
Satish Patel b262314b75 Adding PERSISTENCE_TYPES option NONE
It will allow to define PERSISTENCE_TYPES = NONE for octavia LB

Change-Id: Id7c6c6e50c2b95751d1d87cbf41ce117bdfa3927
2021-02-27 21:01:48 +00:00
Zuul f99412750c Merge "[goal] Deprecate the JSON formatted policy file" 2021-01-14 16:40:26 +00:00
Zuul 95aa963209 Merge "Check if config param exists before using it" 2021-01-14 16:40:05 +00:00