Commit Graph

2404 Commits

Author SHA1 Message Date
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
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 517415b6cb Merge "update pre-commit version pins" 2025-06-10 16:23:41 +00:00
melanie witt 82856f95c6 libvirt: Use common naming convention for ephemeral disk labels
The _create_ephemeral() method is responsible for creating ephemeral
disks with image type "raw" and formatting them with mkfs. In the case
of [libvirt]images_type "qcow2", _create_ephemeral() will create
backing files.

Currently we are not using a consistent naming convention for choosing
the filesystem label for ephemeral disks. When we create a server for
example, we go through the disks and label them "ephemeral0",
"ephemeral1", "ephemeral2", etc.

When we hard reboot a server, there is a check to create missing
backing files and if so, a new backing file will be created but instead
of being labeled "ephemeralN" the code attempts to label them with the
name of the backing file itself for example "ephemeral_1_40d1d2c". This
will fail if the filesystem used for ephemeral disks has limitations on
the length of filesystem label names (VFAT, XFS, ...). For example:

  mkfs.vfat: Label can be no longer than 11 characters

This adds a helper method for obtaining ephemeral disks filesystem
label names and uses it the same way in the few places fs_label is
specified.

Closes-Bug: #2061701

Change-Id: Id033a5760272e4fb06dee2342414b26aa16ffe24
2025-05-19 09:27:18 +00:00
Zuul cda0d82570 Merge "live migration: Avoid volume rollback mismatches" 2025-05-16 04:49:25 +00:00
Sean Mooney 87c0c201a3 update pre-commit version pins
This change bumps to the latest version of each
of our pre-commit hooks. Of note this add py3.13
support to autopep8.

Codespell was also updated and the new spelling
issues resolved.

Change-Id: I1aab019ffb0ee9366a7d26515bef1335d09044df
2025-05-08 23:29:13 +01:00
melanie witt 5a55a78d51 live migration: Avoid volume rollback mismatches
The tl;dr is to 1) avoid trying to disconnect volumes on the
destination if they were never connected in the first place and
2) avoid trying to disconnect volumes on the destination using block
device info for the source.

Details:

* Only remotely disconnect volumes on the destination if the failure
  was not during pre_live_migration(). When pre_live_migration() fails,
  its exception handling deletes the Cinder attachment that was created
  before re-raising and returning from the RPC call. And the BDM
  connection_info in the database is not guaranteed to reference the
  destination because a failure could have happened after the Cinder
  attachment was created but before the new connection_info was saved
  back to the database.  In this scenario, there is no way to reliably
  disconnect volumes in the destination remotely from the source because
  the destination connection_info needed to do it might not be
  available.

* Due to the first point, this adds exception handling to disconnect
  the volumes while still on the destination, while the destination
  connection_info is still available instead of trying to do it
  remotely from the source afterward.

* Do not pass Cinder volume block_device_info when calling
  rollback_live_migration_on_destination() because volume BDM records
  have already been rolled back to contain info for the source by
  that point. Not passing volume block_device_info will prevent
  driver.destroy() and subsequently driver.cleanup() from attempting to
  disconnect volumes on the destination using connection_info for the
  source.

Closes-Bug: #1899835

Change-Id: Ia62b99a16bfc802b8ba895c31780e9956aa74c2d
2025-04-28 18:11:25 -07:00
Sean Mooney 02d72b9d56 Remove nova debugger functionality
The nova debuger functionality was intended
to help debugging running process however it has
never been reliable due to our use of eventlet and is generally
not required when not using eventlet. I.e. you can just
run the nova console-scripts form a debugger or add pdb
statements as required.

As part of the eventlet removal the debugger functionality is
removed given its untested and undocumented.

Change-Id: I7bf88f06f3d1dbd2c7e342b27a21440a123c631d
2025-04-25 14:37:44 +02:00
Zuul 2762a73c5b Merge "Use dict object for request_specs_dict in the _list_view" 2025-04-23 23:16:46 +00:00
Balazs Gibizer 05b219746f Remove eventlet based WSGI server entry points
Nova deprecated[1] running the API services under Eventlet in the Rocky
release 6 years ago. Now that we are trying to transition away from
Eventlet it is time to rip out these entry points fully.

[1] b53d81b03c

Change-Id: Ie758550c0b8fb02aeb398396961467d9f845fcc9
2025-04-15 15:03:43 +02:00
Zuul 6e37eeaeb3 Merge "Add one-time-use devices docs and reno" 2025-04-08 01:50:31 +00:00
Masahito Muroi 509820f156 Use dict object for request_specs_dict in the _list_view
The request_specs_dict in the _list_view is initialized as a
defaultdict object in order to return empty string as default.
But the request_spec_dict is replaced with a normal dict object in
the v2.96 microversion, then if server list and RequestSpec missmatch
happens by any reason, the List Server API and the List
Server Detail API hit 500 Internal server error because of key error.

This commit updates the req_spec_dict to use normal dict object, then
it returns sentinel object if there is no appropriate
request_spec object.

Closes-Bug: #2095364
Change-Id: If282b8709954f276cb5d48114437809d771a9958
2025-04-04 17:06:25 +09:00
Dan Smith 3dc42b8422 Add one-time-use devices docs and reno
This adds documentation to the PCI-passthrough doc in the admin guide,
explaining how to use one-time-use devices.

Keeping this separate so we can iterate on it separate from the code.

Related to blueprint one-time-use-devices

Change-Id: Iff91c0726bbb37c7a3ef885a73e3c3586feb6004
2025-04-02 11:53:54 -07:00
Zuul 9d910ec4bf Merge "Imported Translations from Zanata" 2025-04-02 12:57:38 +00:00
Zuul adfd486810 Merge "ironic: fix logging of validation errors" 2025-04-02 01:11:09 +00:00
Zuul 725a307693 Merge "Update master for stable/2025.1" 2025-03-25 15:57:34 +00:00
Zuul caa379116e Merge "wrap wsgi_app.init_application with latch_error_on_raise" 2025-03-25 04:35:20 +00:00
Sean Mooney 8dcbbe43e7 wrap wsgi_app.init_application with latch_error_on_raise
This change adds a latch_error_on_raise decorator which
is applied to the init_applciation function in our
common wsgi_app module.

This decorator will catch all non retryable exceptions
and cause future invocations of the function to always
return that same exception forever.

a reset function is also added to the decorated function
which should be called in our bases test class to
prevent cross test interactons.

Closes-Bug: #2103811
Related-Bug: #1882094
Change-Id: I44b1f7e2acc36a5b557d6d8788f6099f52bbdfb8
2025-03-24 23:37:12 +00:00
Zuul 76c3c4c1bd Merge "Ignore metadata tags in pci/stats _find_pool logic" 2025-03-19 22:04:07 +00:00
Balazs Gibizer 229fb3513a Ignore metadata tags in pci/stats _find_pool logic
The stats module uses the _find_pool() call to find a matching pool for
a new device or a device that is being deallocated. If no existing pool
matches with the dev then then a new pool is created for it. The
pool matching logic was faulty as it did not remove all the metadata
keys from the pool like rp_uuid. So if the dev did not have that key but
the pool did then the dev did not match.

On the other hand the PCI allocation logic (when PCI in Placement is
enabled) assumed that devices from a single rp_uuid are always in a
single pool. As this assumption was broken by the above bug the PCI
allocation blindly tried to allocate resources for an rp_uuid from each
matching pool causing overallocation.

The main fix in this patch is to ignore the metadata tags in
_find_pool(). But also two safety net are added to the allocation logic.
The logic now asserts that the assumption is correct and if not (i.e. it
found multiple pools with the same rp_uuid) then it bails out. It also
does not ever blindly allocate the same rp_uuid request from multiple
pools.

Closes-Bug: #2098496
Change-Id: I9678230397fa1a3c735ee01ed756d5af3b4e1191
2025-03-19 18:25:59 +01:00
OpenStack Proposal Bot 5ef6eae174 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: Ifb48bcf17cda8936e4ec3b20269ca9580335ece3
2025-03-19 04:01:16 +00:00
OpenStack Release Bot 932d2334c2 Update master for stable/2025.1
Add file to the reno documentation build to show release notes for
stable/2025.1.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2025.1.

Sem-Ver: feature
Change-Id: Iba42aa129140dc494d99dede17f5ea7b44062d62
2025-03-18 16:27:31 +00:00
Zuul 6042300453 Merge "Bump MIN_{LIBVIRT,QEMU} for "Epoxy"" 2025-03-18 12:43:44 +00:00
Sylvain Bauza 8197f7d5a6 Add Epoxy prelude section
Shamelessly copied from the cycle highlights

Change-Id: I9c949db80ad795d67e75c464eec6cc683e80f4af
2025-03-18 09:19:00 +01:00
Doug Goldstein 37888e875f ironic: fix logging of validation errors
When validation of the node fails, since switching to the SDK the
address of the ValidationResult object is displayed instead of the
actual message. This has been broken since patch
Ibb5b168ee0944463b996e96f033bd3dfb498e304.

Closes-Bug: 2100009
Change-Id: I8fbdaadd125ece6a3050b2fbb772a7bd5d7e5304
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2025-03-17 17:04:01 -05:00
Zuul f71a0a6204 Merge "Fix serial console for ironic" 2025-03-12 12:26:06 +00:00
Zuul a329c103cb Merge "Update driver to map the targeted address for SR-IOV PCI devices" 2025-03-10 20:20:19 +00:00
Zuul 6e51c83d28 Merge "Fix parameter order in add_instance_info_to_node" 2025-03-10 14:09:22 +00:00
Vasyl Saienko bf8883ca3b Fix serial console for ironic
Allign code after we switched to openstacksdk in ironic virt driver
related to serial console.

Closes-Bug: #2099872

Depends-On: https://review.opendev.org/c/openstack/requirements/+/942889

Change-Id: Ic25c5e8b9ac9cf87f4f96c9956140aa4f6576ded
2025-03-05 05:07:55 +00:00
Zuul 406eedb1ce Merge "Fix microversion 2.98 doc/tests for update/rebuild APIs" 2025-03-04 01:45:13 +00:00
Zuul cf326d4375 Merge "Fix microversion 2.96 for update/rebuild APIs" 2025-03-04 01:38:24 +00:00
René Ribaud fd656f3943 Update driver to map the targeted address for SR-IOV PCI devices
This patch checks the revision of QEMU and libvirt to ensure support
for VFIO SR-IOV device migration.
It also updates the _live_migration_operation() function, particularly
the get_updated_guest_xml() function, to map source PCI addresses
to destination addresses in the destination XML file, using the data
provided by the LiveMigrateData object.

The target goal of these series of patch is to enable VFIO devices
migration with kernel variant drivers.

Partially-Implements: blueprint migrate-vfio-devices-using-kernel-variant-drivers
Change-Id: I62ec475988eab8de948498f50d8d4c0d47321102
2025-03-03 20:50:35 +01:00
René Ribaud 03915cd59d Update driver to deal with managed flag
The target goal of these series of patch is to enable VFIO devices
with kernel variant drivers.

Implements: blueprint enable-vfio-devices-with-kernel-variant-drivers
Change-Id: I7949ba6da8b6257865d8e9e48bf3feabc10bdf17
2025-03-02 21:37:47 +01:00
Zuul e6b8b051a9 Merge "libvirt: Add new option to enforce multipath volume connections" 2025-03-01 14:09:09 +00:00
Ghanshyam Mann 7a00971b8f Fix microversion 2.98 doc/tests for update/rebuild APIs
microversion 2.98 changed the GET and GET list details
API response to expand the image field
- https://review.opendev.org/c/openstack/nova/+/939649

but when we change the views/servers.py then update server
and rebuild server API response also gets updated.
- https://review.opendev.org/c/openstack/nova/+/939649/12/nova/api/openstack/compute/views/servers.py#595

The microversion change actually changed the response for
the update and rebuild API but did not update the documentation
about this change. Neither added test for rebuild and update
which verify the response change.

Since microversion 2.75, we have made all these 4 APIs response
consistent.

Implements: blueprint image-properties-in-server-show

Change-Id: Ifc2edc59c601391a31fd8953c742969e5b368767
2025-02-28 17:13:59 +00:00
Ghanshyam Mann f9e89bc0d1 Fix microversion 2.96 for update/rebuild APIs
microversion 2.96 changed the GET and GET list details
APi response to add a new field 'pinned_availability_zone'
- https://review.opendev.org/c/openstack/nova/+/904568

but when we change the views/servers.py then update server
and rebuild server API response also gets updated.
- https://review.opendev.org/c/openstack/nova/+/904568/17/nova/api/openstack/compute/views/servers.py#309

The microversion change actually changed the response for
the update and rebuild API but did not update the documentation
about this change. Neither added test for rebuild and update
which verify the response change.

Since microversion 2.75, we have made all these 4 APIs response
consistent.

Change-Id: I31fbb3c5e689302713bfb7a254c5d0cc12de2dc4
2025-02-28 17:06:18 +00:00
Zuul a933c7fbab Merge "Add support for showing scheduler_hints in server details" 2025-02-28 02:14:07 +00:00
Takashi Kajinami 4aab14a09f libvirt: Add new option to enforce multipath volume connections
Currently, even when [libvirt] volume_use_multipath is set to True,
volume attachment silently falls back to single path if multipathd is
not running in the host. This sometimes prevents operators from
noticing the misconfiguration, until they face any issue caused by
missing redundancy.

Introduce the new [libvirt] volume_enforce_multipath option, which
makes the attachment process fail if multipathd is not running.
A similar parameter (enforce_multipath_for_image_xfer) was already
implemented in cinder and this change follows how the parameter is
implemented there.

Also add the check in init phase to detect lack of mulitipath daemon
during initializing driver.

Min version of os-brick has to be bumped due to the interface change
made by 8d919696a9f1b1361f00aac7032647b5e1656082 .

Implements: blueprint enforce-multipath
Change-Id: I828de70ca7b343a4562ace4049d2b3857dbf900a
2025-02-28 08:52:25 +09:00
René Ribaud f7d99623ed Bump MIN_{LIBVIRT,QEMU} for "Epoxy"
The minimum required version of QEMU is now 6.2.0, and of libvirt is
8.0.0.

Minimum cleanup to make the tests happy.
Adjust the related unit tests accordingly.

Following patch will clean all constants not useful anymore.

Change-Id: I381a6c180494ed7b6ae47853132673f153733587
2025-02-27 11:52:01 +01:00
Douglas Viroel 2db8af71dd Add support for showing scheduler_hints in server details
Nova currently lacks a straightforward way to expose scheduler hints
associated with a server. This change extends existing Nova's
API to allow users to retrieve this information when it is available.
It adds a new API microversion to support returning the associated
scheduler_hints in ``GET /servers/{server_id}``, `GET /servers/detail``,
``PUT /servers/{server_id}`` and ``POST /server/{server_id}/action``
(rebuild) responses.

Implements: blueprint show-scheduler-hints-in-server-details
Change-Id: If0070cfbc218e0515bf3b58fc8c5067ae22c7072
2025-02-26 17:50:25 -03:00
Zuul 8f57fa7359 Merge "Fix detaching devices by alias with mdevs" 2025-02-26 10:38:36 +00:00
Zuul 8de6a43a43 Merge "Per-Property ImageMetaPropsWeigher" 2025-02-25 19:16:49 +00:00
Michael Still cbc263f6bc libvirt: allow direct SPICE connections to qemu
This patch adds a new console type, "spice-direct", which provides
the connection information required to talk the native SPICE protocol
directly to qemu on the hypervisor. This is intended to be fronted
by a proxy which will handle authentication separately.

A new microversion is introduced which adds the type "spice-direct"
to the existing "spice" protocol.

An example request:

POST /servers/<uuid>/remote-consoles
{
  "remote_console": {
    "protocol": "spice",
    "type": "spice-direct"
  }
}

An example response:

{
  "remote_console": {
    "protocol": "spice",
    "type": "spice-direct",
    "url": "http://localhost:13200/nova?token=XXX";
  }
}

This token can then be used to lookup connection details for the
console using a request like this:

GET /os-console-auth-tokens/<consoletoken>

Which returns something like this:

{
  "console": {
    "instance_uuid": <uuid>,
    "host": <hypervisor>,
    "port": <a TCP port number>,
    "tls_port": <another TCP port number>,
    "internal_access_path": null
  }
}

APIImpact

Change-Id: I1e701cbabc0e2c435685e31465159eec09e3b1a0
2025-02-22 08:25:38 +11:00
Zuul 375d95565d Merge "FUP for reno issues" 2025-02-20 20:16:45 +00:00
Zuul d00a4d4f0f Merge "move nova-ovs-hybrid-plug to deploy with spice and fix qxl default" 2025-02-20 20:16:38 +00:00
Zuul 43eaed3016 Merge "Add a new ImagePropertiesWeigher" 2025-02-20 18:02:27 +00:00
Sean Mooney 08cbf0f4b1 FUP for reno issues
this change addresses nits in the
make-virtio-the-default-spice-video releasenote

Change-Id: I1d8782cf91375b88c1c119ef4de8a9868b7a60f1
2025-02-20 17:43:13 +00:00
Sylvain Bauza 7388362f28 Per-Property ImageMetaPropsWeigher
Add a new config option that will only check specific properties
and allow per-property weights.

Change-Id: Iae51558b9eb03da705e0da939cbd459b4d3b51f7
2025-02-20 03:00:03 +00:00
Sylvain Bauza acd6c733c6 Add a new ImagePropertiesWeigher
This weigher will check how many instances in the host have the image
properties that are requested and will prefer by default to pack
instances with the same properties.

Implements blueprint: image-metadata-props-weigher

Change-Id: I3bfed44bd089c6b226d13c3ac4a0003411737cbd
2025-02-20 02:49:08 +00:00
Sean Mooney d4f40976d0 move nova-ovs-hybrid-plug to deploy with spice and fix qxl default
In centos/rhel 9 qemu supprot for the qxl model was removed
with the removal of spice support.
In ubuntu 24.04 qemu support for qxl and spice supprot
has now also been removed.
debian 12 bookworm still support spice in there qemu package.

When we updated the default video model to virtio for x86 we
left a config driven special case for spice to default to qxl
since that nolonger works on centos or ubuntu based distos that
default is not helpful so this change removes the special case
making virtio the default for x86 regardless of the console used.

This change also updates the nova-ovs-hybrid-plug to test with spice
so that we have at least one job using it. to enable that the job is
moved to debian.

Closes-Bug: #2097529
Change-Id: I265ad2ced3729bed41bf53c58dcebadb775ce1f7
2025-02-19 17:09:09 +00:00