commit 2efe3f6b8844bd328bbe12eeac3fae10be159542
Author: Matt Riedemann <email address hidden>
Date: Mon Jan 29 10:50:36 2018 -0500
Rollback instance.image_ref on failed rebuild
When rebuilding and changing the image, we run the new image
through the scheduler to see if it's valid for the instance
on its current compute host. The API saves off the new image
ref on the instance before casting to conductor to run through
the scheduler. If the scheduler fails, the instance.image_ref was
not being rolled back, which meant a user could attempt the rebuild
with the same invalid image a second time and the API, seeing the
instance.image_ref hasn't changed (even though it's not the actual
backing image for the server), will bypass the scheduler and rebuild
the instance with that invalid image.
This fixes the issue by using the original image ref, passed from
API to conductor during rebuild, to reset the instance.image_ref
in the case of a failure.
Note that there are other things changed on the instance in the API
which this patch does not attempt to recover as that's a bigger
work item which likely involves substantial refactoring of the code.
NOTE(mriedem): The conflicts in manager.py are due to not having
I06d78c744fa75ae5f34c5cfa76bc3c9460767b84 in Ocata. The functional
test conflict is due to tests that existed in Pike which don't exist
in Ocata.
Change-Id: I3399a66fe9b1297cd6b0dca440145393ceaef41f
(cherry picked from commit 4a2c9a4887a219a6d4dfe83c430b040713fc4109)
(cherry picked from commit 834adeae9a3ff1bb87f22066131d48230ef96b69)
Reviewed: https:/ /review. openstack. org/539008 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=2efe3f6b884 4bd328bbe12eeac 3fae10be159542
Committed: https:/
Submitter: Zuul
Branch: stable/ocata
commit 2efe3f6b8844bd3 28bbe12eeac3fae 10be159542
Author: Matt Riedemann <email address hidden>
Date: Mon Jan 29 10:50:36 2018 -0500
Rollback instance.image_ref on failed rebuild
When rebuilding and changing the image, we run the new image image_ref hasn't changed (even though it's not the actual
through the scheduler to see if it's valid for the instance
on its current compute host. The API saves off the new image
ref on the instance before casting to conductor to run through
the scheduler. If the scheduler fails, the instance.image_ref was
not being rolled back, which meant a user could attempt the rebuild
with the same invalid image a second time and the API, seeing the
instance.
backing image for the server), will bypass the scheduler and rebuild
the instance with that invalid image.
This fixes the issue by using the original image ref, passed from
API to conductor during rebuild, to reset the instance.image_ref
in the case of a failure.
Note that there are other things changed on the instance in the API
which this patch does not attempt to recover as that's a bigger
work item which likely involves substantial refactoring of the code.
Closes-Bug: #1746032
Conflicts:
nova/ conductor/ manager. py
nova/ tests/functiona l/test_ servers. py
NOTE(mriedem): The conflicts in manager.py are due to not having a75ae5f34c5cfa7 6bc3c9460767b84 in Ocata. The functional
I06d78c744f
test conflict is due to tests that existed in Pike which don't exist
in Ocata.
Change-Id: I3399a66fe9b129 7cd6b0dca440145 393ceaef41f 6d4dfe83c430b04 0713fc4109) b87f22066131d48 230ef96b69)
(cherry picked from commit 4a2c9a4887a219a
(cherry picked from commit 834adeae9a3ff1b