From 12c11e0a37a8e59adfa0a73bc4f8f95a397b7bbf Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Wed, 23 Jan 2013 12:23:06 -0800 Subject: [PATCH] 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 --- nova/scheduler/filter_scheduler.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nova/scheduler/filter_scheduler.py b/nova/scheduler/filter_scheduler.py index 07a3f578af8b..9384e1495d95 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)