diff options
author | Hans Lindgren <hanlind@kth.se> | 2013-04-29 23:17:41 +0200 |
---|---|---|
committer | Hans Lindgren <hanlind@kth.se> | 2013-05-01 18:51:54 +0200 |
commit | 9eb3dc7ed44d99652a17238724842e3067d46120 (patch) | |
tree | 8085e6229863a874678bb03d0d32f7b661d3f1a7 /nova/scheduler/manager.py | |
parent | 3266bff670f6ab25ab8d850917898bf4ee2a705c (diff) | |
download | nova-9eb3dc7ed44d99652a17238724842e3067d46120.tar.gz nova-9eb3dc7ed44d99652a17238724842e3067d46120.tar.xz nova-9eb3dc7ed44d99652a17238724842e3067d46120.zip |
Reset migrating task state for MigrationError exceptions
Create an exception type for pre-check errors and add it to the list
of exceptions for which instance task state is reset to ACTIVE to
avoid cases where an instance get stuck in MIGRATING state.
Convert existing instances of raise MigrationError in scheduler and
driver pre-checks to have them raise the new MigrationPreCheckError
exception instead.
In addition, also make sure that expected exceptions are passed over
RPC silently.
Resolves bug 1171526.
Change-Id: I00fa0962e555f895dd98861684ec7767fed3b37b
Diffstat (limited to 'nova/scheduler/manager.py')
-rw-r--r-- | nova/scheduler/manager.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/nova/scheduler/manager.py b/nova/scheduler/manager.py index c71b34963..65b171eba 100644 --- a/nova/scheduler/manager.py +++ b/nova/scheduler/manager.py @@ -40,6 +40,7 @@ from nova.openstack.common import jsonutils from nova.openstack.common import log as logging from nova.openstack.common.notifier import api as notifier from nova.openstack.common import periodic_task +from nova.openstack.common.rpc import common as rpc_common from nova import quota @@ -90,6 +91,14 @@ class SchedulerManager(manager.Manager): #function removed in RPC API 2.3 pass + @rpc_common.client_exceptions(exception.NoValidHost, + exception.ComputeServiceUnavailable, + exception.InvalidHypervisorType, + exception.UnableToMigrateToSelf, + exception.DestinationHypervisorTooOld, + exception.InvalidLocalStorage, + exception.InvalidSharedStorage, + exception.MigrationPreCheckError) def live_migration(self, context, instance, dest, block_migration, disk_over_commit): try: @@ -102,7 +111,8 @@ class SchedulerManager(manager.Manager): exception.UnableToMigrateToSelf, exception.DestinationHypervisorTooOld, exception.InvalidLocalStorage, - exception.InvalidSharedStorage) as ex: + exception.InvalidSharedStorage, + exception.MigrationPreCheckError) as ex: request_spec = {'instance_properties': { 'uuid': instance['uuid'], }, } |