]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Only create volume with an active image
authorling-yun <zengyunling@huawei.com>
Fri, 4 Apr 2014 14:18:50 +0000 (22:18 +0800)
committerling-yun <zengyunling@huawei.com>
Tue, 27 May 2014 11:36:31 +0000 (19:36 +0800)
commit0756cf8ec3f2c73b4141b4b6dc597e82e47de669
tree30ecd63fbd94224f5d92d19d524d7835c21d4604
parented94a47807290f091c4b9fcc6a017790711beb98
Only create volume with an active image

1. Currently cinder doesn't check whether the image is active
when create volume with an image id, we can even create volume
with a deleted/saving/queued image.

2. For deleted image, it only happened when using admin credentials.

When using non-admin credentials, it returned an error that image
is not found by using 'glance image-show' on a deleted image, which
is expected. Also when creating a volume from this deleted image,
it returned  a 404 error upfront. This again is the expected result.

When using admin credentials, we can view the details of deleted image
with 'glance image-show'. If create a volume out of an image ID (which
is now deleted), the operation succeeds, but the volume is left in
'error' state.

3. This accounts for a bug(he volume shouldn't be created) and should be fixed.

Change-Id: If4f59695fbf6636778d0d352aef28d90bb45ee91
Closes-Bug: #1302621
cinder/tests/test_volume.py
cinder/volume/flows/api/create_volume.py