From 98f753d4c5e8bdf31716a7452f89930a51b3edf5 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Fri, 3 Aug 2012 22:50:21 -0400 Subject: Send full instance to scheduler live_migration. Remove the instance_id parameter and send a full instance dict to the live_migration method of the scheduler manager. This cuts down on some unnecessary database access in the scheduler. Part of blueprint no-db-messaging. Change-Id: Ic45105300c967c760559df2225e59e515cea8b7b --- nova/scheduler/rpcapi.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'nova/scheduler/rpcapi.py') diff --git a/nova/scheduler/rpcapi.py b/nova/scheduler/rpcapi.py index a553b202c..9965a162e 100644 --- a/nova/scheduler/rpcapi.py +++ b/nova/scheduler/rpcapi.py @@ -37,6 +37,7 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy): - remove instance_type_id, add instance_type - remove topic, it was unused 1.2 - Remove topic from run_instance, it was unused + 1.3 - Remove instance_id, add instance to live_migration ''' BASE_RPC_API_VERSION = '1.0' @@ -70,13 +71,14 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy): return self.call(ctxt, self.make_msg('show_host_resources', host=host)) def live_migration(self, ctxt, block_migration, disk_over_commit, - instance_id, dest, topic): + instance, dest, topic): # NOTE(comstud): Call vs cast so we can get exceptions back, otherwise # this call in the scheduler driver doesn't return anything. + instance_p = jsonutils.to_primitive(instance) return self.call(ctxt, self.make_msg('live_migration', block_migration=block_migration, - disk_over_commit=disk_over_commit, instance_id=instance_id, - dest=dest, topic=topic)) + disk_over_commit=disk_over_commit, instance=instance_p, + dest=dest, topic=topic), version='1.3') def update_service_capabilities(self, ctxt, service_name, host, capabilities): -- cgit