The existing tests for NVMe with Libvirt were using
APIs inside of os-brick rather than making sure that
we are calling os-brick with the right values.
This patch mocks up the factory function instead and
makes sure we call it with the right values, it also
adds a few more things to test if the root helper and
`device_scan_attempts` are passed down through to
os-brick as well.
Change-Id: I067f9e29b4db3bba0601041cf3603b9653a240b9
This call accepts keyword arguments, not a dictionary. The dictionary
ends up passed into the 'details' argument, making it True, so the
query returns all nodes instead of just one. Fix it and raise an error
in case it ever repeats.
Closes-Bug: #1843050
Change-Id: If464423b3c5bc05e2b22ff2245828c677b264d15
IronicDriver should be using fields="instance_uuid" when calling Ironic
API via the OpenStack SDK, but instead is using fields="instance_id".
This patch corrects the calls and adds new tests to cover it.
Change-Id: I4b976b7ea60c63ec334b5eb78c1ad7972fbed574
Closes-Bug: #1842989
The combined fixes for the two related bugs resolve the problem where
SIGHUP breaks the nova-compute service. Bump the minimum requirements
for oslo.privsep and oslo.service to make sure these fixes are in place,
and add a reno to advertise resolution of the issue.
This also bumps oslo.utils to match the lower constraint from
oslo.service.
Change-Id: I39ead744b21a4423352a88573f327273e4d09630
Related-Bug: #1794708
Related-Bug: #1715374
The conductor doc is not really end user material,
so this moves it under reference/, removes it from the
user page and adds it to the reference index for internals.
Also makes the contributor page link to the reference internals
since it's kind of weird to have one contributor section that
only mentions one thing but the internals under reference have
a lot more of that kind of detail. Finally, a todo is added so
we don't forget to update the reference internals about versioned
objects at some point since that's always a point of confusion
for people.
Change-Id: I8d3dbce5334afaa3e1ca309b2669eff9933a0104
The CachingScheduler driver was removed in Stein [1] but
there are a couple of comments in the FilterScheduler
driver code that reference conditions from when the
CachingScheduler existed. This removes them to avoid
confusion.
[1] I1832da2190be5ef2b04953938860a56a43e8cddf
Change-Id: If71a7ac7a33dbc45f417368e3e705f444a3e5bd3
SEV work uncovered that test_get_guest_config_machine_type_s390(), a
unit test for nova.virt.libvirt.utils.get_machine_type(), was
misplaced in test_driver.py, so move that to test_utils.py and in the
process extend it to test other architectures.
Also rename three related unit tests of the same get_machine_type()
for increased clarity.
Change-Id: Ib43f96445e7c13f4abc4522f1d3567a4a5499382
blueprint: amd-sev-libvirt-support
A future test in the SEV patch series will require a fake of a fully
configured KVM guest in order to test enabling of IOMMU for relevant
drivers. So extract the fixture factory and the resulting XML out
into fake_libvirt_data.py where it can also be used by
libvirt/test_designer.py.
It is not sufficient to only extract the XML, because parts of the
config do not have parse_dom() implemented and therefore can only be
generated via code rather than by parsing the XML.
Change-Id: I6595d55823e15ef155f8303eb06676494dd0c661
blueprint: amd-sev-libvirt-support
As explained in the SEV spec[0], SEV needs a q35 machine type in order
to bind all the virtio devices to the PCIe bridge so that they use
virtio 1.0 and not virtio 0.9, since QEMU's iommu_platform feature was
added in virtio 1.0 only.
So add an extra check to be run in the API layer whenever SEV is
requested, to ensure that a machine type *outside* the q35
family (e.g. 'pc', or something like 'pc-i440fx-2.11') is not
explicitly selected in the image via the hw_machine_type property.
Since code in the API layer doesn't run on the compute host, at this
stage we can't check CONF.libvirt.hw_machine_type via libvirt.utils.
A subsequent commit will change the libvirt driver to trigger an
extra, later check on the compute node, although if that late check
fails, the best we can do is to fail the operation on that compute
host, in which case it will potentially be retried on another compute
host.
nova's hardcoded default for x86_64 is 'pc' (which in fact matches
QEMU's current default). This means that it will be recommended that
SEV-capable compute hosts have CONF.libvirt.hw_machine_type configured
to include 'x86_64=q35', otherwise attempts to boot SEV guests without
the image property 'hw_machine_type=q35' will fail unpleasantly.
In the future it is expected that both of these defaults will change
to 'q35'[1]. Once that happens, x86_64 images will be bootable
without needing to set either the hw_machine_type image property or
CONF.libvirt.hw_machine_type.
While extending the unit tests for invalid combinations of image
properties, add tests for the case where the 'hw_firmware_type'
property is not specified at all; previously the tests only covered
the case where it was set to 'bios'.
[0] http://specs.openstack.org/openstack/nova-specs/specs/train/approved/amd-sev-libvirt-support.html
[1] https://bugs.launchpad.net/nova/+bug/1780138
blueprint: amd-sev-libvirt-support
Change-Id: Ibf66a0b371685c673644493bf12663dbf71fab6c
If the server has port with resource allocation and the server is
migrated then when the port is bound to the destination host the
allocation key needs to be updated in the binding:profile to point to
the resource provider that provides resources for this port on the
destination host.
This patch extends the migrate_instance_finish() network api method to
pass the updated resource providers of the ports during migration.
Change-Id: I220fa02ee916728e241503084b14984bab4b0c3b
blueprint: support-move-ops-with-qos-ports
Add the 'delete_on_termination' field to the volume attach API to support
configuring whether to delete the data volume when the instance is destroyed.
To avoid upgrade impact issues with older computes, the
'delete_on_termination' field is set in the API rather than when the BDM
is created in the compute service.
Implements: blueprint support-delete-on-termination-in-server-attach-volume
Change-Id: I55731b1822a4e32909665a2872d80895cb5b12f7
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).
e7562217ed
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