deb-cinder/cinder
zhangsong bc31ef8623 Sheepdog:fix the bug of failed to clone image
The current sheepdog driver has two bugs when deciding whether
an image is cloneable:

1.It uses the addr in image_location url to find the image volume,
if the image volume is found, then considers the image is cloneable,
or considers it is not cloneable. Here has a problem, if cinder and
glance use different sheepdog cluster, this may lead the image is
always cloneable. In fact, it should use addr of cinder backend to
find the image volume, not the glance backend.

2.The driver uses 'dog vdi list volumename' command to find a volume,
if the command don't return an err, then considers the volume already
exists. This means that it assumes the command would return an err
code if the volume is not exists. But this is not the fact. Dog
command always returns 0 no matter the volume exists or not:
test for a existent volume:
$ dog vdi list test01 -r
= test01 0 4294967296 0 0 1469012083 40687a 3
$ echo $?
0
test for a nonexistent volume, return 0 and output nothing:
$ dog vdi list testvolume -r
$ echo $?
0

This patch fixed these two bugs.

Change-Id: I17a8a29be5c1d994ad36a70b2f76000f9566fbde
Closes-Bug: #1604740
2016-07-26 14:33:40 +08:00
..
api Improve api_version decorator to avoid noqa 2016-07-22 10:27:26 +02:00
backup Add cluster job distribution 2016-07-22 21:00:11 +02:00
brick Cleanup orphaned code from brick LVM 2015-11-26 23:40:25 -06:00
cmd Add cluster job distribution 2016-07-22 21:00:11 +02:00
common Remove translation from config options 2016-06-30 08:53:09 -05:00
compute Bump to Nova v2.1 2016-06-03 14:25:39 +08:00
config Add sample config file to cinder docs 2016-05-17 08:52:21 -05:00
consistencygroup Remove force option from create_snapshots_in_db() 2016-07-17 20:14:12 -04:00
db Add cluster table and related methods 2016-07-22 18:40:28 +02:00
hacking Revert "Add hacking check to prevent assert_called_once" 2016-05-24 12:36:22 -04:00
image Image virtual size doesn't fit to volume size 2016-07-11 12:46:09 +03:00
interface Fix chunked backup driver interface name 2016-07-15 16:53:12 +05:30
keymgr Fix doc and source documentation errors and warning 2016-04-14 12:30:08 +02:00
locale Imported Translations from Zanata 2016-07-23 06:15:00 +00:00
message Add pagination support to messages 2016-05-27 10:49:00 +00:00
objects Update Versioned Objects with Cluster object 2016-07-22 21:00:08 +02:00
replication Remove unused logging import and LOG global var 2016-05-20 17:17:38 +08:00
scheduler Auto sync manager's RPC_API_VERSION 2016-07-20 19:39:54 +02:00
tests Sheepdog:fix the bug of failed to clone image 2016-07-26 14:33:40 +08:00
transfer Handle quota exceed exception 2016-06-14 09:56:10 +08:00
volume Sheepdog:fix the bug of failed to clone image 2016-07-26 14:33:40 +08:00
wsgi Remove unused logging import and LOG global var 2016-05-20 17:17:38 +08:00
zonemanager Fix some typos 2016-07-05 15:11:39 +02:00
__init__.py Re-enabled hacking checks for H105 2016-01-05 11:22:40 +02:00
context.py Merge "Define context.roles with base class" 2016-06-17 03:34:18 +00:00
coordination.py update coordination.Lock.release's docstring 2016-06-19 01:55:35 -04:00
exception.py Add cluster table and related methods 2016-07-22 18:40:28 +02:00
flow_utils.py Refactoring of manager's create_volume flow 2015-07-24 11:19:09 +02:00
i18n.py Remove unused gettextutils from oslo-incubator 2015-10-16 15:22:49 -05:00
manager.py Add cluster job distribution 2016-07-22 21:00:11 +02:00
opts.py Add cluster job distribution 2016-07-22 21:00:11 +02:00
policy.py adds user_id to check_is_admin 2015-08-25 04:46:18 -07:00
quota_utils.py Allow admin project to operate on all quotas 2016-07-11 12:58:54 -07:00
quota.py Merge "Lazy load a project quotas's default values" 2016-05-30 11:08:22 +00:00
rpc.py Add cluster job distribution 2016-07-22 21:00:11 +02:00
service.py Add cluster job distribution 2016-07-22 21:00:11 +02:00
ssh_utils.py Fix sshpool.remove code 2016-03-01 03:20:04 +00:00
test.py Refactor sqlalchemy service methods 2016-07-22 15:46:00 +02:00
utils.py Update Versioned Objects with Cluster object 2016-07-22 21:00:08 +02:00
version.py