nova/nova
Matt Riedemann 9e2d63da94 Validate new image via scheduler during rebuild
During a rebuild we bypass the scheduler because we are
always rebuilding the instance on the same host it's already
on. However, we allow passing a new image during rebuild
and that new image needs to be validated to work with the
instance host by running it through the scheduler filters,
like the ImagePropertiesFilter. Otherwise the new image
could violate constraints placed on the host by the admin.

This change checks to see if there is a new image provided
and if so, modifies the request spec passed to the scheduler
so that the new image is validated all while restricting
the scheduler to still pick the same host that the instance
is running on. If the image is not valid for the host, the
scheduler will raise NoValidHost and the rebuild stops.

A functional test is added to show the recreate of the bug
and that we probably stop the rebuild now in conductor by
calling the scheduler to validate the image.

Co-Authored-By: Sylvain Bauza <sbauza@redhat.com>

Closes-Bug: #1664931

NOTE(mriedem): The backport has to explicitly use the
filter scheduler in the test setup and move the start of
the compute service to after the placement fixture usage.
This is because cc83335987
is not in stable/pike.

Change-Id: I11746d1ea996a0f18b7c54b4c9c21df58cc4714b
(cherry picked from commit 984dd8ad6a)
2017-11-14 10:14:46 -05:00
..
CA
api Merge "fix nova accepting invalid availability zone name with ':'" into stable/pike 2017-10-24 15:31:24 +00:00
cells Merge "Handle uuids in os-hypervisors API" 2017-07-20 01:03:27 +00:00
cmd Merge "Add nova-manage db command for ironic flavor migrations" into stable/pike 2017-10-04 23:37:18 +00:00
common
compute Validate new image via scheduler during rebuild 2017-11-14 10:14:46 -05:00
conductor Validate new image via scheduler during rebuild 2017-11-14 10:14:46 -05:00
conf Enable custom certificates for keystone communication 2017-09-20 08:54:18 +00:00
console Merge "Remove translation of log messages" 2017-08-10 11:39:03 +00:00
consoleauth Merge "Remove translation of log messages" 2017-08-10 11:39:03 +00:00
db Remove translation of log messages 2017-07-18 09:03:39 +00:00
hacking Remove unused variable 2017-06-12 18:19:57 +07:00
image Remove translation of log messages 2017-07-18 09:03:39 +00:00
ipv6
keymgr Remove key_manager.api_class hack 2017-07-17 17:49:08 -04:00
locale Imported Translations from Zanata 2017-08-10 11:34:33 +00:00
network neutron: handle binding:profile=None during migration 2017-09-21 13:33:00 -04:00
notifications Fix sending legacy instance.update notification 2017-10-10 13:20:34 -04:00
objects Pass requested_destination in filter_properties 2017-10-29 13:53:02 -04:00
pci Modify PciPassthroughFilter to accept lists 2017-04-11 19:49:07 +00:00
policies Merge "Add policy granularity to the Flavors API" 2017-08-10 11:47:12 +00:00
scheduler Ensure instance can migrate when launched concurrently 2017-09-29 14:16:52 -04:00
servicegroup Fix the display of updated_at time when using memcache driver. 2017-05-26 16:48:07 +08:00
tests Validate new image via scheduler during rebuild 2017-11-14 10:14:46 -05:00
virt libvirt: do not remove inst_base when volume-backed during resize 2017-11-02 18:05:26 +00:00
vnc
volume Translate the return value of attachment_create and _update 2017-07-25 21:16:03 -04:00
__init__.py
availability_zones.py Avoid lazy-load error when getting instance AZ 2017-05-25 15:46:22 -04:00
baserpc.py
block_device.py db: Add attachment_id to block_device_mapping 2017-03-16 15:26:33 -04:00
cache_utils.py remove log translation tags from nova.cells 2017-04-10 14:48:07 +00:00
config.py Integrate OSProfiler and Nova 2017-01-18 15:00:14 +07:00
context.py Regenerate context during targeting 2017-10-17 00:55:48 +00:00
crypto.py
debugger.py
exception.py Fix 409 handling in report client when deleting inventory 2017-08-01 17:58:29 -04:00
exception_wrapper.py Remove **kwargs passing in payload __init__ 2017-06-08 08:50:40 +00:00
filters.py
hooks.py
i18n.py
loadables.py
manager.py Integrate OSProfiler and Nova 2017-01-18 15:00:14 +07:00
policy.py Add policy granularity to the Flavors API 2017-07-19 15:56:47 -04:00
profiler.py Integrate OSProfiler and Nova 2017-01-18 15:00:14 +07:00
quota.py Make Quotas object favor the API database 2017-07-20 21:02:18 +00:00
rpc.py Merge "Account for compute.metrics.update in legacy notification whitelist" into stable/pike 2017-10-24 11:46:57 +00:00
safe_utils.py Allow wrapping of closures 2017-07-20 10:07:52 +01:00
service.py Fix comment for API binary name in WSGIService 2017-07-05 11:32:22 -04:00
service_auth.py Add service_token for nova-cinder interaction 2017-01-11 15:49:16 +00:00
test.py Merge "Ensure instance can migrate when launched concurrently" into stable/pike 2017-10-12 23:37:04 +00:00
utils.py Move the last_bytes util method to libvirt 2017-07-26 08:36:32 +10:00
version.py
weights.py Correct some spelling errors 2017-02-25 02:45:30 +00:00
wsgi.py [2/3]Replace six.iteritems() with .items() 2017-01-09 09:11:00 +00:00