commit d1931ac0630415519f9c3d906caba9c83cc8162a
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/633227 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=d1931ac0630 415519f9c3d906c aba9c83cc8162a
Committed: https:/
Submitter: Zuul
Branch: master
commit d1931ac06304155 19f9c3d906caba9 c83cc8162a
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.
Change-Id: I17543ecb572934 ecc7d0bbc7a4ad2 f537fa499bc
Closes-Bug: #1811235