Bug 1049380

Summary: openstack-cinder: cinder fails to copy an image a volume with GlusterFS backend
Product: [Community] RDO Reporter: Yogev Rabl <yrabl>
Component: openstack-cinderAssignee: Jon Bernard <jobernar>
Status: CLOSED WONTFIX QA Contact: Dafna Ron <dron>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: andelhie, bloch, eharney, hateya, jobernar, lars, sgotliv, tshefi, yeylon, yrabl
Target Milestone: ---Keywords: Reopened, Triaged
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard: storage
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-06 22:46:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
api.log
none
Cinder volume.log none

Description Yogev Rabl 2014-01-07 13:51:48 UTC
Created attachment 846675 [details]
api.log

Description of problem:
The volume creation fails when trying to create a volume from an image: 
# cinder create --image-id <id> <size>

the Glance and the cinder logs show: 

volume.log:
2014-01-07 15:27:09.260 7705 ERROR cinder.volume.flows.create_volume [req-0660c6c2-0b94-4551-a3ad-dd6b72710894 c2b12ec6592a4259b2e2b45b7f278150 2c398f94ad5e410bb0d8be60ddf60d84] Volume 6e17ee48-cc2d-483e-8c06-c5f8ad2ecbfb: create failed
2014-01-07 15:27:09.261 7705 ERROR cinder.volume.flows.create_volume [req-0660c6c2-0b94-4551-a3ad-dd6b72710894 c2b12ec6592a4259b2e2b45b7f278150 2c398f94ad5e410bb0d8be60ddf60d84] Unexpected build error:
2014-01-07 15:27:09.261 7705 TRACE cinder.volume.flows.create_volume Traceback (most recent call last):
2014-01-07 15:27:09.261 7705 TRACE cinder.volume.flows.create_volume   File "/usr/lib/python2.6/site-packages/cinder/taskflow/patterns/linear_flow.py", line 172, in run_it
2014-01-07 15:27:09.261 7705 TRACE cinder.volume.flows.create_volume     result = runner(context, *args, **kwargs)
2014-01-07 15:27:09.261 7705 TRACE cinder.volume.flows.create_volume   File "/usr/lib/python2.6/site-packages/cinder/taskflow/utils.py", line 260, in __call__
2014-01-07 15:27:09.261 7705 TRACE cinder.volume.flows.create_volume     self.result = self.task(*args, **kwargs)
2014-01-07 15:27:09.261 7705 TRACE cinder.volume.flows.create_volume   File "/usr/lib/python2.6/site-packages/cinder/volume/flows/create_volume/__init__.py", line 1502, in __call__
2014-01-07 15:27:09.261 7705 TRACE cinder.volume.flows.create_volume     **volume_spec)
2014-01-07 15:27:09.261 7705 TRACE cinder.volume.flows.create_volume   File "/usr/lib/python2.6/site-packages/cinder/volume/flows/create_volume/__init__.py", line 1465, in _create_from_image
2014-01-07 15:27:09.261 7705 TRACE cinder.volume.flows.create_volume     image_id, image_location, image_service)
2014-01-07 15:27:09.261 7705 TRACE cinder.volume.flows.create_volume   File "/usr/lib/python2.6/site-packages/cinder/volume/flows/create_volume/__init__.py", line 1372, in _copy_image_to_volume
2014-01-07 15:27:09.261 7705 TRACE cinder.volume.flows.create_volume     raise exception.ImageUnacceptable(ex)
2014-01-07 15:27:09.261 7705 TRACE cinder.volume.flows.create_volume ImageUnacceptable: Image cf459b65-a3e8-4b2d-a4cd-344bd2aa793a is unacceptable: Size is 20GB and doesn't fit in a volume of size 4GB.
2014-01-07 15:27:09.261 7705 TRACE cinder.volume.flows.create_volume


Version-Release number of selected component (if applicable):
openstack-cinder-2014.1-0.2.b1.el6.noarch
python-cinderclient-1.0.7-1.el6.noarch
python-cinder-2014.1-0.2.b1.el6.noarch

openstack-glance-2014.1-0.1.b1.el6.noarch
python-glanceclient-0.12.0-1.el6.noarch
python-glance-2014.1-0.1.b1.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. create an image
2. create a volume from that image.


Actual results:
an error - the volume creation failed.

Expected results:
a new volume is available.

Additional info:

the glance's api.log is attach

Comment 1 Dafna Ron 2014-01-07 14:33:19 UTC
 Image cf459b65-a3e8-4b2d-a4cd-344bd2aa793a is unacceptable: Size is 20GB and doesn't fit in a volume of size 4GB.

Please try to create a larger size volume and see if you get an error.

Comment 2 Tzach Shefi 2014-03-26 15:06:52 UTC
Created attachment 879033 [details]
Cinder volume.log

Comment 3 Tzach Shefi 2014-03-26 15:10:20 UTC
Description of problem:

Create volume from an image (iso or qcow2) status -> error, both Glance and Cinder use Gluster. Empty volume is created with status available, tested from Horizon and CLI.

# cinder --debug create 2 --image-id 8fcae10f-9cb8-4609-b835-a82d87bbd60a --display-name volZevel 

[root@orange-vdse glance(keystone_admin)]# cinder list
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
|                  ID                  |   Status  | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| 2ae7afdf-520d-4b03-ac6c-3337295b4233 |   error   |   volZevel   |  2   |     None    |  false   |             |
| 7fff0bb0-5177-44fb-be26-7e5cd655e82b |   error   |  volfromUI   |  1   |     None    |  false   |             |
| d0df18b9-985b-455c-b513-eca12a19db8c | available |     None     |  2   |     None    |  false   |             |
| fe1efdc8-5277-40a8-beeb-57af1f3a41ed | available |   volEmpty   |  2   |     None    |  false   |             |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+

Source images are tiny, both should fit in 1Giga volumes. 
[root@orange-vdse cinder(keystone_admin)]# glance image-list
+--------------------------------------+------------+-------------+------------------+----------+--------+
| ID                                   | Name       | Disk Format | Container Format | Size     | Status |
+--------------------------------------+------------+-------------+------------------+----------+--------+
| 8fcae10f-9cb8-4609-b835-a82d87bbd60a | cirrosclie | qcow2       | bare             | 9761280  | active |
| 5c429d2a-c9a7-4bb7-b55f-924ceeb16778 | iso        | iso         | bare             | 52328448 | active |
+--------------------------------------+------------+-------------+------------------+----------+--------+



Versions:
 RHEL 7 
 openstack-cinder-2014.1-0.6.b3.el7.noarch
 openstack-glance-2014.1-0.4.b3.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1. create an image
2. create an empty volume, works ok status available
3. Create volume from uploaded image, status error.

Actual results:
Volume created from image status=error

Expected results:
Volume status should be available.

Attached cinder's volume.log

Comment 4 Andy del Hierro 2014-03-27 18:00:41 UTC
I am seeing this same problem but with Ceph backend.  

I have crated volume size of 40gb but the logs report it 1gb.

the work around for me is to great a volume in the UI that has the image already copied then create a instance and then have to attach to the volume to boot.

There something odd with something passing a static 1gb size for volume on copy.

Comment 5 Andy del Hierro 2014-03-27 18:03:45 UTC
I just saw a not the on copy to volume the qcow2 image may be converted from qcow2 over to raw making the image way to big.

Comment 6 Jon Bernard 2014-05-22 20:23:42 UTC
In order to create and export a block device from an image, the image must be converted to RAW.  So this seems like what you would expect, and I don't feel it's a bug.  But perhaps I'm misunderstanding, what is the behaviour you expect?

Comment 7 Eric Harney 2014-05-22 20:35:27 UTC
This isn't a bug.  This is the same issue as described in bug 1096144.

The problem is that Glance's image-list is showing the size of the image "file" rather than the virtual image size.  What matters for conversion into a volume is the virtual image size, which is unfortunately not known until conversion time.

Comment 8 Jon Bernard 2014-05-22 21:09:35 UTC
I'll add that upstream glance is working on adding support for this in the Juno cycle, so this could be revisited (on the cinder side) once that occurs.  At the moment, however, this is expected behaviour.

Comment 9 Lars Kellogg-Stedman 2015-03-20 15:46:35 UTC
This is unresolved in Juno (glance still reports the underlying file size rather than the image virtual size), but https://github.com/openstack/glance/commit/5dd82abb74628a46ee6cd8ad619d1b8dda2a3a81 looks like a first step to solving this problem.