From 8718f8e47d7d0504724495538eb320be3e209180 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Tue, 14 Aug 2012 17:59:06 -0700 Subject: Always create the run_instance records locally Currently a request for multiple instances issent to the scheduler, where it is written to the database. It appears that this was done so that more advanced schedulers could handle the request as one batch, but the result is the scheduler is sometimes slow enough that the call will timeout. Instead this converts to always creating the instance records locally and making run_instance into a casting instead of a call. This made a small change to the rpc api for run instance, so the version was bumped. Legacy messages are still handled properly. Fixes bug 1036911 Co-authored-by: Chris Behrens Change-Id: I63bbc98c285faebec53f8e62857c01548807db68 --- nova/scheduler/rpcapi.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'nova/scheduler/rpcapi.py') diff --git a/nova/scheduler/rpcapi.py b/nova/scheduler/rpcapi.py index 6f9d00ad2..84d0286a2 100644 --- a/nova/scheduler/rpcapi.py +++ b/nova/scheduler/rpcapi.py @@ -40,6 +40,7 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy): 1.3 - Remove instance_id, add instance to live_migration 1.4 - Remove update_db from prep_resize 1.5 - Add reservations argument to prep_resize() + 1.6 - Remove reservations argument to run_instance() ''' BASE_RPC_API_VERSION = '1.0' @@ -50,15 +51,13 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy): def run_instance(self, ctxt, request_spec, admin_password, injected_files, requested_networks, is_first_time, - filter_properties, reservations, call=True): - rpc_method = self.call if call else self.cast - return rpc_method(ctxt, self.make_msg('run_instance', + filter_properties): + return self.cast(ctxt, self.make_msg('run_instance', request_spec=request_spec, admin_password=admin_password, injected_files=injected_files, requested_networks=requested_networks, is_first_time=is_first_time, - filter_properties=filter_properties, - reservations=reservations), version='1.2') + filter_properties=filter_properties), version='1.6') def prep_resize(self, ctxt, instance, instance_type, image, request_spec, filter_properties, reservations): -- cgit