From: zhangsong Date: Sat, 24 Oct 2015 16:47:47 +0000 (+0800) Subject: optimize the copy_image_to_volume method of sheepdogdriver X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=f241c492959d4430dfd27e698bd0c79e322ff78b;p=openstack-build%2Fcinder-build.git optimize the copy_image_to_volume method of sheepdogdriver the current copy_image_to_volume method of sheepdogdriver can only write the image file to local sheepdog, with this patch, it supports write image file to remote sheepdog node. Closes-Bug: #1509910 Change-Id: I5084ef2c048439ad8b9d6ae56ce8cccaadc26262 --- diff --git a/cinder/volume/drivers/sheepdog.py b/cinder/volume/drivers/sheepdog.py index 217890664..21956cdd5 100644 --- a/cinder/volume/drivers/sheepdog.py +++ b/cinder/volume/drivers/sheepdog.py @@ -529,8 +529,13 @@ class SheepdogDriver(driver.VolumeDriver): # see volume/drivers/manager.py:_create_volume self.client.delete(volume.name) # convert and store into sheepdog - image_utils.convert_image(tmp, 'sheepdog:%s' % volume['name'], - 'raw') + image_utils.convert_image( + tmp, + 'sheepdog:%(addr)s:%(port)d:%(name)s' % { + 'addr': CONF.sheepdog_store_address, + 'port': CONF.sheepdog_store_port, + 'name': volume['name']}, + 'raw') self.client.resize(volume.name, volume.size) def copy_volume_to_image(self, context, volume, image_service, image_meta):