Commit Graph

62028 Commits

Author SHA1 Message Date
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
Balazs Gibizer eda6792632 Make libvirt Tpool proxying 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 patch_tpool_proxy() logic is removed from the libvirt driver as it
was only needed for python old style classes which is not in use any
more in python3 and the issue is not reproducible any more with
virConnect even without the patching.

❯ python3
Python 3.12.10 (main, Apr  9 2025, 04:44:59) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import eventlet
>>> eventlet.monkey_patch()
>>> from nova.virt.libvirt import host
>>> h = host.Host(uri="qemu:///system")
>>> h.get_connection()
libvirt:  error : internal error: could not initialize domain event timer
URI qemu:///system does not support events: internal error: could not initialize domain event timer
<libvirt.virConnect object at 0x7f829e94c170>
>>> c = h.get_connection()
>>> str(c)
'<libvirt.virConnect object at 0x7f829e94c170>'
>>>

Signed-off-by: Balazs Gibizer <gibi@redhat.com>
Change-Id: Ic60ab78cec2a9f9ba177568b69e738425e56cae1
2025-11-21 16:05:21 +01:00
Balazs Gibizer 8c8047ce2a Make RBD 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.

Signed-off-by: Balazs Gibizer <gibi@redhat.com>
Change-Id: I08f257d49c87d0d8a87127f61157b1b0b5ca7b3c
2025-11-21 16:05:21 +01:00
Zuul 53df49b2ec Merge "Init virt driver before use" 2025-11-21 14:27:01 +00:00
Zuul c09e17582d Merge "api: Add response body schemas for security group APIs" 2025-11-20 23:35:27 +00:00
Jay Faulkner 56cb5f52fb [ironic] Ensure unprovision happens for new states
States were added to the Ironic API to enable the node servicing
feature, which can be performed on nodes provisioned with Nova
instances. Current nova, if asked to delete these instances, will only
remove the instance metadata and not tear them down.

This change has two parts:
- I have added the new, relevant states to _UNPROVISION_STATES in
  driver.py, which now allows Nova to know that SERVIC* states and
  DEPLOYHOLD are safe to unprovision from.
- I have added all existing ironic states to ironic_states.py and the
  PROVISION_STATE_LIST constant and check the state against it -- in a
  case where a completely unknown state is returned, we should attempt
  an unprovision.

This fix needs to be backported as far as possible, as this bug has
existed since Antelope / 2023.1 (DEPLOYHOLD) or Bobcat / 2023.3
(SERVIC*).

Assisted-by: Claude Code
Closes-bug: #2131960
Change-Id: I31c70d35b0e6e9f8d2252bfb2f0bdec477cc6cc7
Signed-off-by: Jay Faulkner <jay@jvf.cc>
2025-11-20 15:23:58 -08:00
René Ribaud f017e23b81 Use *_OR_ADMIN policy defaults for server shares
Update the server shares API policies to use
PROJECT_READER_OR_ADMIN and PROJECT_MEMBER_OR_ADMIN instead of
PROJECT_READER and PROJECT_MEMBER.

This aligns the server shares policies with other compute API
policies and ensures administrators can list, attach, show and
detach shares regardless of project policy overrides.

Signed-off-by: René Ribaud <rene.ribaud@gmail.com>
Change-Id: I2b237d56b08e3080475dc500e204298018af29c7
2025-11-20 15:15:00 +01:00
melanie witt c5c1b93d21 libvirt: add configuration option for volume AIO mode
With the NFS, FC, and iSCSI Cinder volume backends, Nova explicitly
sets AIO mode ``io=native`` in the Libvirt guest XML. Operators may set
this option to True in order to defer AIO mode selection to QEMU if
forcing ``io=native`` is not desired.

Closes-Bug: #2129788

Change-Id: I6e51706b5cb8be5becebbafe9108df1ba9e0f69f
Signed-off-by: melanie witt <melwittt@gmail.com>
2025-11-19 12:04:31 -08:00
Zuul 53aadaf967 Merge "Update comment about migrated mypy conf files" 2025-11-19 17:50:23 +00:00
Zuul 94788200db Merge "TPM: support instances with host secret security" 2025-11-19 17:45:06 +00:00
Zuul 32ad7a036b Merge "TPM: support instances with user secret security" 2025-11-19 17:37:39 +00:00
Zuul d6b0961862 Merge "TPM: add RequestContext checks to functional tests" 2025-11-19 15:51:15 +00:00
Rajesh Tailor cec81f76fb Update comment about migrated mypy conf files
The change Ife39b55eb40c9cb8e61f1b2295b6d42cefe3a680 migrated mypy
configuration files from setup.cfg to pyproject.toml file, but a
comment in .pre-commit-config.yaml says to keep is in sync with
setup.cfg, which is incorrect.

This change updates comment in the .pre-commit-config.yaml file to
reflect the change.

Signed-off-by: Rajesh Tailor <ratailor@redhat.com>
Change-Id: I4d35b989e8c90b629bcb15438ad82f60f7ca8957
2025-11-19 11:47:50 +05:30
Zuul e2eefc277c Merge "api: Add response body schemas for floating IP APIs" 2025-11-18 18:08:36 +00:00
Zuul df6f5c3fdc Merge "api: Add response body schemas for volume attachments APIs" 2025-11-18 17:54:28 +00:00
Zuul c5ebda4d84 Merge "api: Add response body schemas for snapshots APIs" 2025-11-18 17:54:16 +00:00
Zuul 0c33871c36 Merge "Add managed='no' flag to libvirt XML definition for VIF type TAP" 2025-11-18 14:57:17 +00:00
Artom Lifshitz 245a321e43 TPM: support instances with host secret security
Start supporting booting instances with the `host` TPM secret
security. This means setting the `ephemeral` and `private` attributes
on the Libvirt secret correctly, and not undefining the secret once
the instance has spawned. The Libvirt fixture's Secret support is
extended to be able to test all that in a functional test.

For functional testing, we need to:

* Extend our libvirt fixture's Secret object to properly set the usage
  id (which is just the instance UUID) when parsing vTPM secret XML.

Related to blueprint vtpm-live-migration

Change-Id: I5a38a0de76a78b28a205a8d19f2374830054e1ab
Signed-off-by: melanie witt <melwittt@gmail.com>
2025-11-17 17:26:38 -08:00
Artom Lifshitz ad1dd5e594 TPM: support instances with user secret security
The `user` secret security policy is just existing behavior. No
changes are necessary in the mechanics, so this patch just adds a
scheduler prefilter and tests. The functional tests add some
groundwork to make future tests easier as well by making the helper
methods more flexible.

For functional testing, we need to:

* Have our libvirt fixture keep track of undefined secrets. Secrets
  are undefined as soon as the VM that uses them successfully boots
  (as mentioned previously, VM creation follows this pattern), but our
  tests would still like to assert that the secret had been created on
  a host. Just add a _removed_secrets dict that _remove_secret()
  populates.

Related to blueprint vtpm-live-migration

Change-Id: Ib449dc2f1c4a9af9d423252594261947e811452e
Signed-off-by: melanie witt <melwittt@gmail.com>
2025-11-17 17:26:38 -08:00
melanie witt 0f82c2953e TPM: add RequestContext checks to functional tests
Key manager service secret ownership can be a challenge when dealing
vTPM instances. Some instance actions require access to the secret and
will fail if there is a mismatch.

In preparation for vTPM live migration changes which will involve
different users accessing secrets (user|admin|Nova service user), this
removes ADMIN_ONLY from the functional tests class and adds checking of
RequestContext user_id in the FakeKeyManager.

Change-Id: I2790cd274a4776ab306b39df1e591e8304b63f96
Signed-off-by: melanie witt <melwittt@gmail.com>
2025-11-17 17:26:38 -08:00
Zuul cf930034f2 Merge "Reproduce bug/2130881" 2025-11-17 16:44:07 +00:00
Zuul 72dd372fc4 Merge "[hacking] Improve N373 to catch also other primitives" 2025-11-17 16:18:33 +00:00
Jonas Schäfer 2399a296e3 Preserve vTPM state between power off and power on
Without this patch, due to power_on calling _hard_reboot, which in turn
undefines the VM to ensure a clean domain XML, the TPM data is erased by
libvirt.

This is very surprising to users who store persistent data in the TPM,
such as keys required to decrypt the main disk of the VM.

Closes-Bug: #2118888

Signed-Off-By: jonas.schaefer@cloudandheat.com
Change-Id: Iefb879428681003d6db604b70353a91913c92461
2025-11-17 14:37:11 +01:00
Sean Mooney 22012360c4 ensure correct cleanup of multi-attach volumes
If a host has multiple instance with the same shared
multi attach volume and you delete them in parallel
nova need to correctly clean up the volume connection on
the host when the last instance is removed.

currently we do not have a volume level lock to guard the
critical section that determins if the current disconnect is
removing the final usage of the volume.

This can lead to leaking the volume or other issues as
noted in bug: #2048837

This change introduces a FairLockGuard to ensure we acquire
and release the locks in a fair and orderd manner.
The FairLockGuard is used to lock the server delete with
one lock per multi attach volume.

This will ensure that disconnects of diffrent volumes can happen
in parallel but if we are disconnecting the same volume in multiple
greenthread concurrently they will be serialised.

Assisted-By: Cursor Auto
Closes-Bug: #2048837
Change-Id: I67e10cace451259127a5d7da8fbdf7739afe3e51
Signed-off-by: Sean Mooney <work@seanmooney.info>
2025-11-17 13:26:08 +00:00
Zuul 8a993d583f Merge "add functional repoducer for bug 2048837" 2025-11-14 22:20:55 +00:00
Dan Smith 326b77d837 Test nova-next with >1 parallel migrations
Change-Id: Ic69872e6667664d1b3bd7a88d7ef018b67352f44
Signed-off-by: Dan Smith <dansmith@redhat.com>
2025-11-13 06:32:54 -08:00
Sean Mooney fac1a4d9de add functional repoducer for bug 2048837
Change-Id: I8ce3044cff198209416d2a458317f01d1177e9da
Signed-off-by: Sean Mooney <work@seanmooney.info>
2025-11-12 10:32:06 +00:00
Zuul b7d50570c7 Merge "api: Add response body schemas for volumes APIs" 2025-11-11 20:10:29 +00:00