Commit Graph

4072 Commits

Author SHA1 Message Date
zhong.zhou f3eb76e57b Validate flavor image min ram when resize volume-backed instance
When resize instance, the flavors returned may not meet the image
minimum memory requirement, resizing instance ignores the minimum
memory limit of the image, which may cause the resizing be
successfully, but the instance fails to start because the memory is
too small to run the system.

Related-Bug: 2007968
Change-Id: I132e444eedc10b950a2fc9ed259cd6d9aa9bed65
2024-04-18 10:53:04 +08:00
zhong.zhou b434b42761 Regression test for bug 2007968
Related-Bug: 2007968
Change-Id: I9d5a3813cad3c9ee1c6097959a972cf8307795cd
2024-04-18 10:44:46 +08:00
Zuul c199becf52 Merge "Refactor vf profile for PCI device" 2024-04-11 14:38:11 +00:00
Zuul e255323f46 Merge "libvirt: Cap with max_instances GPU types" 2024-03-18 12:31:30 +00:00
Zuul ef069d928a Merge "pwr mgmt: handle live migrations correctly" 2024-03-14 00:06:49 +00:00
Zuul b10cca0282 Merge "Reproducer test for live migration with power management" 2024-03-13 23:48:38 +00:00
Zuul b59e1f8c00 Merge "Power on cores for isolated emulator threads" 2024-03-13 19:24:15 +00:00
Artom Lifshitz c1ccc1a316 pwr mgmt: handle live migrations correctly
Previously, live migrations completely ignored CPU power management.
This patch makes sure that we correctly:

* Power up the cores on the destination during pre_live_migration, as
  we need them powered up before the instance starts on the
  destination.
* If the live migration is successful, power down the vacated cores on
  the source.
* In case of a rollback, power down the cores previously powered up on
  pre_live_migration.

Closes-bug: 2056613
Change-Id: I787bd7807950370cd865f29b95989d489d4826d0
2024-03-11 14:21:27 -04:00
Artom Lifshitz 1f5e3421ec Reproducer test for live migration with power management
Building on the previous patch's refactor, we can now do functional
testing of live migration with CPU power management. We quickly notice
that it's mostly broken, leaving the CPUs powered up on the source,
and not powering them up on the dest.

Related-bug: 2056613
Change-Id: Ib4de77d68ceeffbc751bca3567ada72228b750af
2024-03-11 12:10:36 -04:00
Zuul 671c4e0313 Merge "Reproducer for not powering on isolated emulator threads cores" 2024-03-11 15:53:10 +00:00
Zuul 336b815a30 Merge "Reproducers for bug 1869804" 2024-03-11 14:20:46 +00:00
Artom Lifshitz 0986d2bbe8 Power on cores for isolated emulator threads
Previously, with the `isolate` emulator threads policy and libvirt cpu
power management enabled, we did not power on the cores to which the
emulator threads were pin. Start doing that, and don't forget to power
them down when the instance is stopped.

Closes-bug: 2056612
Change-Id: I6e5383d8a0bf3f0ed8c870754cddae4e9163b4fd
2024-03-08 20:31:34 -05:00
Artom Lifshitz 521af26209 Reproducer for not powering on isolated emulator threads cores
Related-bug: 2056612
Change-Id: Icd586cdd015143b2e113fd14904f40410809d247
2024-03-08 20:31:30 -05:00
Zuul 13ccaf75f6 Merge "Implement add_consumer, remove_consumer KeyManager APIs" 2024-03-06 12:53:46 +00:00
Sylvain Bauza 60851e4464 libvirt: Cap with max_instances GPU types
We want to cap a maximum mdevs we can create.
If some type has enough capacity, then other GPUs won't be used and
existing ResourceProviders would be deleted.

Closes-Bug: #2041519
Change-Id: I069879a333152bb849c248b3dcb56357a11d0324
2024-03-05 11:48:19 +01:00
Zuul 39de10777b Merge "Add support for showing requested az in output" 2024-03-01 20:39:00 +00:00
Zuul 9675f142b0 Merge "testing: Add ephemeral encryption support to fixtures" 2024-03-01 20:05:27 +00:00
Rajesh Tailor c98c8d84ee Add support for showing requested az in output
As of now, the server show and server list --long output
shows the availability zone, that is, the AZ to which the
host of the instance belongs. There is no way to tell from
this information if the instance create request included an
AZ or not.

This change adds a new api microversion to add support for
including availability zone requested during instance create
in server show and server list --long responses.

Change-Id: If4cf09c1006a3f56d243b9c00712bb24d2a796d3
2024-03-01 21:39:04 +05:30
Amit Uniyal a1a07e0d2d Refactor vf profile for PCI device
In general the card_serial_number will not be present on sriov
VFs/PFs, it is only supported on very new cards.
Also, all 3 need not to be always required for vf_profile.

Related-Bug: #2008238
Change-Id: I00b126635612ace51b5e3138afcb064f001f1901
2024-03-01 15:28:25 +00:00
melanie witt 3a1c65a632 testing: Add ephemeral encryption support to fixtures
This adds encryption related methods and attributes to test fixtures to
enable functional testing for ephemeral encryption.

Related to blueprint ephemeral-encryption-libvirt

Change-Id: If65ec55d311ecf7fb3fe745ebbf116a430f60681
2024-02-29 22:20:21 +00:00
Zuul d29a9b64ee Merge "Make compute node rebalance safer" 2024-02-29 18:48:26 +00:00
Zuul b6dc431831 Merge "Add nova-manage ironic-compute-node-move" 2024-02-29 18:46:32 +00:00
Zuul 060445aa2f Merge "Modify the mdevs in the migrate XML" 2024-02-29 06:58:40 +00:00
Sylvain Bauza 8abc7b47fd Modify the mdevs in the migrate XML
Now the destination returns the list of the needed mdevs for the
migration, we can change the XML.

Note: this is the last patch of the feature branch.
I'll work on adding mtty support in the next patches in the series
but that's not a feature usage.

Change-Id: Ib448444be09df50c3db5ccda8a49bfd882c18edf
Implements: blueprint libvirt-mdev-live-migrate
2024-02-28 15:53:49 +01:00
John Garbutt 947bb5f641 Make compute node rebalance safer
Many bugs around nova-compute rebalancing are focused around
problems when the compute node and placement resources are
deleted, and sometimes they never get re-created.

To limit this class of bugs, we add a check to ensure a compute
node is only ever deleted when it is known to have been deleted
in Ironic.

There is a risk this might leave orphaned compute nodes and
resource providers that need manual clean up because users
do not want to delete the node in Ironic, but are removing it
from nova management. But on balance, it seems safer to leave
these cases up to the operator to resolve manually, and collect
feedback on how to better help those users.

blueprint ironic-shards

Change-Id: I2bc77cbb77c2dd5584368563dc4250d71913906b
2024-02-25 13:25:27 -08:00
John Garbutt 08d7be1726 Add nova-manage ironic-compute-node-move
When people transition from three ironic nova-compute processes down
to one process, we need a way to move the ironic nodes, and any
associcated instances, between nova-compute processes.

For saftey, a nova-compute process must first be forced_down via
the API, similar to when using evacaute, before moving the associated
ironic nodes to another nova-compute process. The destination
nova-compute process should ideally not be running, but not forced
down.

blueprint ironic-shards

Change-Id: I33034ec77b033752797bd679c6e61cef5af0a18f
2024-02-25 13:25:27 -08:00
Zuul 9a9ab2128b Merge "Reserve mdevs to return to the source" 2024-02-23 15:46:08 +00:00
Zuul bdd7daffbb Merge "Check if destination can support the src mdev types" 2024-02-23 15:46:01 +00:00
Zuul f15b8b7204 Merge "check both source and dest compute libvirt versions for mdev lv" 2024-02-23 15:40:00 +00:00
Sylvain Bauza 2e1e12cd62 Reserve mdevs to return to the source
The destination lookups at the src mdev types and returns its own
mdevs using the same type. We also reserve them by an internal dict
and we make sure we can cleanup this dict if the live-migration aborts.

Partially-Implements: blueprint libvirt-mdev-live-migrate
Change-Id: I4a7e5292dd3df63943bd9f01803fa933e0466014
2024-02-16 16:05:48 +01:00
Ghanshyam Mann 0c1e1ccf03 HyperV: Remove RDP console API
RDP console was only for HyperV driver so removing the
API. As API url stay same (because same used for other
console types API), RDP console API will return 400.

Cleaning up the related config options as well as moving its
API ref to obsolete seciton.

Keeping RPC method to avoid error when old controller is used
with new compute. It can be removed in next RPC version bump.

Change-Id: I8f5755009da4af0d12bda096d7a8e85fd41e1a8c
2024-02-13 12:24:38 -08:00
Ghanshyam Mann 3e47439a68 HyperV: Remove RDP console connection information API
The RDP console was only available for HyperV driver, therefore its
connection information via API ``os-console-auth-tokens`` will now return
HTTP ``400 (BadRequest)`` error.

Starting from 2.31 microversion, this API return connection info
for all other console type.

Change-Id: I94e590eb4cbe3b2d8eff7fe881f7b98af8979be2
2024-02-13 19:28:07 +00:00
Sylvain Bauza 489aab934c Check if destination can support the src mdev types
Now that the source knows that both the computes support the right
libvirt version, it passes to the destination the list of mdevs it has
for the instance. By this change, we'll verify if the types of those
mdevs are actually supported by the destination.
On the next change, we'll pass the destination mdevs back to the
source.

Partially-Implements: blueprint libvirt-mdev-live-migrate
Change-Id: Icb52fa5eb0adc0aa6106a90d87149456b39e79c2
2024-02-05 15:10:55 +01:00
Sylvain Bauza baa78326dd check both source and dest compute libvirt versions for mdev lv
Since only qemu 8.1 and libvirt 8.6.0 supports mdev live-migration,
we need to verify the values of the hypervisor for both the source
and the destination.

If one of them are older, the conductor raises an exception that will
eventually fact the API to return an HTTP500.

Change-Id: I17f170143c58401b8b0a5a93e83355b1f7178ab5
Partially-Implements: blueprint libvirt-mdev-live-migrate
2024-01-30 20:45:13 +01:00
Amit Uniyal b5173b4192 Fixes: bfv vm reboot ends up in an error state.
we only need to verify if bdm has attachment id and it should be present in both nova and cinde DB.

For tests coverage, added tests for bfv server to test different bdm source type.

Closes-Bug: 2048154
Closes-Bug: 2048184
Change-Id: Icffcbad27d99a800e3f285565c0b823f697e388c
2024-01-18 05:53:51 +00:00
Zuul a72f7eaac7 Merge "Adds server show in helpers" 2024-01-16 11:33:03 +00:00
Zuul 7c2e79f762 Merge "Allow best effort sending of notifications" 2023-12-20 23:29:44 +00:00
Zuul 9e6b44b93e Merge "Adds a repoducer for post_live_migration_at_destination failures" 2023-12-20 05:43:11 +00:00
Artom Lifshitz 06d25926a1 Allow best effort sending of notifications
In the previous patch we changed the ordering of operations during
post_live_migration() to minimize guest networking downtime by
activating destination host port bindings as soon as possible.

Review of that patch led to the realization that exceptions during
notification sending can prevent the port binding activation from
happening. Instead of handling that in a localized try/catch, this
patch implements a general best_effort kwarg to our two notification
sending helpers to allow callers to indicate that any exceptions
during notification sending should not be fatal.

Change-Id: I01a15d6fffe98816ae019e67dc72784299fedfd3
2023-12-17 08:37:11 -05:00
Sean Mooney f4852f4c81 [codespell] fix final typos and enable ci
This chnage adds the pre-commit config and
tox targets to run codespell both indepenetly
and via the pep8 target.

This change correct all the final typos in the
codebase as detected by codespell.

Change-Id: Ic4fb5b3a5559bc3c43aca0a39edc0885da58eaa2
2023-12-15 12:32:42 +00:00
Zuul fac01e7d55 Merge "tests: Use clearer syntax for empty generator" 2023-12-14 11:18:27 +00:00
Zuul 8644855533 Merge "Use SDK for deprecated baremetal proxy API" 2023-12-14 00:07:25 +00:00
Zuul 17b7aa3926 Merge "[codespell] fix typos in tests" 2023-12-13 23:46:08 +00:00
René Ribaud 5b7dde4379 Reproducers for bug 1869804
Live migrating a VM with no CPU policy and no NUMA topology to a host with
cpu_shared_set configured will not update VM's configuration accordingly.

Example: live migrating a VM from source host with cpu_shared_set=0,1 to
destination host with cpu_shared_set=2,3 will leave the VM configuration
pinned to CPUs 0,1 (<vcpu cpuset="0-1"> instead of <vcpu cpuset="2-3">).

This patch adds reproducers for live migrated instances and various
combinations of cpu_shared_set configuration.
- From a host with cpu_shared_set to a host with different cpu_shared_set.
- From a host with cpu_shared_set to a host without cpu_shared_set.
- From a host without cpu_shared_set to a host with cpu_shared_set.

This also adds the required changes to the libvirt fixture to manage
cpuset inside the vcpu tag.

Related-Bug: #1869804
Change-Id: Ib294a9d3c25b9a8548347dbe00416a55db567773
2023-12-13 19:22:44 +01:00
Zuul c7dba52e4e Merge "[codespell] start fixing all the typos" 2023-12-11 09:06:40 +00:00
Stephen Finucane a176d524c6 tests: Use clearer syntax for empty generator
Placing 'yield' after a 'return' is dark magic, even if it's technically
allowed. Use 'yield from' instead.

Change-Id: Ie5e8befcbeeb42094d1056e00c939e384a72ceb3
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-12-07 11:51:09 +00:00
Zuul 0d0600d62e Merge "Do not untrack resources of a server being unshelved" 2023-12-05 12:56:30 +00:00
Stephen Finucane 259b646afa Use SDK for deprecated baremetal proxy API
We had indicated that we would never switch this over to SDK, however,
this is the sole remaining user of ironicclient which means users would
continue needing to install that just for this little API. Better to
switch this holdout over and finally delete all the things.

Change-Id: I880523935d73ca94c83e618f10c2e587362c53be
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-12-05 12:09:36 +00:00
Zuul f771778282 Merge "Reproduce bug #2025480 in a functional test" 2023-12-05 11:43:43 +00:00
Zuul 33ab9c5d0e Merge "[libvirt]Add migration_inbound_addr" 2023-12-05 11:43:35 +00:00