diff options
| author | Sandy Walsh <sandy.walsh@rackspace.com> | 2011-05-11 12:45:22 -0700 |
|---|---|---|
| committer | Sandy Walsh <sandy.walsh@rackspace.com> | 2011-05-11 12:45:22 -0700 |
| commit | facb7a77685164574eecb7faac966c9bc1b4dec9 (patch) | |
| tree | 9f0c245759842ea865a2448a8d35f7000c87fa5f | |
| parent | ec91629806e4711df92686c64dd341480e237f97 (diff) | |
| download | nova-facb7a77685164574eecb7faac966c9bc1b4dec9.tar.gz nova-facb7a77685164574eecb7faac966c9bc1b4dec9.tar.xz nova-facb7a77685164574eecb7faac966c9bc1b4dec9.zip | |
messing around with the flow of create() and specs
| -rw-r--r-- | nova/scheduler/zone_aware_scheduler.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/nova/scheduler/zone_aware_scheduler.py b/nova/scheduler/zone_aware_scheduler.py index 8285ec576..07f86450b 100644 --- a/nova/scheduler/zone_aware_scheduler.py +++ b/nova/scheduler/zone_aware_scheduler.py @@ -36,6 +36,24 @@ class ZoneAwareScheduler(driver.Scheduler): """Call novaclient zone method. Broken out for testing.""" return api.call_zone_method(context, method, specs=specs) + def schedule_run_instance(self, context, topic='compute', specs=None, + *args, **kwargs): + """This method is called from nova.compute.api to provision + an instance. However we need to look at the parameters being + passed in to see if this is a request to: + 1. Create a Build Plan and then provision, or + 2. Use the Build Plan information in the request parameters + to simply create the instance (either in this zone or + a child zone).""" + + if 'blob' in specs: + return self.provision_instance(context, topic, specs) + + # Create build plan and provision ... + build_plan = self.select(context, specs) + for item in build_plan: + self.provision_instance(context, topic, item) + def select(self, context, *args, **kwargs): """Select returns a list of weights and zone/host information corresponding to the best hosts to service the request. Any |
