Rename the exist config attribute: [libvirt]/cpu_model to
[libvirt]/cpu_models, which is an orderded list of CPU models the host
supports. The value in the list can be made case-insensitive.
Change logic of method: '_get_guest_cpu_model_config', if cpu_mode is
custom and cpu_models set. It will parse the required traits
associated with the CPU flags from flavor extra_specs and select the
most appropriate CPU model.
Add new method 'get_cpu_model_names' to host.py. It will return a list
of the cpu models that the CPU arch can support.
Update the docs of hypervisor-kvm.
Change-Id: I06e1f7429c056c4ce8506b10359762e457dbb2a0
Implements: blueprint cpu-model-selection
The following methods have not been used any more
since the following change IDs or a commit.
* _add_vif_extension
I56d859beb675199b209587bfe0a23cd9b75233ad
* _node_dict
Ia76e41a8a3b7230701872ae7a1975edc3d9ea847
* _bdms_from_legacy and _bdms_to_legacy
I01c108ceb539bb99491ed542c683e36fbf0c2bbe
* _create_block_device_mapping
Ib0e0b708c46e4330e51f8f8fdfbb02d45aaf0f44
* _get_folder
If734e22af223836b424561e8e9ca65e6c39fe5c2
* _details_map
This method has not been used since the commit
that added the method (initial commit).
https://opendev.org/openstack/nova/commit/e7562217edf80afdb5ca8254b624c401f549ec1e
Change-Id: Ica00c013961366d044f5a4ad3ed24568d60288b3
This is a follow up for I8e5a0480c81ba548bc1f50a8098eabac52b11453 where
Matt pointed out that there is missing unit test coverage for the
case when resource claim fails on an alternate host during re-schedule.
This patch adds such coverage.
Change-Id: Ia2d8f511c9b46b805aa504a9ca6b0d9f35cc1a31
blueprint: support-move-ops-with-qos-ports
Most of the libvirt functional tests need at least the
'NUMATopologyFilter' scheduler filter enabled. Provide a mechanism to
enable this, adding the filter to the real-time tests where it was
previously missing.
Change-Id: Id51ed2304140754a1eef402d558123b5e6bab9c8
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
The '_update_provider_tree_for_vgpu' argument took an 'inventories_dict'
argument, but that argument was generated immediately before the sole
call to the function. Just generate the argument inside the function
itself.
Change-Id: Id026855c06e047023b8092a45a0c3e02364c3dbb
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Otherwise we overload the import with the 'fields' variable defined on
the class.
Change-Id: Ife4646eb8da78cc25baddddfd3eb8c7d360352b3
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
We're using placement. Let's make sure everything is working in concert
and requesting the right amount and types of things.
Change-Id: Ieea576b700327ba5a5300e512d42e51a255abbba
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Co-authored-by: Bhagyashri Shewale <bhagyashri.shewale@nttdata.com>
Nothing was overriding a number of these fields so make things less
complex by removing the customizability. We can easily re-add it if we
need to in the future. We can do more here (most callers of this use the
exact same values), but that's a change for later.
Change-Id: Id3e0668acb71b3c7350b73b4afff7e940c6dfb1d
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
We would like nova not to use ironicclient, but instead to invoke the
ironic API directly through an openstacksdk connection.
The parent commits set up the framework, and this commit uses it
for the _set_instance_id function.
Blueprint: openstacksdk-in-nova
Change-Id: I95f3414d29a5ff5cc49994bac1cda917edc4f292
We would like nova not to use ironicclient, but instead to invoke the
ironic API directly through an openstacksdk connection.
The parent commits set up the framework, and this commit uses it
for the instance_exists function.
Blueprint: openstacksdk-in-nova
Change-Id: I764b0086d0bf39d4ca8cb308696169282b12b42b
The '_test_simple_call' test is unused since change
Ibcb6bf912b3fb69c8631665fef2832906ba338aa.
Change-Id: If9e36cb4a21ced44f2ee7dede480a0719fcccdf1
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This patch pulls out two functions from MigrationTask._execute. One for
the initial schedule case and the other for the re-schedule case. This
way unit testing some of the intricate parts of re-schedule becomes
easier.
Change-Id: I03b1eb1bd1a996081d1546134baa872c6166c5bb
Matt pointed out in [1] that there is missing test coverage for some of
the changes in If1f465112b8e9b0304b8b5b864b985f72168d839 for the rpc api
behavior. So this follow up adds the extra unit tests.
[1] https://review.opendev.org/#/c/655721/17/nova/compute/rpcapi.py@615
Change-Id: I5e837f30c888ed2fa63856670695d2836cf48e00
blueprint: support-move-ops-with-qos-ports
In some places test_report_client uses a raw client.put when
writing allocations. This defaults to the latest microversion.
This means that if the allocations format changes in the latest
microversion in a patch in placement, the nova functional tests
fail.
In this change we pin the microversion to the minimum one providing
the features used in the PUT.
Change-Id: Ia0fee6bb931770792b552ae32ef31f0a4cc466ee
In a future change, I492803eaacc34c69af073689f9159449557919db, we're
going to be adding a new field to all definitions of this object. That
is going to result in a lot of line wrapping which will make the change
a lot harder to grok. Do that wrapping now so that we can make the
functional changes in that future change easier to identify.
Part of blueprint cpu-resources
Change-Id: Id3441073adde563a568c9550df53690d1e6c998a
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
<launchSecurity> enables use of SEV, so add the required config class
for it. For now the class just describes the new element; it will be
used in further commits.
Furthermore, AMD SEV requires enabling DMA APIs for virtio devices
via <driver iommu='on' />:
http://specs.openstack.org/openstack/nova-specs/specs/train/approved/amd-sev-libvirt-support.html#proposed-change
So also add the necessary bits for that to domain configuration.
blueprint: amd-sev-libvirt-support
Change-Id: Ia78458ac698f66d297cb91bcab663fcf123c5442
Add a new "hw:mem_encryption" extra spec parameter, and a new
"hw_mem_encryption" image property, which indicate that any guest
booted with that extra spec parameter or image property respectively
needs to be booted with its memory hardware-encrypted.
This is achieved by converting the requirement stated in the extra
spec parameter and/or image property into an additional extra spec
parameter which requests resources for one slot of the inventory of
the new MEM_ENCRYPTION_CONTEXT resource class (introduced in
os-resource-classes 0.4.0). The inventory will be provided by the
follow-up commit I659cb77f12a38a4d2fb118530ebb9de88d2ed30d.
Since future commits adding support for SEV to guest XML config will
also need to know at launch-time whether memory encryption has been
requested, add a reusable mem_encryption_requested() function to the
nova.virt.hardware library for detecting which of the extra spec /
image property (if either) have requested encrypted memory.
If both the extra spec parameter and the image property are explicitly
specified and they contradict each other, or if either request memory
encryption but the image does not have hw_firmware_type set to UEFI,
then log an error and raise a new generic FlavorImageConflict
exception. This exception can also be useful in the future for
handling other similar conflicts. In this particular use case,
FlavorImageConflict is raised by mem_encryption_requested(), and then
if caught during API call validation, it's re-raised as
HTTPBadRequest.
In order to test this code, we need to construct various ImageMeta
objects containing fake data and a ImageMetaProps instance for each.
This is a slightly fiddly task which future patches in the SEV series
will also need to perform, so add a helper to nova.tests.unit.image.fake
for this.
blueprint: amd-sev-libvirt-support
Change-Id: I8c63b5cc5ad97ce831adb2eb96a995ebc798ecb7