From 7677354e3ba0954158d33feef3667b0fe7dcc2a3 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Fri, 3 Aug 2012 18:09:07 -0400 Subject: Send full instance to run_instance. This patch updates run_instance in the compute manager to take a full instance instead of just an instance UUID. This reduces db access required by the compute nodes. The scheduler code needed some work here as well since it wasn't using the compute rpcapi for calling run_instance. Part of blueprint no-db-messaging. Change-Id: If5545748122b4ff9e2da6788cbd4b0fa26c4db99 --- nova/compute/rpcapi.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'nova/compute/rpcapi.py') diff --git a/nova/compute/rpcapi.py b/nova/compute/rpcapi.py index 517cfca4d..72babd380 100644 --- a/nova/compute/rpcapi.py +++ b/nova/compute/rpcapi.py @@ -117,6 +117,7 @@ class ComputeAPI(nova.openstack.common.rpc.proxy.RpcProxy): - remove instance_uuid, add instance - remove instance_type_id, add instance_type - remove topic, it was unused + 1.39 - Remove instance_uuid, add instance argument to run_instance() ''' BASE_RPC_API_VERSION = '1.0' @@ -422,6 +423,19 @@ class ComputeAPI(nova.openstack.common.rpc.proxy.RpcProxy): topic=_compute_topic(self.topic, ctxt, host, None), version='1.32') + def run_instance(self, ctxt, instance, host, request_spec, + filter_properties, requested_networks, + injected_files, admin_password, + is_first_time): + instance_p = jsonutils.to_primitive(instance) + self.cast(ctxt, self.make_msg('run_instance', instance=instance_p, + request_spec=request_spec, filter_properties=filter_properties, + requested_networks=requested_networks, + injected_files=injected_files, admin_password=admin_password, + is_first_time=is_first_time), + topic=_compute_topic(self.topic, ctxt, host, None), + version='1.39') + def set_admin_password(self, ctxt, instance, new_pass): instance_p = jsonutils.to_primitive(instance) return self.call(ctxt, self.make_msg('set_admin_password', -- cgit