Commit Graph

61660 Commits

Author SHA1 Message Date
Zuul 41773f8c65 Merge "Fix disable memballoon device" 2025-06-19 22:51:15 +00:00
Ghanshyam Mann 38f978d39a Add Project Manager role context in unit tests
As part of the this BP[1], we are going to add the
Project Manager role as default in API policies.

This commit adds the project manager role context
in the policies unit tests so that when we change
the policy default to project manager then we can
know how the changes/permission will looks like.

NOTE: This does not change any policy default, only
adding manager context in existing unit tests.

Partial implement blueprint policy-manager-role-default

[1] https://blueprints.launchpad.net/nova/+spec/policy-manager-role-default

Change-Id: Ib1622e7593108aa4fac65fcc34cb616502abed94
Signed-off-by: Ghanshyam Mann <gmaan@ghanshyammann.com>
2025-06-18 14:27:02 -07:00
Abhishek Kekane 4e6070085f Revert^2 "Support glance's new location API"
This reverts commit 221a3e89e8.

Reason for revert: Glance side issue fixed with below change
Depends-On: https://review.opendev.org/c/openstack/glance/+/950853

Change-Id: Ia84d5d8b53742492e7e271765feff27215fa39bc
2025-06-17 16:29:36 +00:00
Zuul 64ca204c9c Merge "api: Address issues with instance actions API" 2025-06-16 15:05:21 +00:00
Pierre Riteau 1efbbc8d5f Remove Unicode characters
Change-Id: I1b01b42efceb5430b3eda54531eb843c0c73ab68
2025-06-13 23:53:55 +02:00
Balazs Gibizer 2275b8545e Translate scatter-gather to futurist
This rewrites the core logic of scatter-gather to use
the futurist lib that provides a consistent API to use either Green
or native ThreadPoolExecutor. This way the scatter-gather code
can be made independent from the actual concurrency backend.

In this change we also create a separate executor for the scatter-gather
calls to better control it.

A new config option [default]cell_worker_thread_pool_size is added
to define the number of threads in this ThreadPoolExecutor. For the
GreenThreadPoolExecutor case this config is ignored as only real
threads are expensive, green threads doesn't.

As oslo.sevice use os.fork(), and fork copies the parent process state
to the children processes we need to make sure that the children
processes get a proper, fresh executor state, so we destroy the
executor just before the fork.

The fixtures.SynchronousThreadPoolExecutorFixture is deleted. It was
globally mocking futurist.GreenThreadPoolExecutor which would now
mocking more than what we want. There was only one usage of it in the
ComputeManager testing where it is replaced with a direct change of the
manager internal executor in the test setup to get the same, but
localized, result.

Note that testing the threading mode is done in nova-next job
in I36c68740fae3e3a9bd3286a1b66d86fd3341aff5, pool statistics
reporting will be added by Id4244f5ae0fd49c99af2898789cdd510859e150d,
and documentation about our threading tunables are in
I003177de3a9f69c71c19eb8eaa7232785e03e669.

Change-Id: Ibff6c73ad9af911a42204e53fee31ed5537c829d
2025-06-13 12:15:56 +02:00
Zuul d75507e679 Merge "api: Address issues with hypervisors APIs" 2025-06-12 14:16:30 +00:00
Zuul 07e573ab4f Merge "api: Add response body schemas for hypervisors APIs (3/3)" 2025-06-12 13:57:11 +00:00
Zuul 20ef126cdb Merge "Cache [pci]alias parsing" 2025-06-12 03:31:23 +00:00
Zuul 856d2ddca3 Merge "Validate [pci]alias at service startup" 2025-06-12 03:31:11 +00:00
Zuul 3e11280522 Merge "Validated that PCI alias has proper ids" 2025-06-12 03:28:54 +00:00
Zuul 45623879d9 Merge "Multiple spec per PCI alias limitation" 2025-06-12 03:28:17 +00:00
Zuul 03a828720f Merge "Return HTTP400 for multi spec pci alias if PCI in Placement" 2025-06-12 03:28:05 +00:00
Zuul c11f807ae7 Merge "reorder and extend pre-commit hooks" 2025-06-12 03:13:34 +00:00
Zuul d66a0e2220 Merge "Allow autopep8 to fix more things" 2025-06-12 03:13:22 +00:00
Zuul c127d87f02 Merge "Remove unused config options" 2025-06-11 22:43:02 +00:00
Zuul dc03416d7c Merge "Add functional reproducer for bug 2102038" 2025-06-11 14:32:34 +00:00
Balazs Gibizer 0065bb6cd4 Cache [pci]alias parsing
For each lifecycle operation nova re-load, parses, and validates the
[pci]alias config option. This is wasteful. So this patch adds
functools.cache decorator on the function used to do this work.

Change-Id: If2ffb25430749a22c923c0938221833e7b883873
2025-06-11 07:23:01 -07:00
Balazs Gibizer ae064caf16 Validate [pci]alias at service startup
Both nova-api and nova-compute depends on the [pci]alias configuration.
These services loaded and validated the config lazily when it was
needed. This can late and hard to troubleshoot failures during instance
lifecycle operations due to simple config errors.

So this patch adds an early load of this config to nova-api and
nova-compute.

Related-Bug: #2102038
Related-Bug: #2111440
Change-Id: I5d5dc912ca24979067984c7cb53ceaded7daf236
2025-06-11 07:23:01 -07:00
Balazs Gibizer acc6221660 Validated that PCI alias has proper ids
Either the vendor_id and product_id needs to be set or the
resource_class needs to be set in each alias. This is now validated when
the alias is parsed to avoid late failure during placement
allocation_candidates query.

Closes-Bug: #2111440
Change-Id: I7fd43b3d6faac8c4098b0983e8adc596414823a1
2025-06-11 07:23:01 -07:00
Balazs Gibizer c3f392dd8e Multiple spec per PCI alias limitation
Document and the limitation of the PCI in Placement feature that it
does not support [pci]alias configuration where the name of the alias is
repeated. E.g.

[pci]
alias = { "name": "vf1", "product_id":"10ca", "vendor_id":"8086", "device_type":"type-VF"}
alias = { "name": "vf1", "product_id":"f000", "vendor_id":"8086", "device_type":"type-VF"}

This would mean the alias vf1 can be fulfilled from devices with product
id 10ca OR f000. However this OR relationship cannot be encoded to a
single Placement allocation query as Placement does not support
requesting alternative resource classes for a request[2].

This limitation was encoded in the original PCI in Placement
implementation[1] but we missed to mention it in the doc.
This is now fixed.

[1]https://github.com/openstack/nova/blob/0d484ce37d86e989c8abdf57aec5e334f68206ef/nova/objects/request_spec.py#L504-L528
[2]https://docs.openstack.org/api-ref/placement/#list-allocation-candidates

Related-Bug: #2102038
Change-Id: I9dd78b1498f870a4e4c3f26c23d42d105aec0350
2025-06-11 07:23:00 -07:00
Balazs Gibizer 0bfac5c7fe Return HTTP400 for multi spec pci alias if PCI in Placement
PCI in Placement never supported PCI aliases with multiple specs, i.e.
when an alias name is used in multiple alias definitions. The code
raised ValueError late and without a proper error message. Now
PciInvalidAlias with a descriptive message is raised instead.

Closes-Bug: #2102038
Change-Id: Id1407a37dc5ddad22d8dbf7d589ed998ffc2804e
2025-06-11 07:22:05 -07:00
Stephen Finucane a0af4648b5 api: Address issues with hypervisors APIs
* Address an off-by-one error: the cpu_info field was modified in v2.28,
  not v2.27,
* Correct the api-ref to indicate that the 'servers' field is not
  actually required and will be missing if '?with_servers=false', while
  the 'name' and 'uuid' fields of servers entries *are* required.
* Clarify a comment about the above in the schemas.
* Uncouple the '_hypervisor_response' and '_hypervisor_detail_response'
  helper schemas. The minor increase in lines of code is worth it for
  the decrease in complexity.
* Add the 'host_ip', 'hypervisor_type', and 'hypervisor_version' fields
  to the list of required fields for "detail"-style responses (show and
  detailed list).
* Make the 'current_workload', 'disk_available_least', 'free_disk_gb',
  'free_ram_mb', 'host_ip' and 'running_vms' fields of the hypervisor
  "detail"-style responses nullable, and the 'current_workload',
  'disk_available_least', 'free_disk_gb', 'free_ram_mb' and
  'running_vms' fields of the deprecated statistics API nullable.

Change-Id: Ibe55b44e65fe17141c63cceae8a003816ffe4f23
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-06-11 13:07:54 +01:00
Sean Mooney cd401c5c1b libvirt: Enable autodeflate and freePageReporting for memballoon
The libvirt driver now automatically enables autodeflate and
freePageReporting attributes for virtio memory balloon devices.
The autodeflate feature allows the QEMU virtio memory balloon
to release memory before the Out of Memory killer activates.
The freePageReporting feature enables returning unused pages
back to the hypervisor for use by other guests or processes,
improving overall memory efficiency on compute hosts.

These features are always enabled when a memballoon device is
configured, requiring no additional configuration from operators.

implements: blueprint automatic-memballoon-freeing
Generated-By: claude-code
Change-Id: If47a6d38cd311b08b78acffb307a99a7a2a080a1
Signed-off-by: Sean Mooney <work@seanmooney.info>
2025-06-11 11:13:11 +00:00
Stephen Finucane 3b08d60dc4 api: Address issues with server diagnostics APIs
Add some missing additionalProperties=False entries.

Change-Id: I4477dcb590392c189a2bd586ecd9ba4ccd35d89e
2025-06-11 10:17:10 +01:00
Zuul 2270c4ac94 Merge "api: Add response body schemas for hypervisors APIs (2/3)" 2025-06-11 08:17:05 +00:00
Zuul 3999899f75 Merge "api: Add response body schemas for hypervisors APIs (1/3)" 2025-06-11 03:36:38 +00:00
Zuul 03edd00bfe Merge "api: Add response body schemas for instance actions" 2025-06-10 22:47:33 +00:00
Zuul c2e5f8c4c7 Merge "api: Add response body schemas for hosts APIs" 2025-06-10 22:39:21 +00:00
Stephen Finucane 33cf8fef38 api: Address issues with keypairs APIs
Change-Id: I84ea28fc3ee255dea207e373c7064e3231e777f7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-06-10 17:28:47 +01:00
Zuul 517415b6cb Merge "update pre-commit version pins" 2025-06-10 16:23:41 +00:00
Stephen Finucane 72a66cbb9e db: Resolve alembic deprecation warning
Resolve the following deprecation warning:

  DeprecationWarning: No path_separator found in configuration; falling
  back to legacy splitting on spaces, commas, and colons for
  prepend_sys_path.  Consider adding path_separator=os to Alembic
  config.

We don't have multiple paths so this is otherwise a no-op.

Change-Id: I5cef2bedccd3cb3d844c3c8e0516050a56c18d58
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-06-10 15:28:31 +01:00
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
Arnaud Morin c4c5134369 Fix small documentation issue
Small documentation fix

Change-Id: Ibb650cf428eb9c20be1fdd0a4caee15fa6d309b7
Signed-off-by: Arnaud Morin <arnaud.morin@ovhcloud.com>
2025-06-09 18:14:43 +02:00
Zuul 21943b5521 Merge "doc: Add missing API samples" 2025-06-08 23:14:07 +00:00
Zuul 9d389f5ffe Merge "tests: Ensure all APIs have a response body schema" 2025-06-08 22:51:30 +00:00
Zuul eea33f9dad Merge "api: Simplify parameter types" 2025-06-08 16:38:34 +00:00
Zuul b82443eed3 Merge "api: Only run format checks on strings" 2025-06-07 16:20:51 +00:00
Zuul f1eaf682fe Merge "api: Add new, simpler api_version decorator" 2025-06-07 07:14:40 +00:00
Zuul a2b9dc1b4e Merge "api: Only check minimum API version" 2025-06-07 02:53:03 +00:00
Zuul ff281bbe34 Merge "api: Stop using wsgi.Controller.api_version to switch between API versions" 2025-06-06 20:17:56 +00:00
Zuul 38d06f41a9 Merge "[tool] Fix backport validator for non-SLURP" 2025-06-06 15:58:08 +00:00
Balazs Gibizer b3aefbcb58 Remove unused config options
In c12eebd4c6 we missed that there are
another set of config option that become unused now. So this is a follow
up patch to remove those as well.

Change-Id: Ie00805b5f72b118db134aeb8399ef4c72f434966
2025-06-06 13:31:00 +02:00
Zuul 68c2341b76 Merge "doc: Fix Caracal release number" 2025-06-05 20:14:46 +00:00
Pierre Riteau 6ba5168da8 doc: Fix Caracal release number
Change-Id: Id942d65c657bf537b7953e344aa31b747f78fec6
2025-06-05 17:45:14 +01:00
Dan Smith 93af6dce29 Remove contrib/clean-on-delete.py
This removes the script from our contrib directory now that it is
moved to https://opendev.org/openstack/nova-contrib

Change-Id: I09c3b3e73f8b6bcb4223bed20c456bb582b55bcd
2025-06-04 10:45:55 -07:00
Balazs Gibizer a1c47fc242 [doc]Clarify where to set pci_in_placement
The doc is now clarifying that [filter_scheduler]pci_in_placement needs
to be set to nova-api, nova-scheduler, and nova-conductor config as
well.

Closes-Bug: #2112303
Change-Id: I3c7be2f109a97ef5cc4b2dc76cb7c58ef8c68afa
2025-06-02 11:12:14 +02:00
Dmitriy Chubinidze 6621832635 doc: Adding link for RabbitMQ installation during nova deployment on controller node.
Change-Id: I46456cf88c60b565196c41a98743f0c4c4e40999
Closes-Bug: #2091585
2025-05-31 14:40:42 +00:00
Zuul 6a1c2bbcd8 Merge "api: Adjust validation helpers for a single-method future" 2025-05-29 23:52:58 +00:00
Zuul 3a9ec3b45a Merge "libvirt: Use common naming convention for ephemeral disk labels" 2025-05-29 21:13:08 +00:00