Commit Graph

61376 Commits

Author SHA1 Message Date
Stephen Finucane f09904f62d api: Address issues with instance actions API
The user_id and project_id fields can be null. Explain why.

Change-Id: I34353ec7e55845a83f5e2f1dc4b41dead4ac5c81
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-06-10 11:50:50 +01:00
Stephen Finucane 2ca03367ad api: Add response body schemas for instance actions
Change-Id: Ie94af006d916456cba6f4e8ee9f9df385f6a1709
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-13 12:04:50 +01:00
Stephen Finucane f7a03e5834 api: Add response body schemas for hosts APIs
Change-Id: I9b045e9d8d344f2cd8caf7fcbd45f0d8b610da04
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-13 12:04:50 +01:00
Stephen Finucane 4520a058c8 doc: Add missing API samples
These have been introduced at some point and now appear when running the
API samples test with GENERATE_SAMPLES=True. Add them.

Change-Id: Ic4b6b685f17e8d411776e20f239daa0736ae9a0b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-13 12:04:50 +01:00
Stephen Finucane 02a6c48b38 tests: Ensure all APIs have a response body schema
Well, in a manner of speaking :) We add a new decorator to highlight the
resources that we have fully annotated. This will prevent regressions
and give us a quick sentinel for identifying resources that have been
updated.

Change-Id: Ic2cf231a01b0f053faf40409ae047c8bf9990fd2
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-13 12:04:50 +01:00
Stephen Finucane baf310ac28 api: Simplify parameter types
Remove the use of a custom format for keypair names, in favour of a
simple regex. Also remove the unused 'none' variable and generally fix
some formatting.

Change-Id: I66d0bf873dc26c8bcc4c3cdbc85575e4ebd9a1be
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-13 12:04:50 +01:00
Stephen Finucane 678bc4ae6e api: Only run format checks on strings
Per the JSON Schema spec, format checks only apply to strings. For
example, if we have a schema like so:

  {type: [string, null], format: date-time}

Then we expect either a date-time string or null, not a date-time string
or (impossible) date-time null. Make this so, cleaning up and extending
the tests in the process.

Change-Id: I755e69f78aed0cd4074204a0559f557998a34e29
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-13 12:04:50 +01:00
Stephen Finucane 08dd30d3fc api: Add new, simpler api_version decorator
Get rid of the whole API version switching madness and make our schema
generation _significantly_ simpler.

This looks a lot larger than it actually is. In most cases, this is
simply 's/wsgi.Controller.api_version/wsgi.api_version/'.

Change-Id: I180bfad84c38653709c216282099d9b3fb64c5a7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-13 12:04:50 +01:00
Stephen Finucane a722640b2f api: Only check minimum API version
As noted in [1], we were passing arguments to the 'is_supported'
function inconsistently. Given we only have four easily converted users
of the 'max_version' argument, we can simplify the calls by only passing
a *minimum* API version and negating there where necessary. This is good
enough for our use cases.

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

Change-Id: I71a95b8b4b6b59485273f136f255811b6d57b657
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-13 12:04:49 +01:00
Stephen Finucane d73a0861f8 api: Stop using wsgi.Controller.api_version to switch between API versions
This obscures the purpose of the APIs and makes the code harder to read.
It also does not play nice with our schema checks by creating multiple
potential functions to check. We're already being pretty inconsistent in
how we do versioning like this so simply standardise on another
approach, namely checking in the function.

Note that there are docs that need updating here, but we're leaving that
to a separate PR that will also remove this method in favour of a new,
much simpler method.

Change-Id: Ia5e4c6cadb6c88ccdf7e89566573f1f89087fbe5
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-13 12:03:33 +01:00
Stephen Finucane 89977c3661 api: Adjust validation helpers for a single-method future
Since we will soon no longer be able to rely on
wsgi.Controller.api_version to version our methods for us, we need to do
versioning in the various schema decorators slightly differently.

Change-Id: I1808ebc7c42828bafb7d079b59bbbd0bc4424f22
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-13 12:03:33 +01:00
Stephen Finucane 023be4f561 wsgi: Don't create, use lock in same line
As noted on the mailing list some time back [1], pylint flags this as a
useless lock [2]. Make it non-useless.

[1] https://lists.openstack.org/archives/list/openstack-discuss@lists.openstack.org/message/CZVC6SEMUSEH7UT5LDHOWL7WBZ2OXUWZ/
[2] https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/useless-with-lock.html

Change-Id: If8243cc62c3dd9cd5f5b0d664981975efc6300cc
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-08 12:38:28 +01:00
Zuul a106f25e8e Merge "[quota]Refactor group counting to scatter-gather" 2025-05-06 22:40:35 +00:00
Balazs Gibizer 7f4c47c642 [quota]Refactor group counting to scatter-gather
The legacy server group member counting logic fits well to use the
existing scatter-gather logic instead of rolling its own thread
handling.

This replaces a direct eventlet dependency with an indirect, shared one,
in the scatter-gather therefore making the eventlet removal work easier

Change-Id: I6d1b5f9654df2a93bd3722a5813d5ad3a7d1c94a
2025-05-05 16:06:20 +02:00
Balazs Gibizer a5bcaf69b1 Remove python 3.9 support
OpenStack recently dropped python3.9 support for global requirements[1]
as it was removed from the Flamingo supported runtimes[2].

So this patch removes 3.9 support from nova too.

[1]https://review.opendev.org/c/openstack/requirements/+/948285
[2]https://governance.openstack.org/tc/reference/runtimes/2025.2.html#python

Change-Id: I8aea971d7972959c32d5175926cbaddb21839f8e
2025-04-29 09:32:24 +02:00
Zuul 3e7017eb29 Merge "Replace eventlet sleep with time.sleep" 2025-04-28 10:17:55 +00:00
Zuul 2b06c9c6c2 Merge "Remove workaround for ovn live migration" 2025-04-25 19:41:40 +00:00
Zuul 00b2a1c861 Merge "Remove superfluous monkey patching form func test" 2025-04-25 19:21:57 +00:00
Zuul 4085069c23 Merge "split monkey_patching form import" 2025-04-25 19:21:45 +00:00
Zuul f3e206c08a Merge "Remove nova debugger functionality" 2025-04-25 19:21:34 +00:00
Zuul dd784f7327 Merge "FUP improve and add integration tests for PCI SR-IOV servers" 2025-04-25 15:10:27 +00:00
Balazs Gibizer ac765008c9 Remove superfluous monkey patching form func test
We have 4 ways to enter nova code and got monkey patched:

* nova.cmd - used by all of our CLI commands and non WSGI services
* nova.api.openstack - used by our WSGI services
* nova.test - used by our unit test environment to run nova services in GreenThreads.
* nova.tests.functional - used by our functional test environment to run nova services in GreenThreads.

The latter is unnecessary as all our functional test uses the nova.test
module so it automatically got monkey patches by that. So this patch
removing the monkey patching from nova.tests.functional. I don't see any
test runtime increase locally after the change so I don't think the
tests start to run more serially due to some missed monkey patch.

Change-Id: I4731dab89e2c1f1707d322c575ab0780bff80535
2025-04-25 14:37:46 +02:00
Sean Mooney 659710a626 split monkey_patching form import
This change separates the evetlet monkey patching
from importing the module and add a module level
constant to track if we have already monkey patched.

Change-Id: Ic4ab0ba7a8320a008d6e246641446446dcc9ccc0
2025-04-25 14:37:46 +02:00
Sean Mooney 02d72b9d56 Remove nova debugger functionality
The nova debuger functionality was intended
to help debugging running process however it has
never been reliable due to our use of eventlet and is generally
not required when not using eventlet. I.e. you can just
run the nova console-scripts form a debugger or add pdb
statements as required.

As part of the eventlet removal the debugger functionality is
removed given its untested and undocumented.

Change-Id: I7bf88f06f3d1dbd2c7e342b27a21440a123c631d
2025-04-25 14:37:44 +02:00
Zuul 12b32198ca Merge "Remove WSGIServer related config options" 2025-04-25 11:14:19 +00:00
Zuul f1e843af0d Merge "[doc]Describe file based GMR triggering" 2025-04-25 10:57:52 +00:00
Zuul 2fa61a0ad2 Merge "[doc]Remove eventlet based API endpoints" 2025-04-25 10:57:41 +00:00
Zuul c5eac85b05 Merge "Support glance's new location API" 2025-04-24 19:56:33 +00:00
Kamil Sambor 3946a94538 Replace eventlet sleep with time.sleep
As part of the Eventlet removal, this patch replaces eventlet.sleep
with the equivalent time.sleep, which should work the same
with Python threads

Change-Id: I31b1aa854d8c95e47ba476051a650937b739a52b
2025-04-24 14:09:19 +02:00
Zuul 2762a73c5b Merge "Use dict object for request_specs_dict in the _list_view" 2025-04-23 23:16:46 +00:00
Zuul 6dcc4cc279 Merge "Functional tests for one-time-use devices" 2025-04-23 16:01:07 +00:00
Zuul 09e8f6e47a Merge "Fix description of [pci] alias" 2025-04-22 22:28:43 +00:00
Zuul 6ee2ce48b8 Merge "Remove WSGIService and WSGIServer classes" 2025-04-22 17:38:04 +00:00
Zuul cd3b5371a6 Merge "Remove eventlet based WSGI server entry points" 2025-04-22 17:22:17 +00:00
Dan Smith eab0de2900 Support glance's new location API
This makes us use the new method if available, and if not, fall back
to the old method.

Change-Id: If52ac05a02b69476bd2cfa74a7ee800c3f6eeb20
2025-04-21 07:09:58 -07:00
Balazs Gibizer c12eebd4c6 Remove WSGIServer related config options
As [1] removed the possibility to use the Eventlet based API servers
this patch can clean up the configuration options from the [wsgi]
section that are only used by that code path.

The remaining two options [wsgi]api_paste_config and
[wsgi]secure_proxy_ssl_header are still in use by the WSGI application
code path.

[1]I79b725f3b3569e9c1460a93ac40ca92269e7d003

Change-Id: Ia113daabab399e8db8edb1a2402ccae6fca351d5
2025-04-17 16:45:06 +02:00
Balazs Gibizer 05bab98aba [doc]Describe file based GMR triggering
We learned during recent installer development that triggering
GMR with apache/mod_wsgi API services via signals is hard due
to multiple reasons. We ended up using file based triggers instead of
signals. This patch document this approach.

Change-Id: I1fdbe6314ce4a1b173d01d3ebd9db07a0beb25a2
2025-04-17 16:27:46 +02:00
Balazs Gibizer e25418c857 [doc]Remove eventlet based API endpoints
The previous patch[1] removed the entry points. As there is sizable
amount of doc change needed to remove all the references from the doc
to the removed entry points a separate patch, this, is created to do so.

[1] Ie758550c0b8fb02aeb398396961467d9f845fcc9

Change-Id: Ibe8e45e86912e747f07e5fabd5b1204341c1e606
2025-04-17 16:24:16 +02:00
Balazs Gibizer 51eb60063f Remove WSGIService and WSGIServer classes
The previous patch[1] removed the Eventlet based WSGI entry points, and
that code was the only real user of the in tree WSGIService and
WSGIServer classes, we can remove those too. This removes a good chunk
of eventlet dependency from our tree.

There is a catch though. The functional test env used these to start the
nova-metadata-api service. We re-implemented the fixture to use
load the wsgi app and use the wsgi intercept instead. This also showed
that while the Eventlet based API service could be reset via the
oslo.service interface the wsgi APP based API service cannot. So the
related cell caches reset testing is removed.

[1] Ie758550c0b8fb02aeb398396961467d9f845fcc9

Change-Id: I79b725f3b3569e9c1460a93ac40ca92269e7d003
2025-04-17 15:29:59 +02:00
Zuul 33f859cab7 Merge "doc: Remove non-existent [service_user] auth_strategy" 2025-04-17 11:49:22 +00:00
Zuul 16a5923a55 Merge "doc: Drop deprecated [api] auth_strategy" 2025-04-17 11:49:14 +00:00
Balazs Gibizer 05b219746f Remove eventlet based WSGI server entry points
Nova deprecated[1] running the API services under Eventlet in the Rocky
release 6 years ago. Now that we are trying to transition away from
Eventlet it is time to rip out these entry points fully.

[1] b53d81b03c

Change-Id: Ie758550c0b8fb02aeb398396961467d9f845fcc9
2025-04-15 15:03:43 +02:00
Sean Mooney 691d47e936 Remove workaround for ovn live migration
This change removes the concept of plug time vs
bind time live migrations events.

In past releases Id2d8d72d30075200d2b07b847c4e5568599b0d3b
and I51673e58fc8d5f051df911630f6d7a928d123a5b
added workarounds to nova to enable live migration with
the ovn backend. Over the past 5 years a lot of work has
been done in ovn and neutron to support multiple port
bindings and propagage that information to the ovn
db. As a result the workaround in nova are nolonger
required.

Related-Bug: #2073254
Change-Id: Ic3e9c93681d11d5ab988d6990e9b8d480da887d4
2025-04-14 15:09:47 +01:00
Zuul 1ad11b1388 Merge "Remove tags from README" 2025-04-10 13:44:07 +00:00
Zuul 6e37eeaeb3 Merge "Add one-time-use devices docs and reno" 2025-04-08 01:50:31 +00:00
Zuul 69b148e0c5 Merge "Support "one-time-use" PCI devices" 2025-04-08 00:21:25 +00:00
Zuul ba44202dcb Merge "Invalidate PCI-in-placement cached RPs during claim" 2025-04-07 19:58:10 +00:00
Zuul 46736446ab Merge "Extend invalidate_rp to only invalidate cache" 2025-04-07 17:22:59 +00:00
Masahito Muroi 509820f156 Use dict object for request_specs_dict in the _list_view
The request_specs_dict in the _list_view is initialized as a
defaultdict object in order to return empty string as default.
But the request_spec_dict is replaced with a normal dict object in
the v2.96 microversion, then if server list and RequestSpec missmatch
happens by any reason, the List Server API and the List
Server Detail API hit 500 Internal server error because of key error.

This commit updates the req_spec_dict to use normal dict object, then
it returns sentinel object if there is no appropriate
request_spec object.

Closes-Bug: #2095364
Change-Id: If282b8709954f276cb5d48114437809d771a9958
2025-04-04 17:06:25 +09:00
Dan Smith ee67362728 Functional tests for one-time-use devices
Related to blueprint one-time-use-devices

Change-Id: I6f764666a44c74c5ac97dced568fc685dee013b6
2025-04-02 11:53:54 -07:00