diff options
| author | Sandy Walsh <sandy.walsh@rackspace.com> | 2011-06-15 10:21:41 -0700 |
|---|---|---|
| committer | Sandy Walsh <sandy.walsh@rackspace.com> | 2011-06-15 10:21:41 -0700 |
| commit | 4b56c18bb4436c6ea76f44d2b266973f5d42817f (patch) | |
| tree | 29c442ebe3f17badb72e68f5b835db1f820dc510 | |
| parent | 79ff4ca91c9b47d1324af3a453406de44c5ce62b (diff) | |
| download | nova-4b56c18bb4436c6ea76f44d2b266973f5d42817f.tar.gz nova-4b56c18bb4436c6ea76f44d2b266973f5d42817f.tar.xz nova-4b56c18bb4436c6ea76f44d2b266973f5d42817f.zip | |
don't provision to all child zones
| -rw-r--r-- | nova/scheduler/zone_aware_scheduler.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nova/scheduler/zone_aware_scheduler.py b/nova/scheduler/zone_aware_scheduler.py index 0ec83ec2e..e7bff2faa 100644 --- a/nova/scheduler/zone_aware_scheduler.py +++ b/nova/scheduler/zone_aware_scheduler.py @@ -185,7 +185,11 @@ class ZoneAwareScheduler(driver.Scheduler): if not build_plan: raise driver.NoValidHost(_('No hosts were available')) - for item in build_plan: + for num in xrange(request_spec['num_instances']): + if not build_plan: + break + + item = build_plan.pop(0) self._provision_resource(context, item, instance_id, request_spec, kwargs) |
