summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2013-01-23 12:23:06 -0800
committerVishvananda Ishaya <vishvananda@gmail.com>2013-01-23 12:32:41 -0800
commit12c11e0a37a8e59adfa0a73bc4f8f95a397b7bbf (patch)
tree57fc410ee987d577f8f94b42e7fe802f8cd17216
parent34ffd41831ee6b6e629a5f5c2e52c2729f00029d (diff)
downloadnova-12c11e0a37a8e59adfa0a73bc4f8f95a397b7bbf.tar.gz
nova-12c11e0a37a8e59adfa0a73bc4f8f95a397b7bbf.tar.xz
nova-12c11e0a37a8e59adfa0a73bc4f8f95a397b7bbf.zip
Don't pass the entire list of instances to compute
We don't need to pass the entire (potentially large) list of instances down to the compute node. This will save potentially thousands of bytes in the message. Fixes bug 1103669 Change-Id: Ia90a19dffa90575a0f02191603ae9e96ca9258df
-rw-r--r--nova/scheduler/filter_scheduler.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/nova/scheduler/filter_scheduler.py b/nova/scheduler/filter_scheduler.py
index 07a3f578a..9384e1495 100644
--- a/nova/scheduler/filter_scheduler.py
+++ b/nova/scheduler/filter_scheduler.py
@@ -47,15 +47,15 @@ class FilterScheduler(driver.Scheduler):
Returns a list of the instances created.
"""
- instance_uuids = request_spec.get('instance_uuids')
- num_instances = len(instance_uuids)
- LOG.debug(_("Attempting to build %(num_instances)d instance(s)") %
- locals())
-
payload = dict(request_spec=request_spec)
notifier.notify(context, notifier.publisher_id("scheduler"),
'scheduler.run_instance.start', notifier.INFO, payload)
+ instance_uuids = request_spec.pop('instance_uuids')
+ num_instances = len(instance_uuids)
+ LOG.debug(_("Attempting to build %(num_instances)d instance(s)") %
+ locals())
+
weighed_hosts = self._schedule(context, request_spec,
filter_properties, instance_uuids)
@@ -124,6 +124,8 @@ class FilterScheduler(driver.Scheduler):
filter_properties, requested_networks, injected_files,
admin_password, is_first_time, instance_uuid=None):
"""Create the requested resource in this Zone."""
+ # NOTE(vish): add our current instance back into the request spec
+ request_spec['instance_uuids'] = [instance_uuid]
payload = dict(request_spec=request_spec,
weighted_host=weighed_host.to_dict(),
instance_id=instance_uuid)