nova/nova
Matt Riedemann 76dfb9d0b6 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.

Change-Id: I3f488be6f3c399f23ccf2b9ee0d76cd000da0e3e
Closes-Bug: #1669054
(cherry picked from commit e4c998e573)
2019-04-02 09:13:29 -04:00
..
api Fix links to neutron QoS minimum bandwidth doc 2019-03-21 11:47:19 +01:00
cells Per aggregate scheduling weight 2019-01-21 11:48:44 +08:00
cmd Pass kwargs to exception to get better format of error message 2019-03-15 10:42:18 +08:00
common
compute Remove unnecessary default provider_tree when getting traits 2019-03-18 20:16:00 +00:00
conductor Do not persist RequestSpec.ignore_hosts 2019-04-02 09:13:29 -04:00
conf Trivialfix for help description of images_type 2019-03-13 10:27:06 +08:00
console Use X-Forwarded-Proto as origin protocol if present 2019-01-16 00:28:53 +00:00
consoleauth Fix stacktraces with redis caching backend 2018-09-27 13:15:11 -04:00
db Pass kwargs to exception to get better format of error message 2019-03-15 10:42:18 +08:00
hacking Add a hacking rule for deprecated assertion methods 2018-10-25 11:49:10 +09:00
image Share snapshot image membership with instance owner 2019-02-08 18:06:27 -05:00
ipv6
keymgr
locale Imported Translations from Zanata 2018-09-23 06:53:32 +00:00
network Move slight bonkers IP management to privsep. 2019-03-17 23:19:08 +00:00
notifications The field instance_name was added to InstanceCreatePayload 2019-01-15 15:27:07 +00:00
objects Do not persist RequestSpec.ignore_hosts 2019-04-02 09:13:29 -04:00
pci Add get_instance_pci_request_from_vif 2019-03-07 11:37:53 +02:00
policies Merge "Remove deprecated 'flavors' policy" 2019-02-23 06:13:00 +00:00
privsep Merge "Move slight bonkers IP management to privsep." 2019-03-20 13:21:29 +00:00
scheduler Merge "Warn if group_policy is missing from flavor" 2019-03-06 18:46:00 +00:00
servicegroup Fix deprecation warning for threadgroup.add_timer 2019-02-07 09:37:00 -05:00
tests Do not persist RequestSpec.ignore_hosts 2019-04-02 09:13:29 -04:00
virt Do not persist RequestSpec.ignore_hosts 2019-04-02 09:13:29 -04:00
vnc Deprecate the nova-xvpvncproxy service 2018-10-15 10:03:13 +01:00
volume Merge "Avoid BadRequest error log on volume attachment" 2019-02-27 05:13:20 +00:00
__init__.py
availability_zones.py
baserpc.py
block_device.py Add method to generate device names universally 2019-01-15 18:55:11 +00:00
cache_utils.py
config.py Configure placement DB context manager for nova-manage/status 2018-09-05 10:29:48 -04:00
context.py Remove NovaException logging from scatter_gather_cells 2018-11-21 12:43:35 -05:00
crypto.py
debugger.py
exception.py Add get_instance_pci_request_from_vif 2019-03-07 11:37:53 +02:00
exception_wrapper.py Add full traceback to ExceptionPayload in versioned notifications 2018-06-19 16:46:46 +08:00
filters.py
hooks.py
i18n.py
loadables.py
manager.py
policy.py Fix string interpolations in logging calls 2019-01-29 15:06:39 +09:00
profiler.py
quota.py Merge "quota: remove defaults kwarg in get_project_quotas" 2019-02-26 13:26:24 +00:00
rc_fields.py Switch to using os-resource-classes 2019-02-07 11:11:09 +00:00
rpc.py Fix jsonutils.to_primitive UserWarning 2018-12-17 22:56:50 -05:00
safe_utils.py
service.py Move conductor wait_until_ready() delay before manager init 2018-08-31 12:50:10 -07:00
service_auth.py
test.py Use assertXmlEqual() helper for all XML comparison tests 2019-03-08 11:40:41 +00:00
utils.py Flavor extra spec and image properties validation from API 2019-03-05 12:05:06 -06:00
version.py
weights.py Per aggregate scheduling weight 2019-01-21 11:48:44 +08:00
wsgi.py