commit efab235f88ac040ef9654c782236b83ffcb473e3
Author: Matt Riedemann <email address hidden>
Date: Mon Mar 25 11:27:57 2019 -0400
Do not persist RequestSpec.ignore_hosts
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.
NOTE(mriedem): The (test_)request_spec.py conflicts are due to not
having change I2a78f0754c63381c57e7e1c610d0938b6df0f537 in Pike.
The test_conductor.py conflict is due to not having change
I70b11dd489d222be3d70733355bfe7966df556aa in Pike.
NOTE(mriedem): The functional test is adjusted slightly to pass
a string rather than list to _wait_for_migration_status since
change I752617066bb2167b49239ab9d17b0c89754a3e12 is not in Pike.
Change-Id: I3f488be6f3c399f23ccf2b9ee0d76cd000da0e3e
Closes-Bug: #1669054
(cherry picked from commit e4c998e57390c15891131205f7443fee98dde4ee)
(cherry picked from commit 76dfb9d0b6cee1bbb553d3ec11139ca99a6f9474)
(cherry picked from commit 31c08d0c7dc73bb2eefc69fa0f014b6478f3d149)
(cherry picked from commit 8f1773a7af273e2739843a804fb4fe718c0a242d)
Reviewed: https:/ /review. openstack. org/649387 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=efab235f88a c040ef9654c7822 36b83ffcb473e3
Committed: https:/
Submitter: Zuul
Branch: stable/pike
commit efab235f88ac040 ef9654c782236b8 3ffcb473e3
Author: Matt Riedemann <email address hidden>
Date: Mon Mar 25 11:27:57 2019 -0400
Do not persist RequestSpec. ignore_ hosts
Change Ic3968721d257a1 67f3f946e5387cd 227a7eeec6c in Newton ignore_ hosts field to the resize_ to_same_ host=False in config, which it is by
started setting the RequestSpec.
source instance.host during resize/cold migrate if
allow_
default.
Change I8abdf58a6537dd 5e15a012ea37a7b 48abd726579 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, ignore_ hosts
this change simply makes conductor overwrite RequestSpec.
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:
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
allow_resize_ to_same_ host=False) , evacuate and live migration, and
field like several other per-operation fields in the RequestSpec.
The only operations that use ignore_hosts are resize (if
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 1c57e7e1c610d09 38b6df0f537 in Pike. d222be3d7073335 5bfe7966df556aa in Pike.
having change I2a78f0754c6338
The test_conductor.py conflict is due to not having change
I70b11dd489
NOTE(mriedem): The functional test is adjusted slightly to pass migration_ status since 7b49239ab9d17b0 c89754a3e12 is not in Pike.
a string rather than list to _wait_for_
change I752617066bb216
Change-Id: I3f488be6f3c399 f23ccf2b9ee0d76 cd000da0e3e 891131205f7443f ee98dde4ee) bb553d3ec11139c a99a6f9474) 2eefc69fa0f014b 6478f3d149) 739843a804fb4fe 718c0a242d)
Closes-Bug: #1669054
(cherry picked from commit e4c998e57390c15
(cherry picked from commit 76dfb9d0b6cee1b
(cherry picked from commit 31c08d0c7dc73bb
(cherry picked from commit 8f1773a7af273e2