Commit Graph

61899 Commits

Author SHA1 Message Date
melanie witt b4861a6d2b Add handling for vTPM secret permission error
Currently there is no handling for this case so if we get a HTTP 403
from Barbican for a permission error, a very long multi-layered
traceback gets logged in nova-compute. This can happen if an admin
tries to start an instance with vTPM belonging to a different user, for
example.

This adds some basic error handling for this case. Most of the logged
traceback consists RPC oslo.messaging content, so the new
VTPMSecretForbidden exception is added as an expected exception to the
compute manager methods we expect users are more likely to encounter
such as build, start, and reboot.

Other compute manager methods where VTPMSecretForbidden can be raised
are resize, resume, restore, and delete but we will leave these as-is
and let them log tracebacks because we expect them to be rare.

Change-Id: I2ef6df818ed3f63efe2ff9b333c97928d4efa18d
Signed-off-by: melanie witt <melwittt@gmail.com>
2025-10-29 22:15:43 +00:00
Artom Lifshitz 7446ba158e Add hw:tpm_secret_security extra spec validation
Like the image property, it can have the `user`, `host`, or
`deployment` value. Use this opportunity to also add unit testing for
the previous TPM extra specs, hw:tpm_model and hw:tpm_version.

NOTE(artom) The spec used hw:vtpm_secret_security, this patch uses
hw:tpm_secret_security (without the v) to align with the existing
extra specs (and image properties).

Implements: blueprint vtpm-live-migration

Change-Id: Ie6495bef7a2a782d4c70eae7f8ff685afe8fe93a
Signed-off-by: melanie witt <melwittt@gmail.com>
2025-10-29 22:15:43 +00:00
Zuul 30bf8c1025 Merge "api: Handle empty imageRef alongside null for local BDM check" 2025-10-24 14:55:45 +00:00
Zuul eff7dfd693 Merge "pci: Add more detail and examples to pci.alias docs" 2025-10-22 18:54:13 +00:00
Zuul a2fa7b1fa1 Merge "[doc]PCI in Placement tuning" 2025-10-21 11:58:39 +00:00
Zuul 7daff51fe9 Merge "Dump conf to debug log later in the WSGI app pipeline" 2025-10-20 22:27:42 +00:00
Zuul 94ae45c1d1 Merge "api-ref: Fix server topology API docs" 2025-10-19 10:37:37 +00:00
melanie witt 45cdc1903b Dump conf to debug log later in the WSGI app pipeline
When CONF.log_options = True, we dump the config to the DEBUG log and
it can help with debugging issues to see whether a config has been
applied or not. Currently, the log is dumped before other options in
the pipeline are registered, such as the keystonemiddleware.auth_token
options in the [keystone_authtoken] config section.

This moves the conf dumping code after the WSGI app is loaded in order
to reflect more config options in the debug log.

Change-Id: I53d36b68d7942bc65a85fbe314a7f0baa6124343
Signed-off-by: melanie witt <melwittt@gmail.com>
2025-10-17 11:30:06 -07:00
Zuul 6d5cf6845e Merge "Fix fill_metadata usage for the ImagePropertiesWeigher" 2025-10-16 23:56:01 +00:00
Balazs Gibizer 29c609be23 [func]Test with optimize_for_wide_provider_trees
Placement implemented a workaround optimization for large provider
trees. This patch enables that optimization to run the pci_in_placement
related nova functional tests with this config enabled.

Change-Id: I0b5e13673cb4cc7c57aeae50914ace443dfc18fa
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-10-16 19:03:24 +02:00
Balazs Gibizer 35b8a1cae9 [doc]PCI in Placement tuning
Related-Bug: #2070257
Related-Bug: #2126751

Change-Id: I602c78e02d1821fab202a91fc4e42e1b0cae42ad
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-10-16 17:29:16 +02:00
Sylvain Bauza 98885344bd Fix fill_metadata usage for the ImagePropertiesWeigher
When using the weigher, we need to target the right cell context for the
existing instances in the host.
fill_metadata was also having an issue as we need to pass the dict value
from the updated dict by keying the instance uuid, not the whole dict of
updated instances.

Change-Id: I18260095ed263da4204f21de27f866568843804e
Closes-Bug: #2125935
Signed-off-by: Sylvain Bauza <sbauza@redhat.com>
2025-10-16 11:09:45 +02:00
Kamil Sambor a4d6fed120 [hacking] Improve N373 to catch also other primitives
Currently, it also catches semaphores, timeouts,
and event-related items.

Change-Id: Ibdaf6a107fbc7678fe514005ff1ea8bc5b8031c8
Signed-off-by: Kamil Sambor <kamil.sambor@gmail.com>
2025-10-15 10:47:43 +02:00
Zuul 17f1f0ad49 Merge "Switch nova-conductor to use global executor" 2025-10-14 18:45:50 +00:00
Zuul 9df3068dc7 Merge "Move cleanup of vTPM secret from driver to compute" 2025-10-14 16:44:46 +00:00
Zuul 420df9ecf8 Merge "Add functional reproducer for bug 2125030" 2025-10-14 15:30:50 +00:00
Kamil Sambor f6314d9027 Switch nova-conductor to use global executor
Change-Id: I0700a907746712965860455909d976f6eab0d9bd
Signed-off-by: Kamil Sambor <kamil.sambor@gmail.com>
2025-10-13 13:26:26 +02:00
Zuul 8b81b5f91f Merge "Reset the mapped field of nodes at service deletion" 2025-10-13 10:17:28 +00:00
Balazs Gibizer da1fb487e7 [CI][nova-next]test with placement ac optimizations
The nova-next job will run tempest with allocation candidate generation
optimizations enabled:

  [placement]
  allocation_candidates_generation_strategy = breadth-first
  max_allocation_candidates = 100000
  [workarounds]
  optimize_for_wide_provider_trees = True

Depends-On: https://review.opendev.org/c/openstack/devstack/+/939825
Deepnds-On: https://review.opendev.org/c/openstack/placement/+/962776
Change-Id: Icbfc568bead950a3be22784746421cc11382b2d7
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-10-13 11:07:06 +02:00
Zuul d4044a8031 Merge "Add a regression test for ImagePropsWeigher" 2025-10-10 18:29:56 +00:00
Zuul ff15b46eb9 Merge "Adds regression test for bug LP#2085135" 2025-10-10 10:22:15 +00:00
Zuul f1930757a9 Merge "Fix string format specifier" 2025-10-10 10:21:38 +00:00
Julien Le Jeune c04c94ecfb Reset the mapped field of nodes at service deletion
Make sure that the 'mapped' field of compute nodes is reset
to 0 at nova-compute service deletion.

To let nova-manage create the missing host mapping in nova_api
database.

Closes-Bug: #2085135
Change-Id: I774d4312d7e94af94d960f7269717a00fa08c583
Signed-off-by: Julien Le Jeune <julien.le-jeune@ovhcloud.com>
2025-10-09 15:18:16 +02:00
Julien Le Jeune 4073297ae3 Adds regression test for bug LP#2085135
Related-Bug: #2085135
Change-Id: Id50413e2cff19bc3e510506ad2d7703c86155f59
Signed-off-by: Julien Le Jeune <julien.le-jeune@ovhcloud.com>
2025-10-09 14:58:08 +02:00
Zuul 076498ed95 Merge "Remove nova.service.process_launcher" 2025-10-08 14:29:42 +00:00
Zuul 23cad1dd7d Merge "Update start_service() function in test" 2025-10-08 11:35:30 +00:00
Julien Le Jeune 38d1b14170 Update start_service() function in test
Update the 'mapped' field of the created node to be coherent with
what it's done in _check_and_create_node_host_mappings function [1].

[1] https://opendev.org/openstack/nova/src/commit/cc742602bcdeff185ff120452e4f301398f6aa7b/nova/objects/host_mapping.py#L209

Related-Bug: #2085135
Change-Id: I9965932adc521756e4583d1bcfc75c83cc630626
Signed-off-by: Julien Le Jeune <julien.le-jeune@ovhcloud.com>
2025-10-08 10:32:24 +02:00
Zuul 3ed740eabd Merge "[nova-tox-py312-threading]Ignore failing tests" 2025-10-07 20:36:17 +00:00
Zuul 7278e661a4 Merge "doc: Fix typo in nova-manage command" 2025-10-07 12:10:58 +00:00
Sylvain Bauza 04afc452b3 Add a regression test for ImagePropsWeigher
The weigher is unable to get the right image metadata for existing
instances if they are not already on the HostState.

Change-Id: I5bccf854662ecffe1d469bacc6e4afcb746d6b4d
Signed-off-by: Sylvain Bauza <sbauza@redhat.com>
2025-10-06 18:39:06 +02:00
Zuul cc742602bc Merge "Run nova-conductor in native threading mode" 2025-10-02 15:55:16 +00:00
Zuul 4ccdec1ac4 Merge "Switch nova-conductor to use ThreadPoolExecutor" 2025-10-02 13:40:26 +00:00
Zuul e8ebbd5417 Merge "tests: Replace keystoneclient with keystoneauth1" 2025-10-02 12:07:49 +00:00
Zuul 1508cb39a2 Merge "[hacking] N374 do not use time.sleep(0) to yield" 2025-10-01 20:24:32 +00:00
Zuul 2928d53dca Merge "Centralize cooperative yield" 2025-10-01 20:04:43 +00:00
melanie witt 787d2a1300 Move cleanup of vTPM secret from driver to compute
Currently, vTPM secrets are deleted from Barbican any time instance
disks are deleted when driver.destroy() is called. This is fine if the
instance is also being deleted but if it's not, such as during a resize
revert, it will fail with the following error:

  nova.exception.Invalid: Refusing to create an emulated TPM with no
    secret!

which will bubble up to the API as a HTTP 500.

This moves deletion of the vTPM secret from Barbican from the libvirt
driver destroy() path to the compute manager _delete_instance() path so
that the vTPM secret is deleted only if the instance is being deleted.

Closes-Bug: #2125030
Change-Id: I1a43dc0502e1e65b4ef0348610f5eddb43dbff02
Signed-off-by: melanie witt <melwittt@gmail.com>
2025-10-01 01:55:28 +00:00
Balazs Gibizer d265faed2c [hacking] N374 do not use time.sleep(0) to yield
We have a centralized nova.utils.cooperative_yield() instead of
time.sleep(0). It is better as it allows to turn off the sleep calls
when the service runs in threaded mode.

Change-Id: I625daec79ee5b7f8b92116f450e21f997cef0546
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-09-24 15:38:26 +02:00
Pierre Riteau 7cae672a74 doc: Fix typo in nova-manage command
Change-Id: Id9ba4e984418b9da20b5be313485d8892ef98c0e
Signed-off-by: Pierre Riteau <pierre@stackhpc.com>
2025-09-23 09:14:52 +02:00
melanie witt 650772d97e Add functional reproducer for bug 2125030
This reproduces the bug where an attempt to revert a resize from a
flavor with vTPM to a different flavor with vTPM results in the revert
failing and the instance going into ERROR state when storage is not
shared.

Because of the lack of test coverage of vTPM with non-shared storage,
this change also just adds a subclass to run all of the vTPM functional
tests with the test environment mocked to behave as though storage is
not shared between compute hosts.

A bug fix will follow these functional tests.

Related-Bug: #2125030

Change-Id: I49745a8ba78e1ea6a1b009bccab32a002cb6afb0
Signed-off-by: melanie witt <melwittt@gmail.com>
2025-09-23 06:02:36 +00:00
Balazs Gibizer ec426532c3 Run nova-conductor in native threading mode
Previous patches removed direct eventlet usage from nova-conductor so
now we can run it with native threading as well. This patch documents
the possibility and switches both nova-conductor process to native
threading mode in the nova-next job.

Change-Id: If26c0c7199cbda157f24b99a419697ecb6618fa6
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-09-22 10:17:39 +00:00
Zuul b99a882366 Merge "Add admin context when filling metadata on ImagePropsWeigher" 2025-09-19 14:17:21 +00:00
Balazs Gibizer 858494997e Centralize cooperative yield
Replace the remaining time.sleep calls use to trigger eventlet yield
to the existing nova.utils.cooperative_yield() call. This will help
us to disable such yielding in when the service is running in threading
mode and eventually drop the whole thing when nova removes eventlet.

Change-Id: I6b3fcba13f4d1c41d1fac2efe3cb4a943e66f8bb
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-09-19 14:35:15 +02:00
Balazs Gibizer 520057663a [nova-tox-py312-threading]Ignore failing tests
There is two intermittently failing tests we need to ignore for now so
this patch extends the list.

Closes-Bug: #2125185

Change-Id: I8d440013c84ae1dac4e2a1f661fc31138944b032
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-09-19 10:58:36 +02:00
Zuul f8b72e964c Merge "Regression test for ImagePropsWeigher due to missing context" 2025-09-18 16:09:25 +00:00
Sylvain Bauza dedfc305dd Add admin context when filling metadata on ImagePropsWeigher
Creating a new admin context as we can't reuse the RequestSpec user
context in order to hydrate InstanceList with the full list of instances
from the host and not only the ones from the user.

Closes-Bug: #2125052

Change-Id: Ibbd80324c17be6546ecd8b80f908ac5bbab5abd0
Signed-off-by: Sylvain Bauza <sbauza@redhat.com>
2025-09-18 17:25:10 +02:00
Sylvain Bauza 59224d1583 Regression test for ImagePropsWeigher due to missing context
Added a functional regression test that shows that a second instance
fails on a host.

Related-Bug: #2125052
Change-Id: I14c1464d638a8c0d55e6a69ec22e0b83567c1797
Signed-off-by: Sylvain Bauza <sbauza@redhat.com>
2025-09-18 16:31:22 +02:00
Zuul 1d317f043e Merge "nova-conductor puts instance in error state" 2025-09-17 22:28:17 +00:00
Zuul 4eea21199c Merge "Adds regression test for bug LP#2044235" 2025-09-17 11:00:45 +00:00
Kamil Sambor 9f58f596db Switch nova-conductor to use ThreadPoolExecutor
This is a pure refactor so not having any unit test change actually
signals that the refactor did not change the existing behavior which is
good.

The unit test run on this patch only covers the eventlet mode but higher
in the series we run unit test with native threading mode in a separate
job that will complement the coverage for this patch.

Change-Id: Iafc96c93a0d4c406b77902942b2940653441fe38
Signed-off-by: Kamil Sambor <kamil.sambor@gmail.com>
2025-09-17 11:35:35 +02:00
Rajesh Tailor ca158f2da3 Fix string format specifier
This change fixes string format specifier from $ to % for
correct formatting.

Closes-Bug: #2123840
Signed-off-by: Rajesh Tailor <ratailor@redhat.com>
Change-Id: I04f6e1ba3eff443d40a13c6fe2d0b77a78a020e6
2025-09-16 10:20:45 +05:30