commit 97a51d981bd603b964b04b3568218ce57ac57338
Author: Matt Riedemann <email address hidden>
Date: Fri Oct 27 16:03:15 2017 -0400
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.
NOTE(mriedem): There were a few changes needed for Newton:
1. There is no PlacementFixture but it's not needed.
2. The API client needs to have the microversion set from
the test.
3. The enabled_filters config option wasn't in Newton.
4. The scheduler has to be started before compute otherwise
we get a MessagingTimeout due to the CastAsCall fixture
during the compute startup.
Reviewed: https:/ /review. openstack. org/519684 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=97a51d981bd 603b964b04b3568 218ce57ac57338
Committed: https:/
Submitter: Zuul
Branch: stable/newton
commit 97a51d981bd603b 964b04b3568218c e57ac57338
Author: Matt Riedemann <email address hidden>
Date: Fri Oct 27 16:03:15 2017 -0400
Validate new image via scheduler during rebuild
During a rebuild we bypass the scheduler because we are Filter. Otherwise the new image
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 ImageProperties
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 <email address hidden>
Closes-Bug: #1664931
NOTE(mriedem): There were a few changes needed for Newton:
1. There is no PlacementFixture but it's not needed.
2. The API client needs to have the microversion set from
the test.
3. The enabled_filters config option wasn't in Newton.
4. The scheduler has to be started before compute otherwise
we get a MessagingTimeout due to the CastAsCall fixture
during the compute startup.
Depends-On: I344d8fdded9b7d 5385fcb41b699f1 352acb4cda7
Change-Id: I11746d1ea996a0 f18b7c54b4c9c21 df58cc4714b 3d93c7ce5a666a3 2233e02e34) 97bd02e373bfc53 d95808b833) c94992af63fc2f8 078023491a)
(cherry picked from commit 984dd8ad6add452
(cherry picked from commit 9e2d63da94db63d
(cherry picked from commit b72105c1c49fcdd