Stop using scheduler RPC API magic

If a scheduler RPC message isn't handled directly by a SchedulerManager
method, the __getattr__() fallback passes the message to a driver
method in the form of schedule_${method}() and, if that doesn't exist,
instead calls the schedule() method supplying the topic and method
args.

This is pretty bizarre stuff and we appear to only use it in two cases:

  1) live_migration - this is how the schedule_live_migration()
     method in the driver gets called, but the side-effect is that
     we require the client to pass a topic argument which is never
     used. This would be much more sanely handled with an explicit
     SchedulerManager.live_migration() method.

  2) create_volume - the volume API asks the scheduler to pick a
     target host for create_volume() using this method. This would
     be easily handled with an SchedulerManager.create_volume()
     method.

Change-Id: I1047489d85ac51d8d36fea1c4eb858df638ce349
This commit is contained in:
Mark McLoughlin
2012-08-29 09:21:03 +01:00
parent c91d2d74f0
commit ee344a3b8c
5 changed files with 28 additions and 11 deletions

View File

@@ -89,6 +89,9 @@ class MultiScheduler(driver.Scheduler):
def schedule_prep_resize(self, *args, **kwargs):
return self.drivers['compute'].schedule_prep_resize(*args, **kwargs)
def schedule_create_volume(self, *args, **kwargs):
return self.drivers['volume'].schedule_create_volume(*args, **kwargs)
def update_service_capabilities(self, service_name, host, capabilities):
# Multi scheduler is only a holder of sub-schedulers, so
# pass the capabilities to the schedulers that matter