summaryrefslogtreecommitdiffstats
path: root/nova/scheduler/filter_scheduler.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-07-01 17:30:40 +0000
committerGerrit Code Review <review@openstack.org>2013-07-01 17:30:40 +0000
commitdcece3c8e41f757a33251c5969f47fa36455c57e (patch)
tree02f08397c3235e931a1d7b11840361b4c0f1a289 /nova/scheduler/filter_scheduler.py
parent3e232c84991edf15b2bcdb42885dcaff27b72206 (diff)
parent4f3c5411d92d488b78f06212912fc7ae6d225b79 (diff)
downloadnova-dcece3c8e41f757a33251c5969f47fa36455c57e.tar.gz
nova-dcece3c8e41f757a33251c5969f47fa36455c57e.tar.xz
nova-dcece3c8e41f757a33251c5969f47fa36455c57e.zip
Merge "New select_destinations scheduler call"
Diffstat (limited to 'nova/scheduler/filter_scheduler.py')
-rw-r--r--nova/scheduler/filter_scheduler.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/nova/scheduler/filter_scheduler.py b/nova/scheduler/filter_scheduler.py
index 4e5662e65..103aec940 100644
--- a/nova/scheduler/filter_scheduler.py
+++ b/nova/scheduler/filter_scheduler.py
@@ -161,6 +161,22 @@ class FilterScheduler(driver.Scheduler):
raise exception.NoValidHost(reason="")
return hosts
+ def select_destinations(self, context, request_spec, filter_properties):
+ """Selects a filtered set of hosts and nodes."""
+ num_instances = request_spec['num_instances']
+ instance_uuids = request_spec.get('instance_uuids')
+ selected_hosts = self._schedule(context, request_spec,
+ filter_properties, instance_uuids)
+
+ # Couldn't fulfill the request_spec
+ if len(selected_hosts) < num_instances:
+ raise exception.NoValidHost(reason='')
+
+ dests = []
+ for host in selected_hosts:
+ dests.append((host.obj.host, host.obj.nodename))
+ return dests
+
def _provision_resource(self, context, weighed_host, request_spec,
filter_properties, requested_networks, injected_files,
admin_password, is_first_time, instance_uuid=None):