From: Avishay Traeger Date: Mon, 23 Sep 2013 18:18:56 +0000 (+0300) Subject: Fix volume_rpcapi calls for chance/simple scheds X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=d5cd6528f361979b073aabd036be0d28dc1c4b95;p=openstack-build%2Fcinder-build.git Fix volume_rpcapi calls for chance/simple scheds Change the chance and simple schedulers to pass the snapshot_id and image_id parameters correctly volume_rpcapi, so that their values reach cinder-volume. Change-Id: I0abbca1fa0445c5233387a0f17363fc092d39b88 Closes-Bug: #1212710 --- diff --git a/cinder/scheduler/chance.py b/cinder/scheduler/chance.py index 0b9a4dac6..d2c563e56 100644 --- a/cinder/scheduler/chance.py +++ b/cinder/scheduler/chance.py @@ -76,7 +76,9 @@ class ChanceScheduler(driver.Scheduler): updated_volume = driver.volume_update_db(context, volume_id, host) self.volume_rpcapi.create_volume(context, updated_volume, host, - snapshot_id, image_id) + allow_reschedule=False, + snapshot_id=snapshot_id, + image_id=image_id) def host_passes_filters(self, context, host, request_spec, filter_properties): diff --git a/cinder/scheduler/simple.py b/cinder/scheduler/simple.py index 5329d6fd7..d131e63fe 100644 --- a/cinder/scheduler/simple.py +++ b/cinder/scheduler/simple.py @@ -62,11 +62,10 @@ class SimpleScheduler(chance.ChanceScheduler): if not utils.service_is_up(service): raise exception.WillNotSchedule(host=host) updated_volume = driver.volume_update_db(context, volume_id, host) - self.volume_rpcapi.create_volume(context, - updated_volume, - host, - snapshot_id, - image_id) + self.volume_rpcapi.create_volume(context, updated_volume, host, + allow_reschedule=False, + snapshot_id=snapshot_id, + image_id=image_id) return None results = db.service_get_all_volume_sorted(elevated) @@ -84,8 +83,9 @@ class SimpleScheduler(chance.ChanceScheduler): self.volume_rpcapi.create_volume(context, updated_volume, service['host'], - snapshot_id, - image_id) + allow_reschedule=False, + snapshot_id=snapshot_id, + image_id=image_id) return None msg = _("Is the appropriate service running?") raise exception.NoValidHost(reason=msg)