summaryrefslogtreecommitdiffstats
path: root/nova/compute/rpcapi.py
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2012-08-03 18:09:07 -0400
committerRussell Bryant <rbryant@redhat.com>2012-08-06 15:09:33 -0400
commit7677354e3ba0954158d33feef3667b0fe7dcc2a3 (patch)
tree25f152af92fbdcbba280c7a103de4e70b5a0354e /nova/compute/rpcapi.py
parent7c4ab6820d42768ac5055ca3c8e0b272358bd43d (diff)
downloadnova-7677354e3ba0954158d33feef3667b0fe7dcc2a3.tar.gz
nova-7677354e3ba0954158d33feef3667b0fe7dcc2a3.tar.xz
nova-7677354e3ba0954158d33feef3667b0fe7dcc2a3.zip
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
Diffstat (limited to 'nova/compute/rpcapi.py')
-rw-r--r--nova/compute/rpcapi.py14
1 files changed, 14 insertions, 0 deletions
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',