Commit Graph

61445 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
Ghanshyam Mann 38f978d39a Add Project Manager role context in unit tests
As part of the this BP[1], we are going to add the
Project Manager role as default in API policies.

This commit adds the project manager role context
in the policies unit tests so that when we change
the policy default to project manager then we can
know how the changes/permission will looks like.

NOTE: This does not change any policy default, only
adding manager context in existing unit tests.

Partial implement blueprint policy-manager-role-default

[1] https://blueprints.launchpad.net/nova/+spec/policy-manager-role-default

Change-Id: Ib1622e7593108aa4fac65fcc34cb616502abed94
Signed-off-by: Ghanshyam Mann <gmaan@ghanshyammann.com>
2025-06-18 14:27:02 -07:00
Zuul 64ca204c9c Merge "api: Address issues with instance actions API" 2025-06-16 15:05:21 +00:00
Pierre Riteau 1efbbc8d5f Remove Unicode characters
Change-Id: I1b01b42efceb5430b3eda54531eb843c0c73ab68
2025-06-13 23:53:55 +02:00
Zuul d75507e679 Merge "api: Address issues with hypervisors APIs" 2025-06-12 14:16:30 +00:00
Zuul 07e573ab4f Merge "api: Add response body schemas for hypervisors APIs (3/3)" 2025-06-12 13:57:11 +00:00
Zuul 20ef126cdb Merge "Cache [pci]alias parsing" 2025-06-12 03:31:23 +00:00
Zuul 856d2ddca3 Merge "Validate [pci]alias at service startup" 2025-06-12 03:31:11 +00:00
Zuul 3e11280522 Merge "Validated that PCI alias has proper ids" 2025-06-12 03:28:54 +00:00
Zuul 45623879d9 Merge "Multiple spec per PCI alias limitation" 2025-06-12 03:28:17 +00:00
Zuul 03a828720f Merge "Return HTTP400 for multi spec pci alias if PCI in Placement" 2025-06-12 03:28:05 +00:00
Zuul c11f807ae7 Merge "reorder and extend pre-commit hooks" 2025-06-12 03:13:34 +00:00
Zuul d66a0e2220 Merge "Allow autopep8 to fix more things" 2025-06-12 03:13:22 +00:00
Zuul c127d87f02 Merge "Remove unused config options" 2025-06-11 22:43:02 +00:00
Zuul dc03416d7c Merge "Add functional reproducer for bug 2102038" 2025-06-11 14:32:34 +00:00
Balazs Gibizer 0065bb6cd4 Cache [pci]alias parsing
For each lifecycle operation nova re-load, parses, and validates the
[pci]alias config option. This is wasteful. So this patch adds
functools.cache decorator on the function used to do this work.

Change-Id: If2ffb25430749a22c923c0938221833e7b883873
2025-06-11 07:23:01 -07:00
Balazs Gibizer ae064caf16 Validate [pci]alias at service startup
Both nova-api and nova-compute depends on the [pci]alias configuration.
These services loaded and validated the config lazily when it was
needed. This can late and hard to troubleshoot failures during instance
lifecycle operations due to simple config errors.

So this patch adds an early load of this config to nova-api and
nova-compute.

Related-Bug: #2102038
Related-Bug: #2111440
Change-Id: I5d5dc912ca24979067984c7cb53ceaded7daf236
2025-06-11 07:23:01 -07:00
Balazs Gibizer acc6221660 Validated that PCI alias has proper ids
Either the vendor_id and product_id needs to be set or the
resource_class needs to be set in each alias. This is now validated when
the alias is parsed to avoid late failure during placement
allocation_candidates query.

Closes-Bug: #2111440
Change-Id: I7fd43b3d6faac8c4098b0983e8adc596414823a1
2025-06-11 07:23:01 -07:00
Balazs Gibizer c3f392dd8e Multiple spec per PCI alias limitation
Document and the limitation of the PCI in Placement feature that it
does not support [pci]alias configuration where the name of the alias is
repeated. E.g.

[pci]
alias = { "name": "vf1", "product_id":"10ca", "vendor_id":"8086", "device_type":"type-VF"}
alias = { "name": "vf1", "product_id":"f000", "vendor_id":"8086", "device_type":"type-VF"}

This would mean the alias vf1 can be fulfilled from devices with product
id 10ca OR f000. However this OR relationship cannot be encoded to a
single Placement allocation query as Placement does not support
requesting alternative resource classes for a request[2].

This limitation was encoded in the original PCI in Placement
implementation[1] but we missed to mention it in the doc.
This is now fixed.

[1]https://github.com/openstack/nova/blob/0d484ce37d86e989c8abdf57aec5e334f68206ef/nova/objects/request_spec.py#L504-L528
[2]https://docs.openstack.org/api-ref/placement/#list-allocation-candidates

Related-Bug: #2102038
Change-Id: I9dd78b1498f870a4e4c3f26c23d42d105aec0350
2025-06-11 07:23:00 -07:00
Balazs Gibizer 0bfac5c7fe Return HTTP400 for multi spec pci alias if PCI in Placement
PCI in Placement never supported PCI aliases with multiple specs, i.e.
when an alias name is used in multiple alias definitions. The code
raised ValueError late and without a proper error message. Now
PciInvalidAlias with a descriptive message is raised instead.

Closes-Bug: #2102038
Change-Id: Id1407a37dc5ddad22d8dbf7d589ed998ffc2804e
2025-06-11 07:22:05 -07:00
Stephen Finucane a0af4648b5 api: Address issues with hypervisors APIs
* Address an off-by-one error: the cpu_info field was modified in v2.28,
  not v2.27,
* Correct the api-ref to indicate that the 'servers' field is not
  actually required and will be missing if '?with_servers=false', while
  the 'name' and 'uuid' fields of servers entries *are* required.
* Clarify a comment about the above in the schemas.
* Uncouple the '_hypervisor_response' and '_hypervisor_detail_response'
  helper schemas. The minor increase in lines of code is worth it for
  the decrease in complexity.
* Add the 'host_ip', 'hypervisor_type', and 'hypervisor_version' fields
  to the list of required fields for "detail"-style responses (show and
  detailed list).
* Make the 'current_workload', 'disk_available_least', 'free_disk_gb',
  'free_ram_mb', 'host_ip' and 'running_vms' fields of the hypervisor
  "detail"-style responses nullable, and the 'current_workload',
  'disk_available_least', 'free_disk_gb', 'free_ram_mb' and
  'running_vms' fields of the deprecated statistics API nullable.

Change-Id: Ibe55b44e65fe17141c63cceae8a003816ffe4f23
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-06-11 13:07:54 +01:00
Zuul 2270c4ac94 Merge "api: Add response body schemas for hypervisors APIs (2/3)" 2025-06-11 08:17:05 +00:00
Zuul 3999899f75 Merge "api: Add response body schemas for hypervisors APIs (1/3)" 2025-06-11 03:36:38 +00:00
Zuul 03edd00bfe Merge "api: Add response body schemas for instance actions" 2025-06-10 22:47:33 +00:00
Zuul c2e5f8c4c7 Merge "api: Add response body schemas for hosts APIs" 2025-06-10 22:39:21 +00:00
Zuul 517415b6cb Merge "update pre-commit version pins" 2025-06-10 16:23:41 +00:00
Stephen Finucane f09904f62d api: Address issues with instance actions API
The user_id and project_id fields can be null. Explain why.

Change-Id: I34353ec7e55845a83f5e2f1dc4b41dead4ac5c81
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-06-10 11:50:50 +01:00
Arnaud Morin c4c5134369 Fix small documentation issue
Small documentation fix

Change-Id: Ibb650cf428eb9c20be1fdd0a4caee15fa6d309b7
Signed-off-by: Arnaud Morin <arnaud.morin@ovhcloud.com>
2025-06-09 18:14:43 +02:00
Zuul 21943b5521 Merge "doc: Add missing API samples" 2025-06-08 23:14:07 +00:00
Zuul 9d389f5ffe Merge "tests: Ensure all APIs have a response body schema" 2025-06-08 22:51:30 +00:00
Zuul eea33f9dad Merge "api: Simplify parameter types" 2025-06-08 16:38:34 +00:00
Zuul b82443eed3 Merge "api: Only run format checks on strings" 2025-06-07 16:20:51 +00:00
Zuul f1eaf682fe Merge "api: Add new, simpler api_version decorator" 2025-06-07 07:14:40 +00:00
Zuul a2b9dc1b4e Merge "api: Only check minimum API version" 2025-06-07 02:53:03 +00:00
Zuul ff281bbe34 Merge "api: Stop using wsgi.Controller.api_version to switch between API versions" 2025-06-06 20:17:56 +00:00
Zuul 38d06f41a9 Merge "[tool] Fix backport validator for non-SLURP" 2025-06-06 15:58:08 +00:00
Balazs Gibizer b3aefbcb58 Remove unused config options
In c12eebd4c6 we missed that there are
another set of config option that become unused now. So this is a follow
up patch to remove those as well.

Change-Id: Ie00805b5f72b118db134aeb8399ef4c72f434966
2025-06-06 13:31:00 +02:00
Zuul 68c2341b76 Merge "doc: Fix Caracal release number" 2025-06-05 20:14:46 +00:00
Pierre Riteau 6ba5168da8 doc: Fix Caracal release number
Change-Id: Id942d65c657bf537b7953e344aa31b747f78fec6
2025-06-05 17:45:14 +01:00
Dan Smith 93af6dce29 Remove contrib/clean-on-delete.py
This removes the script from our contrib directory now that it is
moved to https://opendev.org/openstack/nova-contrib

Change-Id: I09c3b3e73f8b6bcb4223bed20c456bb582b55bcd
2025-06-04 10:45:55 -07:00
Balazs Gibizer a1c47fc242 [doc]Clarify where to set pci_in_placement
The doc is now clarifying that [filter_scheduler]pci_in_placement needs
to be set to nova-api, nova-scheduler, and nova-conductor config as
well.

Closes-Bug: #2112303
Change-Id: I3c7be2f109a97ef5cc4b2dc76cb7c58ef8c68afa
2025-06-02 11:12:14 +02:00
Zuul 6a1c2bbcd8 Merge "api: Adjust validation helpers for a single-method future" 2025-05-29 23:52:58 +00:00
Zuul 3a9ec3b45a Merge "libvirt: Use common naming convention for ephemeral disk labels" 2025-05-29 21:13:08 +00:00
Balazs Gibizer ebf5aca101 Add functional reproducer for bug 2102038
Related-Bug: #2102038
Change-Id: Ia950fc16ac5bb890baaa826580e7cb05d64831df
2025-05-27 16:14:07 +02:00
Dan Smith 221a3e89e8 Revert "Support glance's new location API"
Due to glance behavioral changes, using the new location API causes
async hashing jobs to create confusion for tooling not expecting
undeletable images.

Revert this until glance can resolve the issue.

This reverts commit eab0de2900.

Change-Id: Ifc4631720a1872cb6d93e9ee490c19edd1a7b98e
2025-05-19 08:58:58 -07:00
Zuul 42f80b94ad Merge "Mention IRC topic update in PTL post-PTG checklist" 2025-05-19 10:20:49 +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
Zuul d24e158ff2 Merge "Amend functional reproducer for bug 1899835" 2025-05-15 12:46:08 +00:00