Commit Graph

61547 Commits

Author SHA1 Message Date
Callum Dickinson 660bacebc4 Fix libvirt metadata upgrade release note
Should be using 'upgrade', not 'upgrades'.
This fixes the upgrade note not being shown in the release notes.

Change-Id: I9ba3751988bb5ca2ddd89e8cffbc88d818068e88
Signed-off-by: Callum Dickinson <callum.dickinson@catalystcloud.nz>
2025-08-10 09:49:29 +12:00
Zuul 507b45e893 Merge "Add image meta to libvirt XML metadata" 2025-08-09 12:46:15 +00:00
Zuul 11ed3b32f1 Merge "Add more flavor metadata to libvirt guest XML" 2025-08-09 08:31:50 +00:00
Zuul 6ebfd0c247 Merge "Fix image ID in libvirt metadata when unshelving" 2025-08-08 16:51:36 +00:00
Callum Dickinson 7ce26377af Add image meta to libvirt XML metadata
This patch adds the image_meta used to launch an instance to its
libvirt domain metadata.

Nova exposes the image_meta structure when publishing
instance notifications. Downstream services that consume these
notifications such as Ceilometer use this to provide metadata about
the image originally used to create an ephemeral instance or
instance boot volume.

Ceilometer also polls the running instances using the Compute Agent
by reading the metadata of active instances from the libvirt socket.

Adding the data stored in image_meta to the libvirt metadata allows
Ceilometer to discover and expose the actual image metadata used to
launch instances using its compute pollsters, without performing
additional API queries to Nova, Cinder and Glance to get this
information (and even if that was done, it could be different to what
is actually running if images are updated after the fact).

To match the existing image_meta definition from Nova notifications,
depending on the type of instance, the behaviour of the metadata is:

* Instance built from image
  => UUID set for image, image metadata added to the XML
* Instance launched from volume built from image
  => UUID empty, volume image metadata added to the XML
* Instance launched from volume NOT built from image
  => UUID empty, no attributes from image meta defined

Signed-off-by: Callum Dickinson <callum.dickinson@catalystcloud.nz>
Implements: blueprint xml-image-meta
Change-Id: I09f4f76fff30f9cccf35f4832b9c870095c380ad
2025-08-08 00:14:02 +12:00
Callum Dickinson 619cd0a9c7 Add more flavor metadata to libvirt guest XML
This change adds the the following new information to the existing
flavor metadata structure in the libvirt guest XML:

* Flavor ID
* Extra specs

Downstream clients that query this guest XML such as Ceilometer
may also require this information. If it's not defined in this
metadata, clients are forced to perform a Nova API query just
to fetch this additional information.

This change should almost eliminate the need to perform such
API queries.

Signed-off-by: Callum Dickinson <callum.dickinson@catalystcloud.nz>
Implements: blueprint xml-image-meta
Change-Id: I249bc117a796f28e9929e12707a5afb6c869eb89
2025-08-08 00:12:39 +12:00
Callum Dickinson 4c64f84058 Fix image ID in libvirt metadata when unshelving
Nova adds the temporary shelved image ID to libvirt metadata
when unshelving image-backed instances. This is corrected when
the instance is cold restarted, resized or migrated but causes
issues for other services such as Ceilometer which rely on this
data being correct.

This patch ensures the correct image ID is set in the libvirt
domain metadata when image-backed instances are unshelved.

Signed-off-by: Callum Dickinson <callum.dickinson@catalystcloud.nz>
Co-Authored-By: Jeremy Lamb <jeremy.lamb@catalystcloud.nz>
Closes-Bug: #2100588
Change-Id: Ifd9f092299912606931848b2b25b4be6b36effac
2025-08-07 23:26:23 +12:00
Zuul 735aae205c Merge "Revert^2 "Support glance's new location API"" 2025-08-07 10:35:14 +00:00
Zuul 4100d4d8fb Merge "Document native threading mode and tuneables" 2025-08-01 14:14:36 +00:00
Balazs Gibizer 8701a93743 Document native threading mode and tuneables
Change-Id: I003177de3a9f69c71c19eb8eaa7232785e03e669
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-08-01 12:15:20 +02:00
Zuul a1cee6e5d3 Merge "Implement USB controller extra spec for libvirt." 2025-08-01 00:00:03 +00:00
Zuul b2a9d275dd Merge "Fix doc comment on manager role change" 2025-07-31 19:12:28 +00:00
Ghanshyam Maan f8d0b2ee98 Fix doc comment on manager role change
Fixing the review comments from
- https://review.opendev.org/c/openstack/nova/+/953063

Implement blueprint policy-manager-role-default

Change-Id: Idf376d9bd2eea981206738d0217ddc578875b280
Signed-off-by: Ghanshyam Maan <gmaan@ghanshyammann.com>
2025-07-31 10:24:25 +01:00
Zuul 24803136ac Merge "Don't reset port dns_name when shelving instances" 2025-07-30 22:02:05 +00:00
Zuul 0cd0a72227 Merge "Add project manager role in Nova API policy rule" 2025-07-30 21:28:19 +00:00
Andrew Bonney 593ac130b6 Don't reset port dns_name when shelving instances
Port dns_names are cleared when ports are detached in order to fix
https://bugs.launchpad.net/nova/+bug/1572593. This incorrectly resets
the dns_name for shelved instances where ports are not detached.

This patch adds a conditional to ensure the dns_name is not
unnecessarily reset.

Closes-Bug: #2058725

Change-Id: I6fdd3d6365196b4e470b72545ec649dfabe058d3
Signed-Off-By: Dan Smith <dansmith@redhat.com>
2025-07-30 08:53:40 -07:00
Takashi Natsume 6c03f9d1da Update contributor guide for 2025.2 Flamingo
Change-Id: Ibe2749f53069042d47b4828d5c12e6976265bd83
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2025-07-30 13:22:22 +00:00
Zuul 3a08a557df Merge "[test]Speed up qemu announce test by mocking sleep" 2025-07-30 11:57:11 +00:00
Zuul 233ea28e4e Merge "[test]Speed up RBD test by decreasing retry interval" 2025-07-30 11:51:24 +00:00
Zuul b8ea6e7c6d Merge "[test]Speed up ironic console test by decreasing timeout" 2025-07-30 11:50:54 +00:00
Zuul 62fb017de0 Merge "[test]Speed up fs retry tests by mocking sleep" 2025-07-30 11:49:20 +00:00
Zuul 709db47b39 Merge "Replace eventlet.event.Event with threading.Event" 2025-07-29 20:26:33 +00:00
Zuul 424656259f Merge "api: Add response body schemas for images APIs" 2025-07-29 19:12:32 +00:00
Zuul 9e57aac5e0 Merge "Print ThreadPool statistics" 2025-07-29 18:29:21 +00:00
Stephen Finucane d8e1248b7e api: Add response body schemas for images APIs
This is mostly uneventful save for us needing to fix our API ref, which
indicated that the 'OS-EXT-IMG-SIZE:size' field shown in the 'show' and
'detail' views was a string rather than an int. You can confirm this is
*not* the case like so:

  >>> import openstack
  >>> conn = openstack.connect()
  >>> conn.conn.compute.get('https://example.com/compute/v2.1/images/detail').json()

(obviously replace 'https://example.com/' with a compute API host)

Change-Id: Ia318478dfdb50f8d57a74958b3555f6ad97351ec
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-07-29 15:02:13 +01:00
Kamil Sambor 48ddc7c4d1 Replace eventlet.event.Event with threading.Event
As part of removing Eventlet from the codebase,
this patch replaces eventlet.event.Event with the standard
library's threading.Event.

To maintain the existing interface behavior,
a helper class ThreadingEventWithResult is introduced.
This class mimics Eventlet's Event by supporting result
passing and retrieval, which threading.Event does
not natively support.

The interface between eventlet.event.Event and
ThreadingEventWithResult maps as follows:
send(value) → set()
wait() → wait()
ready() → is_set()

Change-Id: I469ca9592a5c6d1f7ea1f54e4d34546224ce7ada
Signed-off-by: Kamil Sambor <kamil.sambor@gmail.com>
2025-07-29 15:25:45 +02:00
Michael Still 3eea2d58a9 Implement USB controller extra spec for libvirt.
This is the implementation for the USB controller extra spec as
desired by the new libvirt spice-direct console mode. USB device
redirection support is a frequently requested feature for VDI users.

Change-Id: I71edd03b5c63a8028c23a746c01c59d303994144
Signed-off-by: Michael Still <mikal@stillhq.com>
2025-07-26 16:19:58 +10:00
Zuul ed984eb756 Merge "libvirt: Add objects and notifications for USB controller model." 2025-07-26 03:15:47 +00:00
Balazs Gibizer 56e038900c [test]Speed up qemu announce test by mocking sleep
Before

Test id                                           Runtime (s)
------------------------------------------------  -----------
LibvirtConnTestCase.test_qemu_announce_self       2.214
TestProfiler.test_all_public_methods_are_traced   0.079

After

Test id                                           Runtime (s)
------------------------------------------------  -----------
LibvirtConnTestCase.test_qemu_announce_self       0.242
TestProfiler.test_all_public_methods_are_traced   0.097

Change-Id: Ib3c6e8c53f3eab5328eb30f5fd2e49a4b2e43097
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-07-25 15:48:51 +02:00
Balazs Gibizer 218ce9448b [test]Speed up RBD test by decreasing retry interval
Before

Test id                                          Runtime (s)
------------------------------------------------ -----------
RbdTestCase.test_cleanup_volumes_pending_resize  5.035
TestProfiler.test_all_public_methods_are_traced  0.080

After

Test id                                          Runtime (s)
-----------------------------------------------  -----------
TestProfiler.test_all_public_methods_are_traced  0.082
RbdTestCase.test_cleanup_volumes_pending_resize  0.029

Change-Id: Ibf43651d0a675ab7bf0dbfdf9f3fbd0072d39f98
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-07-25 15:48:42 +02:00
Balazs Gibizer f175f68e90 [test]Speed up ironic console test by decreasing timeout
Before

Test id                                                                   Runtime (s)
------------------------------------------------------------------------  -----------
IronicDriverConsoleTestCase.test__get_node_console_with_reset_success           9.990
IronicDriverConsoleTestCase.test_get_serial_console_socat_tcp6                  9.668
IronicDriverConsoleTestCase.test_get_serial_console_shellinabox                 9.645
IronicDriverConsoleTestCase.test_get_serial_console_socat                       9.126
TestProfiler.test_all_public_methods_are_traced                                 0.115
IronicDriverConsoleTestCase.test__get_node_console_with_reset_console_disabled  0.026
IronicDriverConsoleTestCase.test_get_serial_console_socat_disabled              0.024
IronicDriverConsoleTestCase.test_get_serial_console_socat_unsupported_scheme    0.024
IronicDriverConsoleTestCase.test__get_node_console_with_reset_wait_failed       0.022
IronicDriverConsoleTestCase.test__get_node_console_with_reset_wait_timeout      0.015

After

Test id                                                                   Runtime (s)
------------------------------------------------------------------------  -----------
IronicDriverConsoleTestCase.test_get_serial_console_socat_tcp6                  0.984
TestProfiler.test_all_public_methods_are_traced                                 0.114
IronicDriverConsoleTestCase.test__get_node_console_with_reset_console_disabled  0.026
IronicDriverConsoleTestCase.test__get_node_console_with_reset_wait_timeout      0.015
IronicDriverConsoleTestCase.test_get_serial_console_socat_unsupported_scheme    0.013
IronicDriverConsoleTestCase.test__get_node_console_with_reset_wait_failed       0.012
IronicDriverConsoleTestCase.test_get_serial_console_socat_invalid_url           0.012
IronicDriverConsoleTestCase.test_get_serial_console_socat_invalid_url_2         0.012
IronicDriverConsoleTestCase.test__get_node_console_with_reset_set_mode_failed   0.011
IronicDriverConsoleTestCase.test_get_serial_console_shellinabox                 0.009

Change-Id: Ia8cfcf8d45b3505aae2d72f948ebb8291bc9cff7
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-07-25 15:48:32 +02:00
Balazs Gibizer 8bf3bcccc4 [test]Speed up fs retry tests by mocking sleep
Before

Test id                                                                        Runtime (s)
-----------------------------------------------------------------------------  -----------
nova.tests.unit.test_filesystem.TestFSCommon.test_read_sys_retry_limit         10.016
nova.tests.unit.test_filesystem.TestFSCommon.test_write_sys_retry_limit        10.015
nova.tests.unit.test_filesystem.TestFSCommon.test_read_sys_retry                1.010
nova.tests.unit.test_filesystem.TestFSCommon.test_write_sys_retry               1.009
nova.tests.unit.test_filesystem.TestFSCommon.test_read_sys                      0.078
nova.tests.unit.test_profiler.TestProfiler.test_all_public_methods_are_traced   0.069
nova.tests.unit.test_filesystem.TestFSCommon.test_write_sys                     0.021
nova.tests.unit.test_filesystem.TestFSCommon.test_read_sys_error                0.007
nova.tests.unit.test_filesystem.TestFSCommon.test_write_sys_error               0.007

After

Test id                                                                        Runtime (s)
-----------------------------------------------------------------------------  -----------
nova.tests.unit.test_filesystem.TestFSCommon.test_read_sys                     0.081
nova.tests.unit.test_profiler.TestProfiler.test_all_public_methods_are_traced  0.069
nova.tests.unit.test_filesystem.TestFSCommon.test_read_sys_error               0.007
nova.tests.unit.test_filesystem.TestFSCommon.test_read_sys_retry               0.007
nova.tests.unit.test_filesystem.TestFSCommon.test_read_sys_retry_limit         0.007
nova.tests.unit.test_filesystem.TestFSCommon.test_write_sys_retry              0.007
nova.tests.unit.test_filesystem.TestFSCommon.test_write_sys_retry_limit        0.007
nova.tests.unit.test_filesystem.TestFSCommon.test_write_sys                    0.007
nova.tests.unit.test_filesystem.TestFSCommon.test_write_sys_error              0.007

Change-Id: I50b1745bb4bccdc4662440c80c14a04dcf3efa00
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-07-25 15:48:24 +02:00
Balazs Gibizer ae3ae0700d Print ThreadPool statistics
To observe the actual size of our pools and catch hanging threads in the
pools nova will log statistics of the executors each time a new work is
submitted but not more frequently than X seconds configurable via
[DEFAULT]thread_pool_statistic_period. But the default of the config is
-1 so the logging is disabled out of the box.

Most of the support should come from futurist but it isn't.
We can add them later there.

Change-Id: Id4244f5ae0fd49c99af2898789cdd510859e150d
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-07-25 14:54:04 +02:00
Zuul d699d771b1 Merge "api: Add response body schemas for networks API" 2025-07-24 20:19:30 +00:00
Zuul 6b4c19fddf Merge "Implement sound model extra spec for libvirt." 2025-07-24 14:24:39 +00:00
Zuul 940d85fc6b Merge "api: Add response body schemas for removed APIs" 2025-07-24 06:11:06 +00:00
Zuul fa13535aac Merge "libvirt: Add objects and notifications for sound model." 2025-07-23 17:14:27 +00:00
Ghanshyam Mann 06699f26a5 Add project manager role in Nova API policy rule
Keystone project manager role can be used for the project-level
management APIs. Nova introduced the manager role in policy
defaults.

To introduced the manager role, we need to make migrations
policies more granular. Adding the separate policies for host
related operation allow us to open the migration operations
to project manager role. Existing policy is checked if migration
without specifying host and new policy is checked if host is
specified. Same will be applied to list migrations, new policy
will control to return the host info.

Also, Adding doc and releasenotes.

Partial implement blueprint policy-manager-role-default

Change-Id: Ie7d135e4d24ac6d53c46a4c69ade0b0bda554e71
Signed-off-by: Ghanshyam Mann <gmaan@ghanshyammann.com>
Signed-off-by: ghanshyam <gmaan@ghanshyammann.com>
2025-07-22 21:49:28 +00:00
Zuul 6053bb2722 Merge "api: Address issues with server group APIs" 2025-07-22 21:14:35 +00:00
Zuul 240c4a0605 Merge "api: Add response body schemas for server group APIs" 2025-07-22 18:13:13 +00:00
Zuul f315c7b581 Merge "Make the default executor configurable" 2025-07-22 16:48:11 +00:00
Zuul 5ede0cd027 Merge "Rename DEFAULT_GREEN_POOL to DEFAULT_EXECUTOR" 2025-07-22 16:47:58 +00:00
Zuul c741689878 Merge "api: Add response body schemas for server password APIs" 2025-07-22 13:48:35 +00:00
Zuul 2010536d12 Merge "api: Add response body schemas for server external events API" 2025-07-21 21:43:12 +00:00
Zuul 2a8ae9eae7 Merge "Make nova.utils.pass_context private" 2025-07-18 15:23:31 +00:00
Zuul 770a6f1eab Merge "Move ConductorManager to use spawn_on" 2025-07-17 16:17:57 +00:00
Zuul f484c4089d Merge "Add Project Manager role context in unit tests" 2025-07-16 17:19:32 +00:00
Zuul 03f41a7f8a Merge "FUP: Translate scatter-gather to futurist" 2025-07-16 17:19:20 +00:00
Zuul 19d621a66f Merge "Move ComputeManager to use spawn_on" 2025-07-16 12:09:12 +00:00
Balazs Gibizer c5feba11ff Make the default executor configurable
This patch adds the logic to initialize our DEFAULT_EXECUTOR based on
the concurrency mode.

If the OS_NOVA_DISABLE_EVENTLET_PATCHING env variable is set to "true"
then we use ThreadPoolExecutor so the service will use native threads.
Otherwise the service will keep using the GreenThreadPoolExecutor and
therefore using Eventlet.

There is a new config option `[DEFAULT]default_thread_pool_size`
added to define the size of the ThreadPoolExecutor and the existing
`[DEFAULT]default_green_pool_size` is deprecated. The two config options
are independent and each of them is only used if the service is started
with the matching concurrency mode.

Our test fixture that catches leaked threads are adapted to handle both
threading mode. But at the moment it is only tested with the eventlet
mode as no service can be switched to threading mode yet.

Change-Id: I17b8065e8b14f0401297258e43dc2a98031d61f4
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-07-11 15:28:12 +02:00