Commit Graph

60900 Commits

Author SHA1 Message Date
Zuul 7e082705de Merge "add pyproject.toml to support pip 23.1" 2024-08-29 21:22:40 +00:00
Zuul 3b1ea29af7 Merge "api: Fix typo" 2024-08-29 21:22:19 +00:00
Zuul 46b76da3ad Merge "Report availability of stateless firmware support" 2024-08-29 18:25:53 +00:00
Dr. Jens Harbott 5fa069c29a Delete ./doc/source/_static/support-matrix.css file
This file is being automatically generated during the docs build, no
need to have it persisted in git.

Change-Id: Ib45f722cc305e1d828d31724535e31ad3dda6c2e
2024-08-29 09:27:04 +02:00
Sean Mooney 8464abe56c add pyproject.toml to support pip 23.1
pip 23.1 removed the "setup.py install" fallback for projects
that do not have pyproject.toml and now uses a pyproject.toml
which is vendored in pip.
To address that, this change adds the minimal pyproject.toml
to enable pbr to be properly used to build editable wheels.

This is required to support installing devstack on
centos stream 9 and related distros with GLOBAL_VENV=True
Without this change the wsgi scripts are not generated in
editable mode. i.e. pip install -e /opt/stack/keystone

See https://pip.pypa.io/en/stable/news/#v23-1
and https://github.com/pypa/pip/issues/8368 for more
details on the removal of the fallback support.

setuptools v64.0.0 is used to support editable installs
via its PEP-660 implmentation
https://github.com/pypa/setuptools/pull/3488

Depends-On: https://review.opendev.org/c/openstack/devstack/+/902758
Change-Id: I3255edb67fd7fe7a25b5871ec071c4b4c9d98ac2
2024-08-28 23:30:21 +00:00
Zuul 8fb5a76872 Merge "libvirt: call get_capabilities() with all CPUs online" 2024-08-28 19:22:28 +00:00
Zuul b3a2494728 Merge "Use format_inspector from oslo" 2024-08-27 18:54:30 +00:00
Zuul 01b207e50d Merge "Deprecate AMI image formats" 2024-08-26 21:31:41 +00:00
Dan Smith d854e7cc16 Use format_inspector from oslo
This removes the in-tree format_inspector and makes us use the one in
oslo.utils. Minor changes are required around the behavior of the
safety_check() (raising instead of returning). This also allows images
detected as 'gpt' but registered as 'raw', since that's how everything
currently works. Hopefully later we can start registering in glance as
gpt, and rejecting boots from raw images.

Change-Id: I5b89e17438157690495961c306861a06532c8b4e
Depends-On: https://review.opendev.org/c/openstack/tempest/+/927146
2024-08-26 07:21:48 -07:00
Zuul 3bdb298e68 Merge "Fix wrong nova-manage command in upgrade check" 2024-08-22 15:35:51 +00:00
Zuul a2cc66a377 Merge "Fix deepcopy usage for BlockDeviceMapping in get_root_info" 2024-08-21 02:33:27 +00:00
Zhang Hua 065bf99fc7 Fix deepcopy usage for BlockDeviceMapping in get_root_info
The method get_root_info sometimes receives a BlockDeviceMapping object,
which lacks a copy method. The previous code assumed root_bdm was always
an instance of DriverBlockDevice, a subclass of dict that supports the copy()
method. However, during testing, it was discovered that root_bdm could also
be a BlockDeviceMapping object, which does not have a copy method.

To address this, the change replaces the copy() call with copy.deepcopy()
according to the suggestion in the comment [1], which works for both
BlockDeviceMapping and DriverBlockDevice instances. The deepcopy method is
supported because oslo.versionedobjects implements the __deepcopy__ method.

This change ensures the function handles both object types correctly,
preventing the AttributeError observed during testing.

[1] https://review.opendev.org/c/openstack/nova/+/909611/4/nova/virt/libvirt/blockinfo.py

Change-Id: I9432718586855ff57e8e6a5cae064e0685dd01e8
2024-08-20 21:48:59 +00:00
Zuul 0b091179d5 Merge "[libvirt]log XML if nova fails to parse it" 2024-08-20 03:37:34 +00:00
Takashi Kajinami b475f0f99b Report availability of stateless firmware support
This is the first step to support launching instances with stateless
firmware. At this stage none of the virt drivers report the trait to
support the feature.

Depends-on: https://review.opendev.org/c/openstack/os-traits/+/908885
Partially-Implements: blueprint libvirt-stateless-firmware
Change-Id: I4c1df950af11687ae5a52e4eba7943029ec36e69
2024-08-20 09:16:40 +09:00
Zuul 0aedee0e9b Merge "Fix PCI passthrough cleanup on reschedule" 2024-08-19 17:15:00 +00:00
Balazs Gibizer 87ee88f10a [libvirt]log XML if nova fails to parse it
In case nova fails to parse the XML from libvirt the lxml exception is
dumped to the log but it only states the location of the error in the
XML string like

  lxml.etree.XMLSyntaxError: StartTag: invalid element name, line 40, column 35

To be able to troubleshoot the actual XML error we need to see the
invalid XML as well. So this patch makes sure that if nova fails to
parse the XML then the XML itself is dumped to DEBUG log.

Change-Id: I14cce6db4c86f663e61d3668d081858741e88add
2024-08-17 22:24:15 +02:00
Artom Lifshitz 79d1f06094 libvirt: call get_capabilities() with all CPUs online
While we do cache the hosts's capabilities in self._caps in the
libvirt Host object, if we happen to fist call get_capabilities() with
some of our dedicated CPUs offline, libvirt erroneously reports them
as being on socket 0 regardless of their real socket. We would then
cache that topology, thus breaking pretty much all of our NUMA
accounting.

To fix this, this patch makes sure to call get_capabilities()
immediately upon host init, and to power up all our dedicated CPUs
before doing so. That way, we cache their real socket ID.

For testing, because we don't really want to implement a libvirt bug
in our Python libvirt fixture, we make due with a simple unit tests
that asserts that init_host() has powered on the correct CPUs.

Closes-bug: 2077228
Change-Id: I9a2a7614313297f11a55d99fb94916d3583a9504
2024-08-17 09:20:26 -04:00
Zuul 5b91e78308 Merge "hardware: Correct log" 2024-08-16 22:35:46 +00:00
Zuul 690e2cb799 Merge "api: Add response body validation helper" 2024-08-16 22:03:30 +00:00
Balazs Gibizer f8b98390dc Fix PCI passthrough cleanup on reschedule
The resource tracker Claim object works on a copy of the instance object
got from the compute manager. But the PCI claim logic does not use the
copy but use the original instance object. However the abort claim logic
including the abort PCI claim logic worked on the copy only. Therefore the
claimed PCI devices are visible to the compute manager in the
instance.pci_decives list even after the claim is aborted.

There was another bug in the PCIDevice object where the instance object
wasn't passed to the free() function and therefore the
instance.pci_devices list wasn't updated when the device was freed.

Closes-Bug: #1860555
Change-Id: Iff343d4d78996cd17a6a584fefa7071c81311673
2024-08-16 16:10:14 +02:00
Zuul a7c82399b2 Merge "Skip new image format tests" 2024-08-14 17:54:37 +00:00
Sean Mooney c69a9eb87f Skip new image format tests
The nova-ceph-multistore job is currently
not configured properly for the new image format
tests. This change skips them until we decided
how to fix this.

Change-Id: I3de7588ba224453c24beabf8a799c71677603ba7
2024-08-13 19:32:47 +01:00
Stephen Finucane 4678bcbb06 hardware: Correct log
We currently get the following error message if attempting to fit a
guest with hugepages on a node that doesn't have enough:

  Host does not support requested memory pagesize, or not enough free
  pages of the requested size. Requested: -2 kB

Correct this, removing the kB suffix and adding a note on the meaning of
the negative values, like we have for the success path.

Change-Id: I247dc0ec03cd9e5a7b41f5c5534bdfb1af550029
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-Bug: #2075959
2024-08-13 16:32:21 +00:00
Dan Smith 068dbe0779 Deprecate AMI image formats
We have a lot of special cases all around our code for AMI (et al)
images, in the boot, snapshot, and other areas. It was recently
discussed (after the major CVE which was complicated by AMI support)
that we should drop these special cases and support for AMI with it.
This starts that timer.

Change-Id: I90efaaa35225ce82bada0b427e09c8289adaae1e
2024-08-12 07:25:02 -07:00
sdmitriev1 a2d77845ab Functional test test_boot_reschedule_with_proper_pci_device_count
Lets first ensure we have a test that proves we have bad behaviour,
then follow up with the fix and the test tweak to prove it.

On the first compute node it fails due to group policy error.
On the second compute node instance should have exactly one PCI device.

Related-Bug: #1860555
Change-Id: Ia122fff268c8f45ad3e5a3071d2cb7c990cb2c1d
2024-08-10 09:49:56 -04:00
Zuul 7399728e89 Merge "Fix guard for NVMeOF volumes" 2024-08-09 05:11:51 +00:00
Zuul da5bb85b6d Merge "libvirt: Detect vtpm support by libvirt" 2024-08-09 05:11:43 +00:00
Zuul c6ebee1987 Merge "libvirt: Ensure swtpm_ioctl is available for vTPM support" 2024-08-09 05:11:11 +00:00
melanie witt f63029b461 libvirt: Remove node device XML validate flags
Node device XML validation flags [1]:

  VIR_NODE_DEVICE_(CREATE|DEFINE)_XML_VALIDATE

were added in libvirt 8.10.0 but we support older libvirt versions
which will raise an AttributeError when flag access is attempted.

We are not currently using the flags (nothing calling with
validate=True) so this removes the flags from the code entirely. If the
flags are needed in the future, they can be added again at that time.

Closes-Bug: #2076163

[1] https://github.com/libvirt/libvirt/commit/d8791c3c7caa6e3cadaf98a5a2c94b232ac30fed

Change-Id: I015d9b7cad413986058da4d29ca7711c844bfa84
2024-08-07 16:31:58 +00:00
Zuul bb2d7f9cad Merge "[tools] Backport validator: handle unmaintained" 2024-07-30 18:15:40 +00:00
Zuul 75e2175254 Merge "[tools] Ignore bot generated patches" 2024-07-30 18:15:34 +00:00
Takashi Kajinami 510cc2404e libvirt: Detect vtpm support by libvirt
Libvirt 8.0.0 introduced the field to tell availability of TPM support,
which internally checks availability of swtpm[1]. We can use this
feature instead of implementing the own logic to detect availability.
The feature in libvirt relies on libvirt itself, so allows us to ensure
the swtpm binaries are present in the PATH used by libvirt, not in one
used by nova-compute.

In addition, libvirt 8.6.0 introduced the additional field to expose
available TPM versions[2], which can be used to report available TPM
versions.

<domainCapabilities>
  <devices>
    <tpm supported='yes'>
      <enum name='model'>
        <value>tpm-tis</value>
        <value>tpm-crb</value>
      </enum>
      <enum name='backendModel'>
        <value>passthrough</value>
        <value>emulator</value>
        <value>external</value>
      </enum>
      <enum name='backendVersion'>
        <value>1.2</value>
        <value>2.0</value>
      </enum>
    </tpm>
  </devices>
</domainCapabilities>

[1] https://github.com/libvirt/libvirt/commit/6f7fc0b54ad97e62e10cd6f9524fcc29b4bb4cc5
[2] https://github.com/libvirt/libvirt/commit/1277a9c884039e92765c977917420511f45e52e8

Partially-Implements: blueprint libvirt-detect-vtpm-support
Change-Id: I9d07635883f413b8e91312f602a3f5de8f3bf266
2024-07-27 22:08:47 +09:00
Takashi Kajinami 9a11bb2523 libvirt: Ensure swtpm_ioctl is available for vTPM support
Libvirt uses swtpm_ioctl to terminate swtpm processes. If the binary
does not exist, swtpm processes are kept running after the associated
VM terminates, because QEMU does not send shutdown to swtpm.

Closes-Bug: #2052761
Change-Id: I682f71512fc33a49b8dfe93894f144e48f33abe6
2024-07-27 22:08:47 +09:00
Zuul 7a7427691e Merge "Fix test_vmdk_bad_descriptor_mem_limit and test_vmdk_bad_descriptor_mem_limit_stream_optimized" 2024-07-26 12:06:25 +00:00
Zuul eb5e3374bc Merge "Remove AMI snapshot format special case" 2024-07-25 17:29:30 +00:00
Zuul 73012258e7 Merge "[CI] Replace deprecated regex" 2024-07-24 23:38:49 +00:00
Dan Smith d5a631ba77 Remove AMI snapshot format special case
Note that this includes seemingly-unrelated test changes because we
were actually skipping the snapshot_running test for libvirt, which
has been a bug for years. In that test case, when we went to look
for image_meta.disk_format, that attribute was not set on the o.vo
object, which raised a NotImplementedError. That error is also checked
by the test to skip the test for drivers that do not support snapshot,
which meant that for libvirt, we haven't been running that case
beyond the point at which we create snapshot metadata and trip that
exception. Thus, once removing that, there are other mocks not in
place that are required for the test to actually run. So, this adds
mocks for qemu_img_info() calls that actually try to read the file on
disk, as well as the privsep chown() that attempts to run after.

Change-Id: Ie731045629f0899840a4680d21793a16ade9b98e
2024-07-24 11:04:55 -07:00
Zuul df39222b10 Merge "Change force_format strategy to catch mismatches" 2024-07-23 23:39:57 +00:00
Zuul 1191a49a65 Merge "conf: Clarify '[api] response_validation help' text" 2024-07-23 21:23:10 +00:00
Dan Smith 8b4c522f66 Change force_format strategy to catch mismatches
When we moved the qemu-img command in fetch_to_raw() to force the
format to what we expect, we lost the ability to identify and react
to situations where qemu-img detected a file as a format that is not
supported by us (i.e. identfied and safety-checked by
format_inspector). In the case of some of the other VMDK variants
that we don't support, we need to be sure to catch any case where
qemu-img thinks it's something other than raw when we think it is,
which will be the case for those formats we don't support.

Note this also moves us from explicitly using the format_inspector
that we're told by glance is appropriate, to using our own detection.
We assert that we agree with glance and as above, qemu agrees with
us. This helps us avoid cases where the uploader lies about the
image format, causing us to not run the appropriate safety check.
AMI formats are a liability here since we have a very hard time
asserting what they are and what they will be detected as later in
the pipeline, so there is still special-casing for those.

Closes-Bug: #2071734
Change-Id: I4b792c5bc959a904854c21565682ed3a687baa1a
2024-07-23 20:37:42 +01:00
Zuul c1046979af Merge "conf: Add '[api] response_validation' option" 2024-07-23 15:16:27 +00:00
Julien Le Jeune a3202f7bf9 Fix test_vmdk_bad_descriptor_mem_limit and test_vmdk_bad_descriptor_mem_limit_stream_optimized
These tests depend on qemu-img being installed and in the path, if it is not installed, skip them.

Change-Id: I896f16c512f24bcdd898ab002af4e5e068f66b64
Closes-bug: #2073862
Signed-off-by: Julien Le Jeune <julien.le-jeune@ovhcloud.com>
2024-07-23 16:26:19 +02:00
Stephen Finucane 2db06b58b1 api: Fix typo
The option is "warn", not "warning".

Change-Id: I20dd675a2c9a168308e346e88aa3b00f9ce06582
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-23 12:05:46 +01:00
Zuul 8c4a2e1b47 Merge "tests: Ensure all APIs have a request query schema" 2024-07-20 09:13:12 +00:00
Zuul 92442bfaf1 Merge "api: Add remaining missing query parameter schema" 2024-07-20 08:50:32 +00:00
Stephen Finucane 9a04ed79a3 conf: Clarify '[api] response_validation help' text
Make it extra clear this is only for API response bodies.

Change-Id: Id88c828aa7bcb1eff6dd149e8a92a19649ba4b0e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-19 13:01:01 +01:00
Sylvain Bauza 757c333c0e cpu: Only check governor type on online cores
Kernels don't accept to access the governor strategy on an offline core, so
we need to only validate strategies for online cores.

Change-Id: I14c9b268d0b97221216bd1a9ab9e48b48d6dcc2c
Closes-Bug: #2073528
2024-07-19 12:22:55 +02:00
Zuul e82854dc8c Merge "hardware: Fix image_meta.id within get_mem_encryption_constraint" 2024-07-16 04:39:35 +00:00
Elod Illes e2697de8e4 [tools] Backport validator: handle unmaintained
When the script was created there were only stable/* branches, but now
there are unmaintained/* branches as well, where the validator fails
when looking for hashes only on stable/* branches even if the given
hash is already on unmtaintained/* branch. This patch matches now both
stable/* and unmaintained/* branches.

Change-Id: I08fcc63ab0fbe5af1be70d5fde5af98bf006101c
2024-07-12 23:10:26 +02:00
Elod Illes b8f3975d36 [tools] Ignore bot generated patches
This is a fix for the test whether a patch is bot generated or not, as
that did not worked as intended. The problem is that the script is
checking the email address of the parent patch (HEAD~), which probably
should be right in case the patch would be a MERGE patch. But this is
wrong in case the patch is not a MERGE patch. This fix uses the very
same pattern as it is using for the commit message parsing: the
$commit_hash variable, which is the parent's commit hash if the patch
is a MERGE patch, and an empty string in the other case (causing to
call 'git show' on HEAD).

Change-Id: I0abc72180edf34a6dd0624a40fb8682397805eca
2024-07-12 22:53:06 +02:00