nova/nova/tests/functional
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
..
api Validate new image via scheduler during rebuild 2017-11-14 10:14:46 -05:00
api_sample_tests Merge "Handle uuids in os-hypervisors API" 2017-07-20 01:03:27 +00:00
compute Resource tracker compatibility with Ocata and Pike 2017-08-10 09:47:20 -04:00
db Add ComputeNodeList.get_by_hypervisor_type() 2017-09-20 21:34:05 -04:00
libvirt Merge "Bump minimum required libvirt/qemu versions for Pike" 2017-02-24 02:50:33 +00:00
notification_sample_tests Remove dest node allocation if evacuate MoveClaim fails 2017-09-12 15:49:33 -04:00
regressions Functional regression test for evacuate with a target 2017-10-29 13:50:04 -04:00
wsgi Support tag instances when boot(4/4) 2017-07-17 15:59:42 -04:00
__init__.py move eventlet GREENDNS override to top level 2014-12-08 17:41:03 -05:00
api_paste_fixture.py Remove legacy v2 API functional tests 2016-05-04 18:17:23 +08:00
api_samples_test_base.py Provide a hint when _verify_response fails 2017-06-19 15:57:47 -04:00
integrated_helpers.py Validate new image via scheduler during rebuild 2017-11-14 10:14:46 -05:00
test_aggregates.py re-Allow adding computes with no ComputeNodes to aggregates 2017-05-25 10:56:29 -07:00
test_compute_mgr.py Stop using mox stubs in cast_as_call.py 2017-07-25 00:40:41 +00:00
test_images.py Add create image functional negative tests 2016-12-26 14:15:14 +09:00
test_instance_actions.py make microversion a client level construct for tests 2016-02-24 11:02:05 -05:00
test_legacy_v2_compatible_wrapper.py Trivial-Fix: Fix typos 2016-06-13 06:41:08 +00:00
test_list_servers_ip_filter.py Stop using mox stubs in cast_as_call.py 2017-07-25 00:40:41 +00:00
test_login.py update api_samples code to use better variables 2015-12-14 11:23:26 +08:00
test_metadata.py Remove unused logging import 2017-02-17 15:17:51 +07:00
test_middleware.py Removes unnecessary utf-8 encoding 2016-12-20 10:27:01 +07:00
test_nova_manage.py Add nova-manage db command for ironic flavor migrations 2017-09-20 21:35:24 -04:00
test_server_group.py Scheduler calling the Placement API 2017-01-27 16:36:34 -08:00
test_servers.py Validate new image via scheduler during rebuild 2017-11-14 10:14:46 -05:00