Skip to content

Commit

Permalink
Fix volume_rpcapi calls for chance/simple scheds
Browse files Browse the repository at this point in the history
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
  • Loading branch information
avishay-traeger committed Sep 24, 2013
1 parent 8cd2462 commit d5cd652
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion cinder/scheduler/chance.py
Expand Up @@ -76,7 +76,9 @@ def schedule_create_volume(self, context, request_spec, filter_properties):

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):
Expand Down
14 changes: 7 additions & 7 deletions cinder/scheduler/simple.py
Expand Up @@ -62,11 +62,10 @@ def schedule_create_volume(self, context, request_spec, filter_properties):
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)
Expand All @@ -84,8 +83,9 @@ def schedule_create_volume(self, context, request_spec, filter_properties):
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)

0 comments on commit d5cd652

Please sign in to comment.