Commit Graph

55175 Commits

Author SHA1 Message Date
ya.wang f80e5f989d vCPU model selection
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
2019-09-06 14:01:35 +08:00
Zuul 7020196aaa Merge "Handle VirtDriverNotReady in _cleanup_running_deleted_instances" 2019-09-06 01:39:22 +00:00
Zuul c84400f152 Merge "Trap and log errors from _update_inst_info_cache_for_disassociated_fip" 2019-09-05 21:08:37 +00:00
Zuul 86b6906ff4 Merge "neutron: refactor nw info cache refresh out of associate_floating_ip" 2019-09-05 20:43:24 +00:00
Zuul f7f5e1846c Merge "Add server sub-resource topology API" 2019-09-05 12:51:36 +00:00
Zuul 27925a0e22 Merge "Use microversion in put allocations in test_report_client" 2019-09-05 03:01:51 +00:00
Zuul 0568676132 Merge "Modernize nova-lvm job" 2019-09-04 20:43:02 +00:00
Zuul 85d21ad5e0 Merge "Convert nova-lvm job to zuul v3" 2019-09-04 20:08:05 +00:00
Zuul 2b2a5cedfc Merge "Remove unused methods" 2019-09-04 19:59:25 +00:00
Zuul b1de451629 Merge "unit test: do not fill rp mapping for failed re-schedule" 2019-09-04 15:58:15 +00:00
Zuul c34b783749 Merge "Refactor MigrationTask._execute" 2019-09-04 15:58:05 +00:00
Zuul b973d44f0e Merge "libvirt: Make scheduler filters customizable" 2019-09-04 14:34:50 +00:00
Zuul 6bfe3cf42d Merge "Make _get_cpu_feature_traits() always return a dict" 2019-09-04 14:34:38 +00:00
Takashi NATSUME 2311a194e1 Remove unused methods
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
2019-09-04 15:26:59 +09:00
Zuul cbaea3bd69 Merge "re-calculate provider mapping during migration" 2019-09-04 01:00:07 +00:00
Zuul a496bb9397 Merge "libvirt: Fold in argument to '_update_provider_tree_for_vgpu'" 2019-09-03 22:12:56 +00:00
Zuul de6b5dd87d Merge "Use SDK for setting instance id" 2019-09-03 18:30:18 +00:00
Zuul 8670b0b9cb Merge "Use SDK for validating instance and node" 2019-09-03 18:17:46 +00:00
Zuul 5e6446bb2b Merge "Use SDK for node.list" 2019-09-03 17:50:31 +00:00
Zuul 27f2eb9cb6 Merge "Remove dead code" 2019-09-03 16:56:29 +00:00
Zuul 3d9344a88b Merge "Nice to have test coverage for If1f465112b8e9b0304b8b5b864b985f72168d839" 2019-09-03 16:56:20 +00:00
Zuul 34a052f04e Merge "objects: Rename 'fields' import to 'obj_fields'" 2019-09-03 16:56:13 +00:00
Zuul 40e7fdbaec Merge "libvirt: Start checking compute usage in functional tests" 2019-09-03 16:01:59 +00:00
Zuul 2821908a07 Merge "libvirt: Simplify 'fakelibvirt.HostInfo' object" 2019-09-03 16:01:49 +00:00
Zuul 4318bfdd18 Merge "Add <launchSecurity> and <driver iommu='on' /> to config.py" 2019-09-03 15:21:03 +00:00
Balazs Gibizer 8a1ea45124 unit test: do not fill rp mapping for failed re-schedule
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
2019-09-03 16:59:42 +02:00
Stephen Finucane de89b2d83f libvirt: Make scheduler filters customizable
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>
2019-09-03 15:24:22 +01:00
Adam Spiers 0afb7c6925 Make _get_cpu_feature_traits() always return a dict
This is a follow-up addressing the suggestion from Stephen to remove a
slightly ugly corner-case from _get_cpu_feature_traits() by ensuring
it never returns None and instead always returns a dict, even if it's
empty.

https://review.opendev.org/#/c/638680/53/nova/virt/libvirt/driver.py@9670

Also squeeze in another fix-up for a nit-pick in the imports:

https://review.opendev.org/#/c/638680/53/nova/tests/functional/libvirt/test_report_cpu_traits.py@17

Change-Id: I48b359836e0a2bc7fffa74a27a920314f0861765
blueprint: amd-sev-libvirt-support
2019-09-03 11:42:07 +01:00
Stephen Finucane 30c5ba30dc libvirt: Fold in argument to '_update_provider_tree_for_vgpu'
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>
2019-09-03 09:42:14 +01:00
Stephen Finucane 726a35b345 objects: Rename 'fields' import to 'obj_fields'
Otherwise we overload the import with the 'fields' variable defined on
the class.

Change-Id: Ife4646eb8da78cc25baddddfd3eb8c7d360352b3
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-09-03 09:42:14 +01:00
Stephen Finucane 64f09a4a1f libvirt: Start checking compute usage in functional tests
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>
2019-09-03 09:42:14 +01:00
Stephen Finucane ea5bb8e1ec libvirt: Simplify 'fakelibvirt.HostInfo' object
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>
2019-09-03 09:42:14 +01:00
Zuul cc46495d5e Merge "Extract SEV-specific bits on host detection" 2019-09-02 23:57:10 +00:00
Dustin Cowles ce4c60cf4b Use SDK for setting instance id
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
2019-09-02 14:21:25 -07:00
Dustin Cowles 3440c3d37a Use SDK for validating instance and node
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
2019-09-02 14:21:23 -07:00
Zuul 81853e2783 Merge "Add request_spec to server move RPC calls" 2019-09-02 20:02:07 +00:00
Zuul 375e80f9a5 Merge "Pass network API to the conducor's MigrationTask" 2019-09-02 18:07:06 +00:00
Zuul 7bc8f24dc9 Merge "allow getting resource request of every bound ports of an instance" 2019-09-02 16:34:58 +00:00
Stephen Finucane 1635be335e Remove dead code
The '_test_simple_call' test is unused since change
Ibcb6bf912b3fb69c8631665fef2832906ba338aa.

Change-Id: If9e36cb4a21ced44f2ee7dede480a0719fcccdf1
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-09-02 17:31:25 +01:00
Zuul ef6e49d5bc Merge "trivial: Rewrap definitions of 'NUMACell'" 2019-09-02 12:47:25 +00:00
Balazs Gibizer 134e12acff Refactor MigrationTask._execute
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
2019-09-02 14:43:13 +02:00
Balazs Gibizer 84b1a98efe Nice to have test coverage for If1f465112b8e9b0304b8b5b864b985f72168d839
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
2019-09-02 13:46:26 +02:00
Chris Dent 5f553f4b1a Use microversion in put allocations in test_report_client
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
2019-09-02 11:40:35 +01:00
Stephen Finucane dc3a8de1f8 trivial: Rewrap definitions of 'NUMACell'
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>
2019-09-02 11:31:27 +01:00
Boris Bobrov 3941679aac Add <launchSecurity> and <driver iommu='on' /> to config.py
<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
2019-09-01 15:17:36 +01:00
Boris Bobrov 44dc83d473 Extract SEV-specific bits on host detection
Extract reducedPhysBits and cbitpos when detecting that host is
SEV-enabled.

These parameters will later be used to configure the guest.
http://specs.openstack.org/openstack/nova-specs/specs/train/approved/amd-sev-libvirt-support.html#sev-launch-time-configuration

Change-Id: I1d9308147a389fc94b7e872f9bd0621bdb25b193
blueprint: amd-sev-libvirt-support
2019-09-01 15:17:34 +01:00
Adam Spiers b4905467db Add extra spec parameter and image property for memory encryption
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
2019-09-01 15:17:31 +01:00
Zuul 160d1042b4 Merge "Provide HW_CPU_X86_AMD_SEV trait when SEV is supported" 2019-08-31 16:07:44 +00:00
Zuul f8969bc44f Merge "Add cold migrate and resize to nova-grenade-multinode" 2019-08-31 02:58:23 +00:00
Zuul c477f3654e Merge "Rename the nova-grenade-live-migration job to nova-grenade-multinode" 2019-08-31 02:49:39 +00:00