Commit Graph

61913 Commits

Author SHA1 Message Date
Zuul 75aed9a19d Merge "Live migration with iothreads" 2026-02-05 10:56:23 +00:00
Zuul c94d2eaedb Merge "Enable mypy on nova/utils.py" 2026-02-05 03:43:47 +00:00
Zuul 6b0bb735a6 Merge "SubclassSignatureTestCase to use NoDBTestCase as base" 2026-02-05 03:14:21 +00:00
Zuul 6a6e05d4d3 Merge "Libvirt event handling without eventlet" 2026-02-05 03:14:05 +00:00
Sean Mooney c8d34ed3dc Fix blockio generation for LUN volumes
QEMU's scsi-block device driver does not support physical_block_size
and logical_block_size properties. When Cinder reports disk geometry
for LUN volumes, Nova was incorrectly including a <blockio> element
in the libvirt XML, causing QEMU to fail with:

    Property 'scsi-block.physical_block_size' not found

This fix adds a check to skip blockio generation when source_device
is 'lun', following the existing pattern used for serial at line 1356.

Generated-By: claude-code (Claude Opus 4.5)
Closes-Bug: #2127196
Change-Id: Idf87e936edd97aac719222942c9842a9aca4c270
Signed-off-by: Sean Mooney <work@seanmooney.info>
2026-02-03 22:15:19 +00:00
huanhongda 53a613d994 Live migration with iothreads
In commit 76d64b9cb4 we enable
one io-thread per qemu instance. Live migration should update this.

Related-Bug: #2139351
Change-Id: I1476de288490c88a60db697fbb45b4f783821c14
Signed-off-by: hongda.xun <hongda.xun@easystack.cn>
2026-01-30 17:38:00 +08:00
Sean Mooney ba24639b8d Add regression test to repoduce bug 2139351
This tests repoduces the current bug where the iothread pinning
is not updated for numa instnace on live migration and
enhance the libvirt fixture to make this possible

we also provide a sanity check for non numa instnace to show the
vcpu cpuset is correctly.

Related-Bug: #2139351
Assisted-By: claude-code opus 4.5
Change-Id: Ib2c0d1f826ad4f31e3e9b3f61f2c9b2111bf7edd
Signed-off-by: Sean Mooney <work@seanmooney.info>
2026-01-29 15:19:24 +00:00
Balazs Gibizer 9f74d1c5f2 Enable mypy on nova/utils.py
As a follow up for a review comment in [1] this patch enables mypy for
nova/utils, fixes the existing mypy findings, and adds some trivial type
annotations where make sense.

[1]https://review.opendev.org/c/openstack/nova/+/956089/comment/caec94ed_4fdb16bf/

Change-Id: I29ca69bd1e583adc1b1f408bd45de183649986d2
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2026-01-29 11:57:04 +01:00
Balazs Gibizer c89e54cedc SubclassSignatureTestCase to use NoDBTestCase as base
We have a list of fixtures included in the test.TestCase base class
that prevents global data and tread leaking across test cases within
the same process. The SubclassSignatureTestCase did not use our base
class but it initializes a partial libvirt driver class that will soon
use a ThreadPoolExecutor in native threading mode. So we need the leak
protection here as well. So this patch moves SubclassSignatureTestCase
to use the NoDBTestCase base class.

Change-Id: I05e818e8e83757185e5af78a5a4771c90d9fa217
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2026-01-29 11:54:25 +01:00
Balazs Gibizer a89c1b44c5 Libvirt event handling without eventlet
Our libvirt interface is not eventlet aware and not pure python. So
eventlet monkey patching is not enough. So the libvirt driver
implemented a native polling thread for libvirt and the queue + pipe
mechanism to push event from the native polling thread to the main
thread with the eventlet event loop.

We don't need all of these complications in native thread mode. There we
only need a single thread that poll libvirt for the events. The received
events can be executed directly on the polling thread as that is no
different from any other threads in the system now.

To make the change more understandable the event handling logic is moved
behind an abstraction that is implemented twice, once for eventlet with
the existing implementation just moved around, and once for native
threading with the simplified handling.

Change-Id: If479574cd91975810098afa8e3c220c7316a9431
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2026-01-29 11:54:25 +01:00
Zuul 59a7093915 Merge "Use the correct name for the ironic check job" 2026-01-28 08:18:07 +00:00
Zuul 4112a4491c Merge "Preserve vTPM state between power off and power on" 2026-01-28 01:43:47 +00:00
Zuul ce286865f9 Merge "[hacking]Do not mock threading.Event" 2026-01-27 20:42:15 +00:00
Zuul 134d3ac476 Merge "api: Simplify servers views (3/3)" 2026-01-27 14:17:53 +00:00
Zuul d3143aeec7 Merge "api: Simplify servers views (2/3)" 2026-01-27 14:13:32 +00:00
Zuul 2032cb2828 Merge "api: Simplify servers views (1/3)" 2026-01-27 13:53:24 +00:00
Steve Baker 1637397253 Use the correct name for the ironic check job
The job name has been an alias for 6 years [1] and the accurate
preferred name ironic-tempest-bios-ipmi-direct has been in place for 8
months [2].

The intent of job names is to accurately describe the configuration of
the job, and the name
ironic-tempest-ipa-wholedisk-bios-agent_ipmitool-tinyipa is now
inaccurate - specifically the job no longer uses tinyipa.

[1] https://opendev.org/openstack/ironic/commit/53f751dcfd86594160dc9be92b616ef5d0d70623
[2] https://opendev.org/openstack/ironic/blame/branch/master/zuul.d/ironic-jobs.yaml#L1210-L1236

Change-Id: I768a6d3c7f9f550a692dd1f6e0435228076f118f
Signed-off-by: Steve Baker <sbaker@redhat.com>
2026-01-27 11:15:02 +13:00
Balazs Gibizer 19203d684d [hacking]Do not mock threading.Event
Such mock is too wide and will cause issues with our basic libraries and
test infrastructure leading to race conditions and threads leaked across
tests.

We needed to remove a bunch of such mocks found by the new rule. In some
cases we needed to make the mocking more specific for a given Event
instance, in other case the mock was not needed at all and the test case
was still not taking excessive time.

Related-Bug: #2136815
Change-Id: I3ae3740eb07bade4e0883db3e02c0a81e92b9a36
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2026-01-26 20:26:56 +01:00
Zuul d840c63a18 Merge "api: Add response body schemas for server metadata APIs" 2026-01-26 14:48:14 +00:00
Zuul eabb1d1260 Merge "api: Remove networks key from quota schemas" 2026-01-26 14:48:01 +00:00
Zuul e67372b33e Merge "api: Add response body schemas for server tags API" 2026-01-25 03:50:50 +00:00
Zuul d6d8f28640 Merge "api: Add response body schemas for server migrations API" 2026-01-25 03:50:32 +00:00
Zuul 92898e8f77 Merge "api: Add response body schemas for migrations API" 2026-01-24 08:29:20 +00:00
Zuul f33f8c6e25 Merge "api: Add response body schemas for quota sets API" 2026-01-24 08:29:06 +00:00
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
Stephen Finucane 86df50b489 api: Remove networks key from quota schemas
Per feedback on the reviews.

Change-Id: I09433e2379b9a96ec2668aef8a3f14f81c42d71f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2026-01-23 13:46:27 +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 d00485f13b api: Simplify servers views (3/3)
Organize API microversion checks by version and fields by name, so
our schema checks can be more easily diffed against the actual code.

Change-Id: I899befcc09bdb6a2641cba5f5ac314ab515f2897
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2026-01-21 17:02:49 +00:00
Stephen Finucane 1e8489510c api: Simplify servers views (2/3)
Security group handling is very different in the create view versus
other views. Don't try combining them.

Change-Id: I1b7e64e746ef226c8a2ae67310b31dc5703916f9
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2026-01-21 17:02:49 +00:00
Stephen Finucane d56c46785b api: Simplify servers views (1/3)
We're going to be reworking this substantially over the next few
changes. Get some style-focused changes out of the way first. This is
mainly a case of condensing things.

Change-Id: Ibb70b7c6fa723c34f2fac20601f22b49c69242df
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2026-01-21 17:02:49 +00:00
Stephen Finucane ec2feca566 api: Add response body schemas for server metadata APIs
Change-Id: I65877c15b268f8de08a51f451a6185f22c35c3cb
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2026-01-21 17:02:49 +00:00
Stephen Finucane 3a0e2b6e42 api: Add response body schemas for server tags API
Change-Id: I5ad751e771e8c9945d03a22c3cf0c3c4b5f41b68
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2026-01-21 17:02:49 +00:00
Stephen Finucane 3890e76327 api: Add response body schemas for server migrations API
Change-Id: I39708aaa34e01817edd49623eb7fa292a727dca4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2026-01-21 17:02:49 +00:00
Stephen Finucane 5cb1396e44 api: Add response body schemas for migrations API
Change-Id: Iaf55e28b17e202fd1740a01032a3c1455a502910
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2026-01-21 17:02:49 +00:00
Stephen Finucane 407434154e api: Add response body schemas for quota sets API
This exposes a minor issue in our policy checks. We reportedly assert
that a token scoped for one project cannot fetch quotas for another
project, but we weren't actually checking this. If we were, it wouldn't
have worked since our tests attempt to fetch quotas for the project
specified in the token. We add negative tests cases and update the
comments to clarify this.

Change-Id: I93c60a6bb110ab70f8821d0fbd6e8c5f87453582
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2026-01-21 17:01:32 +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