diff --git a/nova/scheduler/manager.py b/nova/scheduler/manager.py index 647c2c780c82..377cdaaa2a08 100644 --- a/nova/scheduler/manager.py +++ b/nova/scheduler/manager.py @@ -53,7 +53,7 @@ QUOTAS = quota.QUOTAS class SchedulerManager(manager.Manager): """Chooses a host to run instances on.""" - RPC_API_VERSION = '2.0' + RPC_API_VERSION = '2.1' def __init__(self, scheduler_driver=None, *args, **kwargs): if not scheduler_driver: @@ -69,8 +69,8 @@ class SchedulerManager(manager.Manager): self.driver.update_service_capabilities(service_name, host, capabilities) - def create_volume(self, context, volume_id, snapshot_id, image_id, - reservations): + def create_volume(self, context, volume_id, snapshot_id, + reservations, image_id=None): try: self.driver.schedule_create_volume( context, volume_id, snapshot_id, image_id, reservations) diff --git a/nova/scheduler/rpcapi.py b/nova/scheduler/rpcapi.py index 8941311790f7..f36578dab9de 100644 --- a/nova/scheduler/rpcapi.py +++ b/nova/scheduler/rpcapi.py @@ -44,6 +44,7 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy): 1.7 - Add create_volume() method, remove topic from live_migration() 2.0 - Remove 1.x backwards compat + 2.1 - Add image_id to create_volume() ''' # @@ -98,7 +99,8 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy): self.cast(ctxt, self.make_msg('create_volume', volume_id=volume_id, snapshot_id=snapshot_id, - image_id=image_id, reservations=reservations)) + image_id=image_id, reservations=reservations), + version='2.1') def update_service_capabilities(self, ctxt, service_name, host, capabilities): diff --git a/nova/tests/scheduler/test_rpcapi.py b/nova/tests/scheduler/test_rpcapi.py index 62147ce2543a..89e6ccedf883 100644 --- a/nova/tests/scheduler/test_rpcapi.py +++ b/nova/tests/scheduler/test_rpcapi.py @@ -95,4 +95,4 @@ class SchedulerRpcAPITestCase(test.TestCase): self._test_scheduler_api('create_volume', rpc_method='cast', volume_id="fake_volume", snapshot_id="fake_snapshots", image_id="fake_image", - reservations=list('fake_res')) + reservations=list('fake_res'), version='2.1')