summaryrefslogtreecommitdiffstats
path: root/nova/scheduler/rpcapi.py
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2012-08-01 16:48:03 -0400
committerRussell Bryant <rbryant@redhat.com>2012-08-03 22:13:28 -0400
commit6e134c9df2ec05ebce9f62c6d85988ece18620ad (patch)
tree4aa467c5fe04990c3c51d7cfa5efd26b6f862117 /nova/scheduler/rpcapi.py
parent5fb51ea04b2ccff55f45af9e99cecd5d22f27a42 (diff)
downloadnova-6e134c9df2ec05ebce9f62c6d85988ece18620ad.tar.gz
nova-6e134c9df2ec05ebce9f62c6d85988ece18620ad.tar.xz
nova-6e134c9df2ec05ebce9f62c6d85988ece18620ad.zip
Updates to the prep_resize scheduler rpc call.
I started looking at this because of the prep_resize rpc call in the compute manager. An API server calls prep_resize on the scheduler which then calls it on a compute node. I will need to make the same changes on the compute side, but this is the first step. The prep_resize call was taking two object IDs, an instance UUID and an instance_type ID. Both of these have been converted. It now takes an instance dict and an instance_type dict, instead. It can also handle receiving the old IDs for backwards compatibility. prep_resize also took a topic argument that was unused, so it has just been removed. There are a number of changes in the scheduler code tied up in this to make it more explicit about exactly what arguments are expected instead of just using *args, **kwargs. Part of blueprint no-db-messaging. Change-Id: I4af18e5575e2bb60a410fc8edabf3d607c72aabc
Diffstat (limited to 'nova/scheduler/rpcapi.py')
-rw-r--r--nova/scheduler/rpcapi.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/nova/scheduler/rpcapi.py b/nova/scheduler/rpcapi.py
index b2522ab53..60de98c91 100644
--- a/nova/scheduler/rpcapi.py
+++ b/nova/scheduler/rpcapi.py
@@ -19,6 +19,7 @@ Client side of the scheduler manager RPC API.
"""
from nova import flags
+from nova.openstack.common import jsonutils
import nova.openstack.common.rpc.proxy
@@ -31,6 +32,10 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy):
API version history:
1.0 - Initial version.
+ 1.1 - Changes to prep_resize():
+ - remove instance_uuid, add instance
+ - remove instance_type_id, add instance_type
+ - remove topic, it was unused
'''
BASE_RPC_API_VERSION = '1.0'
@@ -51,12 +56,14 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy):
filter_properties=filter_properties,
reservations=reservations))
- def prep_resize(self, ctxt, topic, instance_uuid, instance_type_id, image,
+ def prep_resize(self, ctxt, instance, instance_type, image,
update_db, request_spec, filter_properties):
- self.cast(ctxt, self.make_msg('prep_resize', topic=topic,
- instance_uuid=instance_uuid, instance_type_id=instance_type_id,
+ instance_p = jsonutils.to_primitive(instance)
+ instance_type_p = jsonutils.to_primitive(instance_type)
+ self.cast(ctxt, self.make_msg('prep_resize',
+ instance=instance_p, instance_type=instance_type_p,
image=image, update_db=update_db, request_spec=request_spec,
- filter_properties=filter_properties))
+ filter_properties=filter_properties), version='1.1')
def show_host_resources(self, ctxt, host):
return self.call(ctxt, self.make_msg('show_host_resources', host=host))