commit 1a11d5c7f35c17cfafc6b8ba57da88995c35b595
Author: Matt Riedemann <email address hidden>
Date: Fri Jan 25 10:55:00 2019 -0500
Raise InstanceFaultRollback for UnableToMigrateToSelf from _prep_resize
It is possible to cold migrate a stopped server. If, however, the
cold migrate is scheduled to the instance's current host and the
compute driver does not support cold migrating to the same host,
then UnableToMigrateToSelf was being raised from _prep_resize. If
_reschedule_resize_or_reraise re-raises that exception, then
_error_out_instance_on_exception in prep_resize handles it and
sets the instance vm_state to ACTIVE. This is wrong since the
instance power state is unchanged at this point and the instance
is actually stopped.
This fixes the problem by wrapping UnableToMigrateToSelf in
InstanceFaultRollback and raises that from _prep_resize, and
_error_out_instance_on_exception is called with the initial
vm_state (STOPPED in this case) so when _error_out_instance_on_exception
handles the InstanceFaultRollback exception it sets the instance
vm_state to STOPPED (what it already was) rather than ACTIVE.
There were no existing unit tests for the UnableToMigrateToSelf
case in _prep_resize so those are added here.
Reviewed: https:/ /review. opendev. org/666639 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=1a11d5c7f35 c17cfafc6b8ba57 da88995c35b595
Committed: https:/
Submitter: Zuul
Branch: stable/stein
commit 1a11d5c7f35c17c fafc6b8ba57da88 995c35b595
Author: Matt Riedemann <email address hidden>
Date: Fri Jan 25 10:55:00 2019 -0500
Raise InstanceFaultRo llback for UnableToMigrate ToSelf from _prep_resize
It is possible to cold migrate a stopped server. If, however, the ToSelf was being raised from _prep_resize. If _resize_ or_reraise re-raises that exception, then out_instance_ on_exception in prep_resize handles it and
cold migrate is scheduled to the instance's current host and the
compute driver does not support cold migrating to the same host,
then UnableToMigrate
_reschedule
_error_
sets the instance vm_state to ACTIVE. This is wrong since the
instance power state is unchanged at this point and the instance
is actually stopped.
This fixes the problem by wrapping UnableToMigrate ToSelf in ltRollback and raises that from _prep_resize, and out_instance_ on_exception is called with the initial out_instance_ on_exception llback exception it sets the instance
InstanceFau
_error_
vm_state (STOPPED in this case) so when _error_
handles the InstanceFaultRo
vm_state to STOPPED (what it already was) rather than ACTIVE.
There were no existing unit tests for the UnableToMigrate ToSelf
case in _prep_resize so those are added here.
Conflicts:
nova/ tests/unit/ compute/ test_compute_ mgr.py
NOTE(mriedem): The conflict is due to some unit tests from change 13f9e75a16639fa f890ddb1661b7eb not being in Stein.
I734cc01dce
Change-Id: I17543ecb572934 ecc7d0bbc7a4ad2 f537fa499bc 19f9c3d906caba9 c83cc8162a)
Closes-Bug: #1811235
(cherry picked from commit d1931ac06304155