Commit Graph

61904 Commits

Author SHA1 Message Date
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
Zuul fb992ef376 Merge "Make RBD Tpool usage conditional" 2025-12-16 04:49:40 +00:00
Zuul 3d8513301b Merge "api: Add response body schemas for simple tenant usage APIs" 2025-12-15 18:19:03 +00:00
Zuul 843ea54a5b Merge "api: Add response body schemas for tenant network APIs" 2025-12-15 18:03:40 +00:00
Zuul dadc136d11 Merge "api: Add response body schemas for server usage audit log APIs" 2025-12-15 18:03:27 +00:00
Zuul 706e2cf09d Merge "api: Add response body schemas for services APIs" 2025-12-15 18:03:15 +00:00
Zuul 1e14d75268 Merge "Drop direct dependency on iso8601" 2025-12-11 20:51:44 +00:00
Jay Faulkner 21cebb7725 [ironic] Use constants from Ironic, test w/ddt
Follow-ups for the original fix to bug #2131960. Includes an update to
make tests match Nova style (ddt) and another to unify state constant
code between Ironic and Nova.

The new ironic_states.py was copied from ironic/common/states.py from
commit 2622864b70bc66ec711045a3a0bf30478b27b9cd in ironic.

Change-Id: I49fba64da039e5c54967b6f5c56cb44927f815c3
Signed-off-by: Jay Faulkner <jay@jvf.cc>
2025-12-11 10:04:02 -08:00
Takashi Kajinami 56e31f8d4e Replace remaining reference to policy.json
The json format of policy files was deprecated long ago and is being
removed completely. Mention policy.yaml instead.

Change-Id: I9f6f11fd563d39a4fc1b940c67084292de7c56e3
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
2025-12-12 01:23:18 +09:00
Zuul 8a4b000216 Merge "Remove openSUSE/SLES from install guide" 2025-12-09 09:31:39 +00:00
Zuul f268b385dd Merge "Use consistent program name for wsgi scripts and entry points" 2025-12-08 22:18:34 +00:00
Takashi Kajinami d013960242 Migrate upper functional job to Python 3.13
Depends-on: https://review.opendev.org/960639
Change-Id: I441298c9a71521b45d1ddcbe9612b7f4e18a60da
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
2025-12-07 17:02:44 +00:00
Zuul b1586dd09e Merge "Collect result of _live_migration_operation" 2025-12-05 18:10:54 +00:00
Zuul da1cddfb14 Merge "Fix missing guest.migrate(parallel=) mock arg" 2025-12-05 17:44:37 +00:00
Dan Smith 20a9f9d740 Collect result of _live_migration_operation
Without this, we won't notice errors raised in the operation thread.

Before 1cd1c472bd the unit test actually
forced such errors to be raised even if in the real code it would
never be raised. But that patch fixed the unit test fixture to be more
realistic without realizing that such fixture error also means that we
might have wrong assumptions about the code under test.

Now we know that exception from the live migration thread was
never raised back to the monitor thread. To improve logging we added a
future.result() call after the main monitoring code finished.

Also the code had complex way to signal the monitoring thread that the
migration thread returned early by registering a callback on the
migration thread and setting an event. This can be simplified to just
check the status of the future of the migration thread. So the event and
the callback is removed.

All this was found because commit 25fbf32f22
missed to add the new parallel arg to the mock of guest.migrate()
on master, but the exception was never propagated to the unit test on
master. Backporting that change showed that in the old unit test env
there is a valid exception.

Co-authored-by: Dan Smith <dms@danplanet.com>
Change-Id: I22683ad5118796c6406f80d8726053afa84fff56
Signed-off-by: Dan Smith <dansmith@redhat.com>
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-12-05 10:09:14 +01:00
Dan Smith 6c940f4c3c Fix missing guest.migrate(parallel=) mock arg
This was missed in commit 25fbf32f22
because of a bug in our _live_migration_operation() post-eventlet
handling.

Change-Id: I39a7d6ebd72d9938bcb60143dfc50bd6a9c994b0
Signed-off-by: Dan Smith <dansmith@redhat.com>
2025-12-05 10:09:14 +01:00
Zuul 1712ae48e3 Merge "libvirt: add configuration option for volume AIO mode" 2025-12-05 05:20:30 +00:00
Zuul 7bd20e52d1 Merge "pre-commit: Bump versions" 2025-12-04 15:33:55 +00:00
Zuul 5d3d0c870a Merge "ensure correct cleanup of multi-attach volumes" 2025-12-04 07:00:30 +00:00
Stephen Finucane 164c3f0f61 Remove openSUSE/SLES from install guide
This has not been supported for some time.

Change-Id: Ic7073740deb0bf9670eebe77f0f8b0daca100a5c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-12-02 16:35:38 +00:00
Takashi Kajinami 253aaec4bb Use consistent program name for wsgi scripts and entry points
Make sure that the consistent program name is always set,so that
the same config sub-directory ( /etc/{project}/{prog}.conf.d ) is used
regardless of the way api service is run.

Closes-Bug: #2098514
Change-Id: Ib5c6d431176b83eefafddc1b35589015db6dfd04
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
2025-12-02 02:57:25 +09:00
Takashi Kajinami d2188b9e6b libvirt: Skip unsupported firmware types
Ignore (1) stateless mode firmware and (2) memory device firmware which
do not include a few core keys such as nvram-template. This is
a temporal (and backportable) workaround until firmware detection using
libvirt's internal feature is implemented by [1]

[1] https://blueprints.launchpad.net/nova/+spec/libvirt-firmware-auto-selection

Closes-Bug: #2122288
Change-Id: I99bc36fdd5df816c9ae374db71e4734fb7fc467b
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
2025-11-30 02:24:32 +09:00
Zuul 23b462d77d Merge "[ironic] Ensure unprovision happens for new states" 2025-11-24 10:43:39 +00:00
Zuul 16e65e74b2 Merge "docs: Corrects a typo on a placement audit command" 2025-11-21 15:23:30 +00:00
Balazs Gibizer 4c2b0f9f8d Remove tpool_execute as it is unused
The previous commits removed all the users for nova.utils.tpool_execute
so this patch removes that utility.

This also allows us to inline the _pass_context helper as now it is only
used by spawn_on.

Change-Id: I8520ccf4b5526543681c8c3864aaeef501462e9e
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-11-21 16:05:21 +01:00
Balazs Gibizer d3f9154ce2 Make image upload tpool usage conditional
When running in eventlet mode we keep the original eventlet.tpool usage
but when running in threading mode we call the functions directly on the
thread of the caller.

The original tpool_execute() call made the upload call running in a
native tread as it has parts that are blocking and therefore running
them in the current greenthread would make the other greenthreads
starved.

After this patch we preserve the same effect but with different syntax.
We use tpool_wrap to wrap the function into a tpool.Proxy object and
then call the proxy object. That proxy ensures that any call on the
proxy object is run in a native thread.

This change is useful for us in native threaded mode. There the
tpool_wrap returns the function unchanged. So upload is executed in the
caller's native thread. This is OK as in native threaded mode any
concurrent tasks are also in native threads and native threads are
preempted when needed. So other tasks will not be starved.

Change-Id: Iddb8b317b7a883c6fd144a93aca862a792fcd1af
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-11-21 16:05:21 +01:00
Balazs Gibizer 3c095c6b8d Make guestfs' Tpool usage optional
When running in eventlet mode we keep the original eventlet.tpool usage
but when running in threading mode we call the functions directly on the
thread of the caller.

Change-Id: I779374814a8ed8b2146bea226afe1250dea63079
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-11-21 16:05:21 +01:00