Merge "Make start_instance cast directly to compute host"

This commit is contained in:
Jenkins
2012-01-22 15:29:13 +00:00
committed by Gerrit Code Review
3 changed files with 5 additions and 10 deletions

View File

@@ -36,7 +36,6 @@ flags.DEFINE_string('volume_scheduler_driver',
# A mapping of methods to topics so we can figure out which driver to use.
_METHOD_MAP = {'run_instance': 'compute',
'start_instance': 'compute',
'prep_resize': 'compute',
'live_migration': 'compute',
'create_volume': 'volume',

View File

@@ -100,13 +100,6 @@ class SimpleScheduler(chance.ChanceScheduler):
del request_spec['instance_properties']['uuid']
return instances
def schedule_start_instance(self, context, instance_id, *_args, **_kwargs):
instance_ref = db.instance_get(context, instance_id)
host = self._schedule_instance(context, instance_ref,
*_args, **_kwargs)
driver.cast_to_compute_host(context, host, 'start_instance',
instance_id=instance_id, **_kwargs)
def schedule_create_volume(self, context, volume_id, *_args, **_kwargs):
"""Picks a host that is up and has the fewest volumes."""
elevated = context.elevated()

View File

@@ -31,7 +31,10 @@ class FakeComputeScheduler(driver.Scheduler):
def schedule_run_instance(self, *args, **kwargs):
pass
def schedule_start_instance(self, *args, **kwargs):
def schedule_live_migration(self, *args, **kwargs):
pass
def schedule_prep_resize(self, *args, **kwargs):
pass
def schedule(self, *args, **kwargs):
@@ -76,7 +79,7 @@ class MultiDriverTestCase(test_scheduler.SchedulerTestCase):
compute_driver = mgr.drivers['compute']
volume_driver = mgr.drivers['volume']
test_methods = {compute_driver: ['run_instance', 'start_instance'],
test_methods = {compute_driver: ['run_instance', 'prep_resize'],
volume_driver: ['create_volume', 'create_volumes']}
for driver, methods in test_methods.iteritems():