Reset instance to ACTIVE when no hosts found
bug 928521 modified nova/scheduler/manager.py to reset vm_state to ACTIVE and set task_state to None when prep_resize raises a NoHostsFound refactored run_instance and prep_resize so they don't go through _schedule and now must be implemented in driver Changed behavior to set vm_state to error on any other exception in prep_resize. Change behavior to change instance vm_state to ERROR on exceptions Added tests that the vm_state gets updated Added tests that schedule_prep_resize and schedule_run_instance have no implementation in the Driver base class Had to adjust methods and tests for Multi scheduler to reflect the new Scheduler contract Change-Id: Ibcac7ef0df3456793a2132beb7a711849510da80
This commit is contained in:
@@ -41,10 +41,8 @@ FLAGS = flags.FLAGS
|
||||
FLAGS.register_opts(multi_scheduler_opts)
|
||||
|
||||
# A mapping of methods to topics so we can figure out which driver to use.
|
||||
_METHOD_MAP = {'run_instance': 'compute',
|
||||
'prep_resize': 'compute',
|
||||
'live_migration': 'compute',
|
||||
'create_volume': 'volume',
|
||||
# There are currently no compute methods proxied through the map
|
||||
_METHOD_MAP = {'create_volume': 'volume',
|
||||
'create_volumes': 'volume'}
|
||||
|
||||
|
||||
@@ -75,3 +73,9 @@ class MultiScheduler(driver.Scheduler):
|
||||
def schedule(self, context, topic, method, *_args, **_kwargs):
|
||||
return self.drivers[topic].schedule(context, topic,
|
||||
method, *_args, **_kwargs)
|
||||
|
||||
def schedule_run_instance(self, *args, **kwargs):
|
||||
return self.drivers['compute'].schedule_run_instance(*args, **kwargs)
|
||||
|
||||
def schedule_prep_resize(self, *args, **kwargs):
|
||||
return self.drivers['compute'].schedule_prep_resize(*args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user