Commit Graph

59623 Commits

Author SHA1 Message Date
Kashyap Chamarthy 267a40663c libvirt: Add a workaround to skip compareCPU() on destination
Nova's use of libvirt's compareCPU() API served its purpose
over the years, but its design limitations break live migration in
subtle ways.  For example, the compareCPU() API compares against the
host physical CPUID.  Some of the features from this CPUID aren not
exposed by KVM, and then there are some features that KVM emulates that
are not in the host CPUID.  The latter can cause bogus live migration
failures.

With QEMU >=2.9 and libvirt >= 4.4.0, libvirt will do the right thing in
terms of CPU compatibility checks on the destination host during live
migration.  Nova satisfies these minimum version requirements by a good
margin.  So, provide a workaround to skip the CPU comparison check on
the destination host before migrating a guest, and let libvirt handle it
correctly.  This workaround will be removed once Nova replaces the older
libvirt APIs with their newer and improved counterparts[1][2].

                - - -

Note that Nova's libvirt driver calls compareCPU() in another method,
_check_cpu_compatibility(); I did not remove its usage yet.  As it needs
more careful combing of the code, and then:

  - where possible, remove the usage of compareCPU() altogether, and
    rely on libvirt doing the right thing under the hood; or

  - where Nova _must_ do the CPU comparison checks, switch to the better
    libvirt CPU APIs -- baselineHypervisorCPU() and
    compareHypervisorCPU() -- that are described here[1].  This is work
    in progress[2].

[1] https://opendev.org/openstack/nova-specs/commit/70811da221035044e27
[2] https://review.opendev.org/q/topic:bp%252Fcpu-selection-with-hypervisor-consideration

Change-Id: I444991584118a969e9ea04d352821b07ec0ba88d
Closes-Bug: #1913716
Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
Signed-off-by: Balazs Gibizer <bgibizer@redhat.com>
2022-05-24 17:57:58 +02:00
Zuul 449aa39a96 Merge "Fix wrong attribute to find remote address" 2022-04-05 20:27:07 +00:00
Zuul 415084c4be Merge "hacking: Prevent use of six" 2022-04-05 15:27:06 +00:00
Zuul b320f16b85 Merge "Imported Translations from Zanata" 2022-04-05 13:08:02 +00:00
Zuul 702cbb72db Merge "Fix eventlet.tpool import" 2022-04-05 13:07:54 +00:00
Zuul 61bd852b01 Merge "Remove the code that never reach" 2022-04-05 13:07:45 +00:00
Zuul 0c61f89d10 Merge "Fix unit tests when they are run with OS_DEBUG=True" 2022-04-05 12:37:28 +00:00
Stephen Finucane b082d06cbc hacking: Prevent use of six
Spotted this in a review recently. We don't want people using six
anymore.

Change-Id: Ie107a95bc06390ab519d3b3af9b07103a9a14316
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-04-05 12:59:12 +01:00
Takashi Kajinami 5e6b9a8698 Fix wrong attribute to find remote address
The webob.Request class does not have the remote_address attribute but
the remote_addr attribute. This change fixes usage of the non-existing
attribute accordingly.

Closes-Bug: #1967683
Change-Id: I874e97ac6ad84daa20997345082cb4d1135699c4
2022-04-04 00:22:25 +09:00
OpenStack Proposal Bot 547ed98550 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I3a6aed10f05248deb8d63ea686ba45dee986e7a7
2022-04-01 04:02:00 +00:00
Zuul b0851b0e9c Merge "Fix pre_live_migration rollback" 2022-03-30 00:33:38 +00:00
Erlon R. Cruz 63ffba7496 Fix pre_live_migration rollback
During the pre live migration process, Nova performs most of the
tasks related to the creation and operation of the VM in the destination
host. That is done without interrupting any of the hardware in the source
host. If the pre_live_migration fails, those same operations should be
rolled back.

Currently nova is sharing the _rollback_live_migration for both
live and pre_live migration rollbacks, and that is causing the source
host to try to re-attach network interfaces on the source host where
they weren't actually de-attached.

This patch fixes that by adding a conditional to allow nova to do
different paths for migration and pre_live_migration rollbacks.

Closes-bug: #1944619
Change-Id: I784190ac356695dd508e0ad8ec31d8eaa3ebee56
2022-03-29 21:29:28 +00:00
Zuul ac0cec7c05 Merge "Move FIPS jobs to experimental and periodic queue" 2022-03-29 06:23:19 +00:00
Zuul c51f264ee1 Merge "Retry in CellDatabases fixture when global DB state changes" 2022-03-28 15:28:36 +00:00
Zuul 9694a52661 Merge "Adds regression test for bug LP#1944619" 2022-03-25 21:24:04 +00:00
Zuul 6a999d693e Merge "Update contributor guide for Zed" 2022-03-25 06:21:17 +00:00
melanie witt 1c8122a25f Retry in CellDatabases fixture when global DB state changes
There is a NOTE in the CellDatabases code about an unlikely but
possible race that can occur between taking the writer lock to set
the last DB context manager and taking the reader lock to call
target_cell(). When the race is detected, a RuntimeError is raised.

We can handle the race by retrying setting the last DB context manager
when the race is detected, as described in the NOTE.

Closes-Bug: #1959677

Change-Id: I5c0607ce5910dce581ab9360cc7fc69ba9673f35
2022-03-24 18:45:34 +00:00
Stephen Finucane 86ded7f65d objects: Remove 'NovaObjectDictCompat' from 'InstancePCIRequest'
Addresses a long-standing TODO. We remove the
'InstancePCIRequests.from_request_spec_instance_props' helper since it's
entirely unnecessary: the built-in 'obj_from_primitive' wrapper will do
what we want here (creating an o.vo from a serialized representation of
the object).

Change-Id: I5208b7dff996828137dfddfdd2db8737126884e3
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-03-23 15:16:00 +00:00
Stephen Finucane 028b3bca16 objects: Remove 'NovaObjectDictCompat' from 'Migration'
Addresses a long-standing TODO.

Change-Id: I57a1c4ca2ab23ca991344e73fb4ab5fbb2922723
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-03-23 15:15:41 +00:00
Zuul d2b2516122 Merge "doc: Remove useless contributor/api-2 doc" 2022-03-23 15:13:32 +00:00
Zuul ba63a5647c Merge "doc: Split up notifications document" 2022-03-23 15:00:55 +00:00
Stephen Finucane 7beff288d6 doc: Remove useless contributor/api-2 doc
There's nothing of use in here. A section on creating extensions for the
API is removed since this is no longer a thing.

Change-Id: I18a6f642c046051cd6084ab920d78f27887ca13d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-03-23 09:58:32 +00:00
Artom Lifshitz 84c6d05ac3 Fix unit tests when they are run with OS_DEBUG=True
This patch fix test_default_logging test.
The test validates that we have two logging handlers:
1 x to display default messages (info, error, warnings...)
1 x to redirect debug messages to null and so don't display them.

However, if OS_DEBUG=True is set in a shell session, then the test is
run and fails. Because, in debug mode, we should have only one handler
to display all messages. (look at comments for more details and
 test_debug_logging test).

To fix the test, we explicitly set OS_DEBUG=0 when running
test_default_logging, so it will ensure we have two handlers whatever
OS_DEBUG value.

Co-authored-by: Rene Ribaud <rribaud@redhat.com>
Closes-Bug: #1964497

Change-Id: I7c0151d988c538dd2d083aab4b3e18ddb8151045
2022-03-23 10:31:04 +01:00
Zuul de10013328 Merge "Add Python3 zed unit tests" 2022-03-19 11:29:29 +00:00
Zuul 2a73a1db84 Merge "Update master for stable/yoga" 2022-03-17 17:21:16 +00:00
Erlon R. Cruz 2ddb8bf53f Adds regression test for bug LP#1944619
Related-bug: #1944619
Closes-bug: #1964472
Change-Id: Ie7e5377aea23a4fbd7ad91f245d17def6d0fb927
2022-03-16 13:33:56 -03:00
Zuul dde15d9c47 Merge "Attempt to thin out nova-ceph-multistore" 2022-03-15 00:33:56 +00:00
Dan Smith 16a463a68f Attempt to thin out nova-ceph-multistore
This job is pretty heavy and has been triggering OOMs that take out
mysqld lately. This disables swift (and c-bak as a result) to try to
reduce the runtime footprint. Losing coverage of these services
should not be a problem for the goal of this job.

Change-Id: Icc18ddd847465069aea34b226851afaeb94594fc
2022-03-14 11:48:00 -07:00
afariasa 6ab6969550 Move FIPS jobs to experimental and periodic queue
Change-Id: Id8d29ac00102c958ddc6f8d0c217fb11282a7d08
2022-03-14 11:54:51 +00:00
Takashi Natsume 0638d1eb44 Update contributor guide for Zed
Change-Id: I6dc244001e6f65b839e8507843040dae623a2c90
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2022-03-12 01:56:03 +09:00
OpenStack Release Bot 3d20fd3fd1 Add Python3 zed unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for zed.

See also the PTI in governance [1].

[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html

Change-Id: Ia141d43de268b1153b157b1adccb111955f36fd6
2022-03-11 09:54:50 +00:00
OpenStack Release Bot d2cba990a6 Update master for stable/yoga
Add file to the reno documentation build to show release notes for
stable/yoga.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/yoga.

Sem-Ver: feature
Change-Id: I596e4e49e4982b6c47457d565f389f749783b23f
2022-03-11 09:54:44 +00:00
Jonathan Race 43f13acab5 Changes Emulation CI to weekly-periodic
Due to initial release of emulated architecture feature the CI
has been changed to run less frequent to save CI hours. This
will be revisited in later releases as feature gains greater
support and capabilities.

Implements: blueprint pick-guest-arch-based-on-host-arch-in-libvirt-driver
Signed-off-by: Jonathan Race <jrace@augusta.edu>
Change-Id: I7b085c2086a720a049c9b04a6ff10a0e5cc9d650
2022-03-10 13:21:50 -05:00
Zuul 60094e663c Merge "Add the Yoga prelude section" 2022-03-10 16:07:52 +00:00
Zuul d90b308367 Merge "Clean up when queued live migration aborted" 2022-03-10 16:07:44 +00:00
Zuul f41be79f1a Merge "Revert "Adds regression test for bug LP#1944619"" 2022-03-10 14:16:09 +00:00
Zuul 57c39d4626 Merge "Fix migration with remote-managed ports & add FT" 2022-03-10 13:50:22 +00:00
Balazs Gibizer 187ef95592 Revert "Adds regression test for bug LP#1944619"
This reverts commit d43538712c.

Reason for revert: The functional test introduced here is unstable. See https://bugs.launchpad.net/nova/+bug/1964472 

Change-Id: I8c3a1655933300357aaf300650f91689d9a46bf5
2022-03-10 13:14:31 +00:00
Zuul 2b7e44b890 Merge "Add functional tests to reproduce bug #1960412" 2022-03-10 12:46:33 +00:00
Zuul efb03b1936 Merge "reenable greendns in nova." 2022-03-09 21:47:56 +00:00
Alexey Stupnikov 219520d9ce Clean up when queued live migration aborted
This patch solves bug #1949808 and bug #1960412 by tuning
live_migration_abort() function and adding calls to:

- remove placement allocations for live migration;
- remove INACTIVE port bindings against destination compute node;
- restore instance's state.

Related unit test was adjusted and related functional tests were
fixed.

Closes-bug: #1949808
Closes-bug: #1960412

Change-Id: Ic97eff86f580bff67b1f02c8eeb60c4cf4181e6a
2022-03-09 14:17:10 +00:00
Alexey Stupnikov 1ad287bf9a Add functional tests to reproduce bug #1960412
Instance would be affected by problems described in bug #1949808
and bug #1960412 when queued live migration is aborted.

This change adds functional test to reproduce problems with
placement allocations (record for aborted live migration is not
removed when queued live migration is aborted) and with Neutron port
bindings (INACTIVE port binding records for destination host are not
removed when queued live migration is aborted).

It looks like there are no other modifications introduced by Nova
control plane which should be reverted when queued live migration is
aborted.

This patch also changes libvirt and neutron fixtures:

- libvirt fixture was changed to support live migrations of
  instances with regular ports: without this change
  _update_vif_xml() complains about lack of address element in VIF's
  XML.
- neutron fixture was changed to improve active port binding's
  tracking during live migration: without this change port's
  binding:host_id is not updated when activate_port_binding() is
  called. As a result, list_ports() function returns empty list
  when constants.BINDING_HOST_ID is used in search_opts, which is
  the case for setup_networks_on_host() called with teardown=True.

Related-bug: #1960412
Related-bug: #1949808
Change-Id: I152581deb6e659c551f78eed66e4b0b958b20c53
2022-03-09 15:08:22 +01:00
Zuul 2b4879d088 Merge "Adds regression test for bug LP#1944619" 2022-03-09 13:44:58 +00:00
Zuul d1b036fdb1 Merge "Follow up for unified limits" 2022-03-09 10:33:14 +00:00
Sylvain Bauza 9f1c28e4ae Add the Yoga prelude section
Coming straight from the cycle highlights.

Change-Id: I329092a352d44a6833efd11f5e9c5a1c6fc8d1be
2022-03-09 09:46:55 +01:00
Sean Mooney fe1ebe69f3 reenable greendns in nova.
Back in the days of centos 6 and python 2.6 eventlet
greendns monkeypatching broke ipv6. As a result nova
has run without greendns monkey patching ever since.
This removes that old workaround allowing modern
eventlet to use greendns for non blocking dns lookups.

Closes-Bug: #1964149
Change-Id: Ia511879d2f5f50a3f63d180258abccf046a7264e
2022-03-08 16:16:11 +00:00
Zuul 3d9d328727 Merge "Add grenade-skip-level irrelevant-files config" 2022-03-07 20:36:44 +00:00
Zuul 1fe1624e95 Merge "Enable unified limits in the nova-next job" 2022-03-05 07:25:29 +00:00
Dmitrii Shcherbakov 3fd7e94893 Fix migration with remote-managed ports & add FT
`binding:profile` updates are handled differently for migration from
instance creation which was not taken into account previously. Relevant
fields (card_serial_number, pf_mac_address, vf_num) are now added to the
`binding:profile` after a new remote-managed PCI device is determined at
the destination node.

Likewise, there is special handling for the unshelve operation which is
fixed too.

Func testing:

* Allow the generated device XML to contain the PCI VPD capability;
* Add test cases for basic operations on instances with remote-managed
  ports (tunnel or physical);
* Add a live migration test case similar to how it is done for
  non-remote-managed SR-IOV ports but taking remote-managed port related
  specifics into account;
* Add evacuate, shelve/unshelve, cold migration test cases.

Change-Id: I9a1532e9a98f89db69b9ae3b41b06318a43519b3
2022-03-04 18:41:48 +03:00
melanie witt 5505b6f438 Follow up for unified limits
This addresses remaining comments from the unified limits series to add
type hints to new code and add a docstring to the is_qfd_populated()
method in nova/quota.py.

Related to blueprint unified-limits-nova

Change-Id: I948647b04b260e888a4c71c1fa3c2a7be5d140c5
2022-03-04 03:42:58 +00:00