diff options
author | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-08-14 17:59:06 -0700 |
---|---|---|
committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-08-16 10:14:22 -0700 |
commit | 8718f8e47d7d0504724495538eb320be3e209180 (patch) | |
tree | 81ca98280b46fd12779e4142aca2f71af8354715 /nova/scheduler/rpcapi.py | |
parent | 574a78f066da5032c53069bc7a8be8fe14ea9d04 (diff) | |
download | nova-8718f8e47d7d0504724495538eb320be3e209180.tar.gz nova-8718f8e47d7d0504724495538eb320be3e209180.tar.xz nova-8718f8e47d7d0504724495538eb320be3e209180.zip |
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 <cbehrens@codestud.com>
Change-Id: I63bbc98c285faebec53f8e62857c01548807db68
Diffstat (limited to 'nova/scheduler/rpcapi.py')
-rw-r--r-- | nova/scheduler/rpcapi.py | 9 |
1 files changed, 4 insertions, 5 deletions
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): |