8f1773a7af
Change Ic3968721d257a167f3f946e5387cd227a7eeec6c in Newton started setting the RequestSpec.ignore_hosts field to the source instance.host during resize/cold migrate if allow_resize_to_same_host=False in config, which it is by default. Change I8abdf58a6537dd5e15a012ea37a7b48abd726579 also in Newton persists changes to the RequestSpec in conductor in order to save the RequestSpec.flavor for the new flavor. This inadvertently persists the ignore_hosts field as well. Later if you try to evacuate or unshelve the server it will ignore the original source host because of the persisted ignore_hosts value. This is obviously a problem in a small deployment with only a few compute nodes (like an edge deployment). As a result, an evacuation can fail if the only available host is the one being ignored. This change does two things: 1. In order to deal with existing corrupted RequestSpecs in the DB, this change simply makes conductor overwrite RequestSpec.ignore_hosts rather than append during evacuate before calling the scheduler so the current instance host (which is down) is filtered out. This evacuate code dealing with ignore_hosts goes back to Mitaka: I7fe694175bb47f53d281bd62ac200f1c8416682b The test_rebuild_instance_with_request_spec unit test is updated and renamed to actually be doing an evacuate which is what it was intended for, i.e. the host would not change during rebuild. 2. This change makes the RequestSpec no longer persist the ignore_hosts field like several other per-operation fields in the RequestSpec. The only operations that use ignore_hosts are resize (if allow_resize_to_same_host=False), evacuate and live migration, and the field gets reset in each case to ignore the source instance.host. The related functional recreate test is also updated to show the bug is fixed. Note that as part of that, the confirm_migration method in the fake virt driver needed to be implemented otherwise trying to evacuate back to the source host fails with an InstanceExists error since the confirmResize operation did not remove the guest from the source host. Conflicts: nova/objects/request_spec.py nova/tests/unit/conductor/test_conductor.py nova/tests/unit/objects/test_request_spec.py NOTE(mriedem): The (test_)request_spec.py conflicts are due to not having change I2131558f0edfe603ee1e8d8bae66a3caf5182a58 in Queens. test_save_does_not_persist_requested_fields from that change is ported and modified here to just deal with the ignore_hosts field. The test_conductor.py conflict is due to not having change I640562b8dd049ff5b6fea9286dc3082b9d837ed3 in Queens. Change-Id: I3f488be6f3c399f23ccf2b9ee0d76cd000da0e3e Closes-Bug: #1669054 (cherry picked from commit |
||
---|---|---|
.. | ||
__init__.py | ||
README.rst | ||
test_bug_1404867.py | ||
test_bug_1522536.py | ||
test_bug_1541691.py | ||
test_bug_1548980.py | ||
test_bug_1552888.py | ||
test_bug_1554631.py | ||
test_bug_1558866.py | ||
test_bug_1568208.py | ||
test_bug_1595962.py | ||
test_bug_1620248.py | ||
test_bug_1627838.py | ||
test_bug_1669054.py | ||
test_bug_1670627.py | ||
test_bug_1671648.py | ||
test_bug_1675570.py | ||
test_bug_1678326.py | ||
test_bug_1679750.py | ||
test_bug_1682693.py | ||
test_bug_1689692.py | ||
test_bug_1702454.py | ||
test_bug_1713783.py | ||
test_bug_1718455.py | ||
test_bug_1718512.py | ||
test_bug_1719730.py | ||
test_bug_1732947.py | ||
test_bug_1735407.py | ||
test_bug_1741125.py | ||
test_bug_1741307.py | ||
test_bug_1746483.py | ||
test_bug_1746509.py | ||
test_bug_1764883.py | ||
test_bug_1780373.py | ||
test_bug_1784353.py | ||
test_bug_1794996.py | ||
test_bug_1797580.py | ||
test_bug_1806064.py | ||
test_bug_1806515.py |
Tests for Specific Regressions
When we have a bug reported by end users that we can write a full stack reproduce on, we should. And we should keep a regression test for that bug in our tree. It can be deleted at some future date if needed, but largely should not be changed.
Writing Regression Tests
- These should be full stack tests which inherit from nova.test.TestCase directly. (This is to prevent coupling with other tests).
- They should setup a full stack cloud in their setUp via fixtures
- They should each live in a file which is named test_bug######.py
Writing Tests Before the Bug is Fixed
TODO describe writing and landing tests before the bug is fixed as a reproduce.