Commit Graph

61879 Commits

Author SHA1 Message Date
Zuul 99a2835bd2 Merge "api: Add response body schemas for quota class sets API" 2026-01-24 07:28:38 +00:00
Zuul 63c68c9542 Merge "TPM: support instances with deployment secret security" 2026-01-23 22:30:44 +00:00
Zuul 5ac48468ac Merge "Refactor service user authentication" 2026-01-23 22:30:30 +00:00
Zuul 7579dbdf0e Merge "Use *_OR_ADMIN policy defaults for server shares" 2026-01-23 05:00:53 +00:00
Zuul 8fe5d3ce75 Merge "Faults from cell DB missing in GET /servers/detail" 2026-01-23 05:00:40 +00:00
Zuul 7a77815204 Merge "Replace obsolete PCRE packages" 2026-01-23 05:00:28 +00:00
Artom Lifshitz 880019baaf TPM: support instances with deployment secret security
This means authenticating as the Nova service user to Barbican,
so that the latter can make the secret owned by Nova. This requires
the [service_user] config section to be set.

An API block is also added to prevent resizes to change to or from
the ``deployment`` TPM secret security mode. This is because doing so
would require conversion of secret ownership to or from the user to the
Nova service user. The change is complicated and will be implemented
as a separate patch later in the series.

Resizing from ``deployment`` TPM secret security mode to ``deployment``
TPM secret security mode is allowed.

Related to blueprint vtpm-live-migration

Change-Id: I007f9993451d9197f53dee9a5fd29daa307ebe6b
Signed-off-by: melanie witt <melwittt@gmail.com>
2026-01-22 15:29:15 -08:00
Balazs Gibizer a9b8c4aee1 Prevent leaking RPC poller thread between tests
When a unit test create a nova.service.Service() and calls start() on
it, nova starts an RPC server with the fake oslo_messaging
implementation. That implementation uses a thread / greenthread to poll
for messages. If the RPC server is not stopped directly or via
Service.stop() at the end of the test case then that poller thread is
remains running during any subsequent test. This can cause interference
between test case.

This patch adds a fixture that tracks the started poller threads and
fail the test case if the poller is still active at the end of the test
case. As a consequence a set of test cases needed fixes to remove the
leak.

Change-Id: I92dc4ad09c77fd0a9e0bb263d355d9b0204be790
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2026-01-22 10:05:16 +01:00
melanie witt 66bb1e77f2 Refactor service user authentication
Currently we have very similar service user authentication code
partially duplicated in the following areas:

  * nova/image/glance.py
  * nova/network/neutron.py
  * nova/volume/cinder.py
  * nova/api/metadata/vendordata_dynamic.py

This attempts to commonize and reuse code as much as possible from the
service_auth module in preparation of vTPM live migration patches.

Change-Id: I3a5c00e434eb6ce7956a717dffd11f38f19c5f7d
Signed-off-by: melanie witt <melwittt@gmail.com>
2026-01-21 20:45:11 -08:00
Zuul 637f66f677 Merge "blueprint: iothreads-for-instances" 2026-01-21 21:57:59 +00:00
Stephen Finucane 2b7b271324 Bump hacking
We also bump the other linters, although these don't change anything.

Change-Id: I07ddb8743804172a4e81a70b1ee4aa897e48dfca
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2026-01-21 10:56:13 +00:00
Stephen Finucane e785ab52dc typing: Replace objects from typing with literals
We also replace the use of typing.Union and add missing parameters and
returns types for Callable types.

Change-Id: I75ed4d1cc4d84515910a5bd315f8626135258148
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2026-01-21 10:55:57 +00:00
Stephen Finucane c870873f7f typing: "Import" objects
mypy doesn't know that we dynamically register these: give it a helping
hand.

Change-Id: I73321f67766b67e00038fd8de744f95128c3e6cb
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2026-01-20 18:03:29 +00:00
Stephen Finucane dc31f9fd61 Run mypy from tox
This avoids the need to duplicate our dependency list in multiple places
and allows us to take advantage of tox's dependency management
infrastructure, to ensure we always get the latest and greatest version
of a package allowed by upper-constraints. It also removes the slowest
pre-commit hook (by some distance), making pre-commit faster.

Change-Id: Ie241768231f180d5a672bf9f8fdc6a1eb8d7dfdb
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2026-01-20 18:03:04 +00:00
Takashi Kajinami b1a50e67a1 Replace obsolete PCRE packages
pcre3 was removed from recent debian-based releases (eg. Trixie[1]),
while RHEL10/CentOS Stream 10 no longer ships pcre in favor of pcre2.

Use the latest whereto library release (0.5.0) which uses pcre2
instead.

[1] https://lists.debian.org/debian-devel/2021/11/msg00176.html

Depends-on: https://review.opendev.org/c/openstack/requirements/+/971428
Change-Id: I5ae44fa16128bb8dc9817a2bf2c8e349db75156b
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
2026-01-20 23:14:18 +09:00
elajkat 76d64b9cb4 blueprint: iothreads-for-instances
Enable one io-thread per qemu instance.

Related-Bug: iothreads-for-instances
Change-Id: I8b22e5bca560d111934fbdf67494a4e288b9e50a
Signed-off-by: lajoskatona <lajos.katona@est.tech>
2026-01-19 16:17:47 +01:00
Zuul 66bad0b1d9 Merge "mem-enc: create generic check for mem encryption support by host" 2026-01-19 11:23:26 +00:00
Zuul deee6867e9 Merge "libvirt: Remove import hacks" 2026-01-19 11:12:53 +00:00
Zuul 68cec593a7 Merge "Compute manager to use thread pools selectively" 2026-01-16 21:03:28 +00:00
Balazs Gibizer 3c23390cc8 Compute manager to use thread pools selectively
This changes the thread pool usage of the ComputeManager to go through
the concurrency mode aware util functions.

The concurrent live migration pool had a seemingly unlimited option
when configured with value 0, but in reality GreenThreadPool has a
default worker size of 1000. In reality it is almost never right to
have more than one live migration running concurrently. Also with
native threading having 1000 worker is just too costly. So we
decided to deprecate the value 0 and changed the implementation of
unlimited to mean 5 threads in native threading mode. We kept the 1000
greenthread in eventlet mode for backward compatibility.

The _sync_power_states periodic task also spawn tasks for each instance
to be synced. As it uses a shared data structure across these tasks
and the caller a lock is needed to avoid race conditions.
Also the default pool size is 1000 for these tasks in our configuration.
That would use a lot of memory on a busy host in native threading mode.
So we changed the default value from 1000 to 5.

Change-Id: I9567d5fabdf086b5d0493103d9f6bde4f66af387
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2026-01-16 09:47:42 +01:00
Zuul f43c64c56c Merge "Migrate upper functional job to Python 3.13" 2026-01-15 20:10:58 +00:00
Zuul 48cb769856 Merge "api: Add response body schemas for limits API" 2026-01-15 05:31:12 +00:00
Zuul 80753c5745 Merge "Upgrade note for concurrency mode default change" 2026-01-14 21:23:21 +00:00
Zuul d16689b775 Merge "[ironic] Use constants from Ironic, test w/ddt" 2026-01-14 12:57:27 +00:00
Balazs Gibizer f73a23b4d4 Upgrade note for concurrency mode default change
This is a follow up for the release notes added in the commit
35207ee8b5 that changed the default mode
for the scheduler and the API services. At that time we missed to note
the upgrade impact of such change. So this patch extends the reno with
an upgrade note.

Change-Id: I280e7eb9c1da6eeaf50e96e8b19e296961f2651a
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2026-01-14 13:29:07 +01:00
Zuul 72d37f87a0 Merge "Do not fork compute workers in native threading mode" 2026-01-14 05:23:27 +00:00
Zuul 27d4d84eb1 Merge "libvirt: Ensure device alias is present" 2026-01-09 16:38:31 +00:00
Zuul a906f39ec8 Merge "trivial: Use functools.wraps" 2026-01-09 16:11:06 +00:00
Zuul 4b90fdf9af Merge "Replace remaining reference to policy.json" 2026-01-06 14:15:23 +00:00
Zuul 88c538a897 Merge "libvirt: Skip unsupported firmware types" 2026-01-06 12:01:12 +00:00
Zuul db97e3bb50 Merge "Replace removed os-vif-ovs job" 2026-01-06 06:39:06 +00:00
Takashi Kajinami ad911932ff Replace removed os-vif-ovs job
It was replaced by os-vif-ovn job.

Depends-on: https://review.opendev.org/c/openstack/os-vif/+/798038
Change-Id: I4fc595eb51c05c4875bc94e0e812f117a35df7cf
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
2026-01-05 21:20:18 +09:00
Zuul 3f224ae303 Merge "[test]Further categorization of disabled unit tests" 2026-01-05 05:00:34 +00:00
Zuul 41c4c9124e Merge "Fix ProviderTree copying with threading Lock" 2026-01-03 02:00:25 +00:00
Thomas Goirand 21b365b140 Python 3.14: fix assertRaises
Python 3.14 tightened call semantics, and testtools 2.8.2 no longer
tolerates unittest-style kwargs, when Nova tests were mixing
testtools.TestCase with unittest. This patch fixes this by using
positional arguments for assertRaises.

Signed-off-by: Thomas Goirand <zigo@debian.org>
Change-Id: Ic589880d4759336ab6ceec5057eafe223f692caa
2025-12-29 11:33:03 +01:00
Balazs Gibizer 0498e2ad76 Do not fork compute workers in native threading mode
Force running the Compute Service within the main Process with native
threading to keep the baseline behavior.

In eventlet mode with workers=1 or workers=None it is oslo.service's
default behavior[1]. But with native threading we need to explicitly
pass no_fork=True to oslo to get this behavior instead of forking a
single worker [2].

Forking a single worker for compute would also be problematic as compute
initializes the conductor RPC client before such fork and the rabbitmq
oslo.messaging driver does not support forking with a connected client
[3].

Patch bumps the minimum oslo.service version to 4.4.1 to pick up the fix
https://review.opendev.org/c/openstack/oslo.service/+/966458 nova now
depends on.

[1] https://github.com/openstack/oslo.service/blob/37b90521ea01baa0c8e6412453c42972a28e3b12/oslo_service/backend/_eventlet/service.py#L749C1-L753
[2] https://github.com/openstack/oslo.service/blob/37b90521ea01baa0c8e6412453c42972a28e3b12/oslo_service/backend/_threading/service.py#L296-L300
[3] https://docs.openstack.org/oslo.messaging/latest/reference/transport.html#forking-processes-and-oslo-messaging-transport-objects

Change-Id: If6daffc25d737f53b1a478d42fd85a0446b09e6d
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-12-24 01:37:02 +00:00
Balazs Gibizer d6d87696b9 [test]Further categorization of disabled unit tests
Change-Id: Ic7d394db1bd284b6ed058c8a451236432df96006
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-12-24 01:37:02 +00:00
Balazs Gibizer e3203ce4d1 Fix ProviderTree copying with threading Lock
The threading Lock object cannot be copied so the ProviderTree cannot be
deep copied in threading mode. This patch adds custom pickling /
copying handlers to the ProviderTree class to ignore the lock from the
source and readd it in the destination object during pickling /
copying.

Note that ProviderTree uses a named lock which means all the instance of
the ProviderTree object in the same process uses a shared lock object.
The copy handlers ensures the same behavior during copying so the copy
will use the same shared lock as well.

Signed-off-by: Balazs Gibizer <gibi@redhat.com>
Change-Id: I084e72ce81dd456d67c9046f37d1ccb01b9fa4ba
2025-12-24 01:37:02 +00:00
Stephen Finucane 19f1119b6d libvirt: Remove import hacks
This has been on the TODO list for over 8 years. Time to resolve it.

Change-Id: Ic5367a1042ae5da974a25c135b58a1ebf22eb531
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-12-19 18:31:40 +00:00
Zuul 4b71dab239 Merge "Remove tpool_execute as it is unused" 2025-12-18 22:39:50 +00:00
Stephen Finucane aec74c1f23 libvirt: Ensure device alias is present
Our event listener depends on devices having an alias set. We add an
early assertion to prove this is the case. In real-life, this will
always be the case since the devices we can detach - like interfaces and
disks - are among the lists of devices that libvirt will automatically
generate an alias for if the user (nova-compute, in this case) doesn't
provide their own [1]. However, many of our tests were not doing this so
we must update our LibvirtFixture in particular to start doing so.

[1] https://github.com/libvirt/libvirt/blob/v11.10.0/src/qemu/qemu_alias.c#L692-L786

Change-Id: Id98d8029af673ffa89d6472be98f90a6f0975511
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-12-18 17:49:45 +00:00
Stephen Finucane c7d37ee3ce trivial: Use functools.wraps
Rather than setting dunder attributes manually.

Change-Id: I71bf90f5deacb11cbf6e39dfe459edd5a03f3d75
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-12-18 16:11:16 +00:00
Balazs Gibizer 081130d329 Do not mock threading.Event.wait
There were libvirt disk attach / detach unit test cases that mocked
threading.Event.wait to speed up the test execution as the libvirt event
based device detach has a 20 seconds timeout.

However this mock is very wide. It effects all the threading.Event usage
during the test case. As we are switched to the native threaded backed
of oslo.service we got an LoopingCall implementation that relies on
threading.Event to signal when the call is finished. In these test cases
the wide mock broke this logic and the LoopingCall signalled "done" while
the actual call in the background was still running making that call
leaking out from the test case and therefore under the fixtures the test
case tore down after the test case finished. This caused that later the
call hit non mocked code paths like importing the real libvirt lib
instead of using our libvirt fixture causing late failures.

The fix is to remove the wide mock and instead change the detach timeout
in these test cases.

Later follow ups will check put protection in place to avoid
re-introducing this wide mock.

Closes-Bug: #2136815
Change-Id: I3f40d9dad6ef87e6fa4db0ea4065a77421e8c271
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-12-18 16:33:09 +01:00
Zuul 3e5a2dbad7 Merge "Follow up test change for 8c8047ce2afae" 2025-12-17 15:10:42 +00:00
Ivaylo Mitev fb661ec597 Faults from cell DB missing in GET /servers/detail
Field  is empty in the response of API GET /servers/detail if the
instance (hence instace_faults DB entry) is in nova cell DB.
Unlike that, for API /servers/:id fault is retrieved correctly no matter
in which nova cell the instance belongs.

Closes-Bug: #1856329
Change-Id: I1726f53cfeac0a67a5dacdddda2af2cc1db0af0f
Signed-off-by: Marius Leustean <marius.leustean@sap.com>
2025-12-17 11:51:38 +02:00
Taketani Ryo 2035afbb5e mem-enc: create generic check for mem encryption support by host
Introduce the new Host.supports_mem_encryption which tells whether
the host supports memory encryption. This allows us to centralize
and generalize the check logic for additional mechanisms such as
Arm CCA, planned to be added in the future.

Implements: blueprint generalize-sev-code
Change-Id: If020c71bd4962c6ca96e042592854e57d9a7dcce
Signed-off-by: Taketani Ryo <taketani.ryo@fujitsu.com>
2025-12-17 07:42:51 +00:00
Zuul 11dff40b4f Merge "Make image upload tpool usage conditional" 2025-12-16 19:29:43 +00:00
Zuul 5b540e579e Merge "Make guestfs' Tpool usage optional" 2025-12-16 13:27:31 +00:00
Balazs Gibizer cbbb8b14e0 Follow up test change for 8c8047ce2a
Change-Id: Ifc915b3ad0c00ec528183920cbe09f873dedcaf3
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-12-16 12:40:39 +01:00
Zuul fc19a29d20 Merge "Make libvirt Tpool proxying conditional" 2025-12-16 04:49:53 +00:00