From f241c492959d4430dfd27e698bd0c79e322ff78b Mon Sep 17 00:00:00 2001 From: zhangsong Date: Sun, 25 Oct 2015 00:47:47 +0800 Subject: [PATCH] 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 --- cinder/volume/drivers/sheepdog.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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): -- 2.45.2