Commit Graph

546 Commits

Author SHA1 Message Date
Zuul b542b53585 Merge "Doc follow up for PCI in placement" 2022-09-06 16:30:19 +00:00
Balazs Gibizer efb6fd834e Doc follow up for PCI in placement
This fixes the doc comments for the already merged (or being merged)
patches in the series.

blueprint: pci-device-tracking-in-placement
Change-Id: Ia99138d603722a66c9a6ac61b035384d86ccca75
2022-09-02 14:20:18 +02:00
Zuul 457806e206 Merge "libvirt: Add vIOMMU device to guest" 2022-09-01 19:56:09 +00:00
Zuul 8b55b44cc6 Merge "Allow enabling PCI tracking in Placement" 2022-09-01 18:21:52 +00:00
Zuul 82498dfe4b Merge "Handle PCI dev reconf with allocations" 2022-09-01 18:21:45 +00:00
Zuul 40ca5e169a Merge "Heal PCI allocation during resize" 2022-09-01 18:16:04 +00:00
Stephen Finucane 14e3b352c2 libvirt: Add vIOMMU device to guest
Implementation for BP/libvirt-viommu-device.
With provide `hw:viommu_model` property to extra_specs or
`hw_viommu_model` to image property. will enable viommu to libvirt
guest.

[1] https://www.berrange.com/posts/2017/02/16/setting-up-a-nested-kvm-guest-for-developing-testing-pci-device-assignment-with-numa/
[2] https://review.opendev.org/c/openstack/nova-specs/+/840310

Implements: blueprint libvirt-viommu-device
Change-Id: Ief9c550292788160433a28a7a1c36ba38a6bc849
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-09-01 04:50:16 +08:00
Balazs Gibizer 06389f8d84 Allow enabling PCI tracking in Placement
This patch introduces the [pci]report_in_placement config option that is
False by default but if set to True will enable reporting of the PCI
passthrough inventories to Placement.

blueprint: pci-device-tracking-in-placement
Change-Id: I49a3dbf4c5708d2d92dedd29a9dc3ef25b6cd66c
2022-08-27 12:41:20 +02:00
Balazs Gibizer 9268bc36a3 Handle PCI dev reconf with allocations
PCI devices which are allocated to instances can be removed from the
[pci]device_spec configuration or can be removed from the hypervisor
directly. The existing PciTracker code handle this cases by keeping the
PciDevice in the nova DB exists and allocated and issue a warning in the
logs during the compute service startup that nova is in an inconsistent
state. Similar behavior is now added to the PCI placement tracking code
so the PCI inventories and allocations in placement is kept in such
situation.

There is one case where we cannot simply accept the PCI device
reconfiguration by keeping the existing allocations and applying the new
config. It is when a PF that is configured and allocated is removed and
VFs from this PF is now configured in the [pci]device_spec. And vice
versa when VFs are removed and its parent PF is configured. In this case
keeping the existing inventory and allocations and adding the new inventory
to placement would result in placement model where a single PCI device
would provide both PF and VF inventories. This dependent device
configuration is not supported as it could lead to double consumption.
In such situation the compute service will refuse to start.

blueprint: pci-device-tracking-in-placement
Change-Id: Id130893de650cc2d38953cea7cf9f53af71ced93
2022-08-26 19:05:45 +02:00
Zuul e4328ed7cd Merge "Add locked_memory extra spec and image property" 2022-08-26 15:22:08 +00:00
Balazs Gibizer 98e9989cad Heal PCI allocation during resize
During resize an instance with existing PCI allocation can be changed to
consume less, more, or different PCI devices. So the heal allocation
logic needs to handle the case when an existing instance is changed to
consume different PCI devices.

This patch adds support to change existing PCI allocations in placement
during resize.

There is one limitation of the healing logic. It assumes that there is
no in-progress migration when nova is upgraded. If there is an in
progress migration, then the PCI usage will not be healed in the
migration allocation. The placement view will be consistent after such
migration is completed or reverted.

blueprint: pci-device-tracking-in-placement
Change-Id: Icc968c567f9967d7449d6c6c1f57783098e63f55
2022-08-25 10:00:11 +02:00
Balazs Gibizer 01d7a39e00 Reject devname based device_spec config
We agreed not to support 'devname' based [pci]device_spec configuration
in the new PCI Placement tracking code. So this patch adds a check to
reject those.

blueprint: pci-device-tracking-in-placement
Change-Id: Ifa0dd34506ebc25cfe5bafd6952b72b0008fc741
2022-08-25 10:00:10 +02:00
Balazs Gibizer 10ba714125 Ignore PCI devs with physical_network tag
The first version of the PCI tracking in placement feature will not
handle Neutron based SRIOV devices. So those are now ignored during
placement inventory reporting.

blueprint: pci-device-tracking-in-placement
Change-Id: Ie24969d60c84379673c5450863f4cf58cf09207c
2022-08-25 10:00:10 +02:00
Balazs Gibizer 07f2bf8035 Reject mixed VF rc and trait config
If two VFs from the same PF are configured by two separate
[pci]device_spec entries then it is possible to define contradicting
resource classes or traits. This patch detects and rejects such
configuration.

blueprint: pci-device-tracking-in-placement
Change-Id: I623ab24940169991a400eba854c9619a11662a91
2022-08-25 10:00:10 +02:00
Balazs Gibizer 0d526d1f4b Reject PCI dependent device config
The PCI tracking in placement does not support the configuration where
both a PF and its children VFs are configured for nova usage. This patch
adds logic to detect and reject such configuration. To be able to kill
the service if started with such config special exception handling is
added for the update_available_resource code path, similarly how a
failed reshape is handled.

blueprint: pci-device-tracking-in-placement
Change-Id: I708724465d2afaa37a65c231c64da88fc8b458eb
2022-08-25 10:00:10 +02:00
Balazs Gibizer 2722038946 Extend device_spec with resource_class and traits
Each [pci]device_spec entry can specify the two new resource_class and
traits tags.

If the resource_class is specified then it will be used as the RC in the
placement inventory of the PCI devices matching the spec. If not
specified then the RC is defaulted CUSTOM_PCI_<vendor_id>_<product_id>.

The traits tag is a comma separated list of trait names. Nova will
report these traits to RP representing the matching PCI devices.

blueprint: pci-device-tracking-in-placement
Change-Id: I71b7a2fb8b03a3679733a98958b2f6d447ed5004
2022-08-25 10:00:10 +02:00
Balazs Gibizer 953f1eef19 Basics for PCI Placement reporting
A new PCI resource handler is added to the update_available_resources
code path update the ProviderTree with PCI device RPs, inventories and
traits.

It is a bit different than the other Placement inventory reporter. It
does not run in the virt driver level as PCI is tracked in a generic way
in the PCI tracker in the resource tracker. So the virt specific
information is already parsed and abstracted by the resource tracker.

Another difference is that to support rolling upgrade the PCI handler
code needs to be prepared for situations where the scheduler does not
create PCI allocations even after some of the compute already started
reporting inventories and started healing PCI allocations. So the code
is not prepared to do a single, one shot, reshape at startup, but
instead to do a continuous healing of the allocations. We can remove
this continuous healing after the PCI prefilter will be made mandatory
in a future release.

The whole PCI placement reporting behavior is disabled by default while
it is incomplete. When it is functionally complete a new
[pci]report_in_placement config option will be added to allow enabling
the feature. This config is intentionally not added by this patch as we
don't want to allow enabling this logic yet.

blueprint: pci-device-tracking-in-placement
Change-Id: If975c3ec09ffa95f647eb4419874aa8417a59721
2022-08-25 10:00:10 +02:00
Sean Mooney 572c2b18e2 Add locked_memory extra spec and image property
This change adds a new hw:locked_memory extra spec and hw_locked_memory
image property to contol preventing guest memory from swapping.

This change adds docs and extend the flavor
validators for the new extra spec.
Also add new image property.

Blueprint: libvirt-viommu-device
Change-Id: Id3779594f0078a5045031aded2ed68ee4301abbd
2022-08-24 21:47:32 +08:00
Sean Mooney 0aad338b1c Add VDPA support for suspend and livemigrate
This change append vnic-type vdpa to the list
of passthough vnic types and removes the api blocks

This should enable the existing suspend and live migrate
code to properly manage vdpa interfaces enabling
"hot plug" live migrations similar to direct sr-iov.

Implements: blueprint vdpa-suspend-detach-and-live-migrate
Change-Id: I878a9609ce0d84f7e3c2fef99e369b34d627a0df
2022-08-23 09:32:00 +01:00
Sean Mooney 6f1c7ab2e7 Add source dev parsing for vdpa interfaces
This change extends the guest xml parsing such that
the source device path can be extreacted from interface
elements of type vdpa.

This is required to identify the interface to remove when
detaching a vdpa port from a domain.

This change fixes a latent bug in the libvirt fixutre
related to the domain xml generation for vdpa interfaces.

Change-Id: I5f41170e7038f4b872066de4b1ad509113034960
2022-08-22 14:57:21 +01:00
Zuul ddcc286ee1 Merge "enable blocked VDPA move operations" 2022-08-20 15:37:54 +00:00
Sean Mooney 95f96ed3aa enable blocked VDPA move operations
This change adds functional test for operations on servers with VDPA
devices that are expected to work but currently blocked due to lack
of testing or qemu bugs.

cold-migrate, resize, evacuate,and shelve are enabled
and tested by this patch

Closes-Bug: #1970467
Change-Id: I6e220cf3231670d156632e075fcf7701df744773
2022-08-16 14:04:19 +01:00
Bence Romsics 5710a8ac06 Add limitation to docs about bug 1983570
Change-Id: Ie5611952ab8607bde02735503bfd84ba6c7990af
Partial-Bug: #1983570
2022-08-11 10:29:35 +02:00
Balazs Gibizer 14e68ac6e9 Rename [pci]passthrough_whitelist to device_spec
A later patch in the pci-device-tracking-in-placement work
will extend the existing [pci]passthrough_whitelist config syntax.
So we take the opportunity here to deprecate the old non inclusive
passthrough_whitelist name and introduce a better one.

All the usage of CONF.pci.passthrough_whitelist is now changed over to
the new device_spec config. Also the in tree documentation is updated
accordinly.

However the nova code still has a bunch of references to the
"whitelist" terminology. That will be handled in subsequent patches.

blueprint: pci-device-tracking-in-placement
Change-Id: I843032e113642416114f169069eebf6a56ed78dd
2022-08-10 17:08:35 +02:00
Zuul 7f5279edc9 Merge "For evacuation, ignore if task_state is not None" 2022-08-04 14:02:38 +00:00
Zuul ad7249b3fc Merge "Remove the PowerVM driver" 2022-08-03 10:47:24 +00:00
Amit Uniyal db919aa15f For evacuation, ignore if task_state is not None
ignore instance task state and continue with vm evacutaion

Closes-Bug: #1978983
Change-Id: I5540df6c7497956219c06cff6f15b51c2c8bc29d
2022-08-03 04:52:10 +00:00
Stephen Finucane deae814611 Remove the PowerVM driver
The PowerVM driver was deprecated in November 2021 as part of change
Icdef0a03c3c6f56b08ec9685c6958d6917bc88cb. As noted there, all
indications suggest that this driver is no longer maintained and may be
abandonware. It's been some time and there's still no activity here so
it's time to abandon this for real.

This isn't as tied into the codebase as the old XenAPI driver was, so
removal is mostly a case of deleting large swathes of code. Lovely.

Change-Id: Ibf4f36136f2c65adad64f75d665c00cf2de4b400
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-08-02 15:31:19 +02:00
Radosław Piliszek b351f0b848 [docs] Fix mention of custom scheduling after Wallaby
Custom filters are still supported. Custom schedulers / scheduler
drivers are what is not. This patch fixes the wording.

Change-Id: Icf9576b75bd006ba65484b9232e85d8b748458f1
2022-08-02 10:15:51 +02:00
Artom Lifshitz f77a9fee5b libvirt: remove default cputune shares value
Previously, the libvirt driver defaulted to 1024 * (# of CPUs) for the
value of domain/cputune/shares in the libvirt XML. This value is then
passed directly by libvirt to the cgroups API. Cgroups v2 imposes a
maximum value of 10000 that can be passed in. This makes Nova
unable to launch instances with more than 9 CPUs on hosts that run
cgroups v2, like Ubuntu Jammy or RHEL 9.

Fix this by just removing the default entirely. Because there is no
longer a guarantee that domain/cputune will contain at least a shares
element, we can stop always generating the former, and only generate
it if it will actually contain something.

We can also make operators's lives easier by leveraging the fact that
we update the XML during live migration, so this patch also adds a
method to remove the shares value from the live migration XML if one
was not set as the quota:cpu_shares flavor extra spec.

For operators that *have* set this extra spec to something greater
than 10000, their flavors will have to get updates, and their
instances resized.

Partial-bug: 1978489
Change-Id: I49d757f5f261b3562ada27e6cf57284f615ca395
2022-07-14 11:55:40 -04:00
Zuul e00f53aa8b Merge "docs: Correct path used for config on Hyper-V" 2022-05-30 16:54:55 +00:00
wnark 4d6cce1d10 docs: Correct path used for config on Hyper-V
Because in the above description:

  To install nova-compute, run:

  PS C:\> cd c:\nova
  PS C:\> python setup.py install

The file is downloaded to c:\nova. After executing `python setup.py
install` in this directory, the etc directory is generated under
`c:\nova`. Correct the path.

Closes-Bug: #1964548
Change-Id: Ibf0c1b56f235fffae65afbbcee30056bae965afe
2022-05-30 14:40:00 +01:00
Zuul 840c48fea7 Merge "Follow up for nova-manage image property commands" 2022-04-21 09:43:55 +00:00
Zuul ba63a5647c Merge "doc: Split up notifications document" 2022-03-23 15:00:55 +00:00
melanie witt 453c11e05d Follow up for nova-manage image property commands
This a follow up for change Ic8783053778cf4614742186e94059d5675121db1
and corrects the 'image_property set --property' arg format in the
hw_machine_type doc. Newline formats in the nova-manage CLI doc is
cleaned up to be consistent throughout and unnecessary () is removed
from the ImagePropertyCommands class.

Related to blueprint libvirt-device-bus-model-update

Change-Id: I5b67e9ae5125f6dad68cae7ac0601ac5b02e74b3
2022-02-24 19:51:59 +00:00
Jonathan Race 31ff7ce7e2 driver/secheduler/docs for Adds Pick guest CPU architecture based on
host arch in libvirt driver support

This is split 2 of 3 for the architecture emulation feature.

This implements emulated multi-architecture support through qemu
within OpenStack Nova.

Additional config variable check to pull host architecture into
hw_architecture field for emulation checks to be made.

Adds a custom function that simply performs a check for
hw_emulation_architecture field being set, allowing for core code to
function as normal while enabling a simple check to enable emulated
architectures to follow the same path as all multi-arch support
already established for physical nodes but instead levaraging qemu
which allows for the overall emulation.

Added check for domain xml unit test to strip arch from the os tag,
as it is not required uefi checks, and only leveraged for emulation
checks.

Added additional test cases test_driver validating emulation
functionality with checking hw_emulation_architecture against the
os_arch/hw_architecture field. Added required os-traits and settings
for scheduler request_filter.

Added RISCV64 to architecture enum for better support in driver.

Implements: blueprint pick-guest-arch-based-on-host-arch-in-libvirt-driver
Closes-Bug: 1863728
Change-Id: Ia070a29186c6123cf51e1b17373c2dc69676ae7c
Signed-off-by: Jonathan Race <jrace@augusta.edu>
2022-02-24 12:25:59 -05:00
Zuul b2ec3cd921 Merge "manage: Add image_property commands" 2022-02-24 13:00:52 +00:00
Lee Yarwood 19b7cf2170 manage: Add image_property commands
This adds an image property show and image property set command to
nova-manage to allow users to update image properties stored for an
instance in system metadata without having to rebuild the instance.
This is intended to ease migration to new machine types, as updating
the machine type could potentially invalidate the existing image
properties of an instance.

Co-Authored-By: melanie witt <melwittt@gmail.com>

Blueprint: libvirt-device-bus-model-update

Change-Id: Ic8783053778cf4614742186e94059d5675121db1
2022-02-24 01:00:36 +00:00
Zuul 26e65c3270 Merge "Update live_migration_downtime definition" 2022-02-23 20:12:03 +00:00
Pedro Almeida de110b042d Update live_migration_downtime definition
Before, the definition of live_migration_downtime didn't explain
if any exception/timeout occurs if the migration exceeds the value.
This is just used as a reference for nova and if any problem happens
when the VM gets paused, there will be no abort or force-complete.

Closes-Bug: #1960345
Signed-off-by: Pedro Almeida <pedro.monteiroazevedodemouraalmeida@windriver.com>
Change-Id: I336481d1801a367b5628fedcd2aa5f5cf763355a
2022-02-23 13:21:03 -03:00
Zuul cefc78e2d8 Merge "Fix to implement 'pack' or 'spread' VM's NUMA cells" 2022-02-17 20:28:04 +00:00
Dmitrii Shcherbakov 419391e97d Document remote-managed port usage considerations
While most of the SR-IOV related documentation resides in the Neutron
repository which is going to have a separate section on the topic of
supporting remote-managed ports and off-path networking backends, there
are still some things specific to Nova which are worth documenting in
Nova docs.

https://docs.openstack.org/neutron/latest/admin/config-sriov.html

Implements: blueprint integration-with-off-path-network-backends
Change-Id: I3c5fe8ec0539e10d07b1b4888e9833bc7ede1d04
2022-02-10 20:01:41 +03:00
Stephen Finucane c9a0c7da9b doc: Correct version for virtio-net multiqueue
This was eventually added in Yoga, not Xena.

Change-Id: I8afe755732c95d023b7c4bd99964507f54d324f1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-02-09 18:12:45 +00:00
Stephen Finucane 9a31212a44 doc: Split up notifications document
This was actually three documents in one:

- An admin doc detailing how to configure and use notifications
- A contributor doc describing how to extend the versioned notifications
- A reference doc listing available versioned notifications

Split the doc up to reflect this

Change-Id: I880f1c77387efcc3c1e147323b224e10156e0a52
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-02-09 18:02:04 +00:00
Stephen Finucane 95157314bd docs: Document virtio-net multiqueue
Mostly copy-paste from the spec, but at least this is in-tree and
updatable.

Change-Id: I4cad2111065fbc1840d44fc9f4bf6ac585e18db6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-02-09 18:00:05 +00:00
Ilya Popov d13412648d Fix to implement 'pack' or 'spread' VM's NUMA cells
Cells mean NUMA cells below in text.

By default, first instance's cell are placed to the host's cell with
id 0, so it will be exhausted first. Than host's cell with id 1 will
be used and exhausted. It will lead to error placing instance with
number of cells in NUMA topology equal to host's cells number if
some instances with one cell topology are placed on cell with id 0
before. Fix will perform several sorts to put less used cells at
the beginning of host_cells list based on PCI devices, memory and
cpu usage when packing_host_numa_cells_allocation_strategy is set
to False (so called 'spread strategy'), or will try to place all
VM's cell to the same host's cell untill it will be completely
exhausted and only after will start to use next available host's
cell (so called 'pack strategy'), when the configuration option
packing_host_numa_cells_allocation_strategy is set to True.

Partial-Bug: #1940668
Change-Id: I03c4db3c36a780aac19841b750ff59acd3572ec6
2022-02-08 10:46:28 +03:00
Zuul b6fe7521af Merge "docs: Follow-ups for cells v2, architecture docs" 2022-02-07 10:27:51 +00:00
Zuul 26ce7b30b2 Merge "docs: Add new architecture guide" 2022-02-03 18:28:02 +00:00
Stephen Finucane 136f1deb6e docs: Follow-ups for cells v2, architecture docs
Based on review feedback on [1] and [2].

[1] If39db50fd8b109a5a13dec70f8030f3663555065
[2] I518bb5d586b159b4796fb6139351ba423bc19639

Change-Id: I44920f20213462a3abe743ccd38b356d6490a7b4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-02-03 11:41:50 +00:00
Zuul b0633ac49b Merge "docs: Add a new cells v2 document" 2022-02-02 17:01:13 +00:00