Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1353937

Summary: while creating volume from image, cinder do not fetch/consider "virtual-size" of image
Product: Red Hat OpenStack Reporter: Pratik Pravin Bandarkar <pbandark>
Component: openstack-cinderAssignee: Eric Harney <eharney>
Status: CLOSED WONTFIX QA Contact: Avi Avraham <aavraham>
Severity: high Docs Contact:
Priority: low    
Version: 7.0 (Kilo)CC: acanan, egafford, eharney, gkadam, pdeore, pgrist, scohen, srevivo, tshefi
Target Milestone: ---Keywords: Triaged, Unconfirmed, ZStream
Target Release: 8.0 (Liberty)Flags: tshefi: automate_bug-
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1365268 (view as bug list) Environment:
Last Closed: 2018-08-23 19:06:41 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:
Bug Depends On:    
Bug Blocks: 1365268    

Description Pratik Pravin Bandarkar 2016-07-08 13:04:54 UTC
Description of problem:
 During the vm creation from the image and create volume, cinder do not fetch "virtual-size" of the image.

Version-Release number of selected component (if applicable):
RHOS7

How reproducible:
100%

Steps to Reproduce:
1. 
# qemu-img info cirros 
image: cirros
file format: qcow2
virtual size: 3.0G (3262351872 bytes) <============
disk size: 13M
cluster_size: 65536
Format specific information:
    compat: 0.10
    refcount bits: 16


upload the image to glance. 
[root@rhos7 ~(keystone_admin)]# glance image-create --disk-format qcow2 --container-format bare --file cirros  --name cirros

2. Try to create new volume from image. It will fail.
3. Try to create new instance.(boot from image - create new volume). The operation will fail.

<snip>
2016-07-08 01:53:21.827 13415 INFO cinder.image.image_utils [req-7ff2f1df-6c9c-4caa-8c48-4f22c50a6fef c42615c5052841468c716c935b43d9f7 910e8c8b7875437ab4f091ea2290e563 - - -] Image download 12.00 MB at 12.00 MB/
s
2016-07-08 01:53:21.946 13415 ERROR cinder.volume.flows.manager.create_volume [req-7ff2f1df-6c9c-4caa-8c48-4f22c50a6fef c42615c5052841468c716c935b43d9f7 910e8c8b7875437ab4f091ea2290e563 - - -] Failed to copy ima
ge to volume: 410567c3-e78a-42fe-8b4b-573e0523f934
2016-07-08 01:53:21.946 13415 TRACE cinder.volume.flows.manager.create_volume Traceback (most recent call last):
2016-07-08 01:53:21.946 13415 TRACE cinder.volume.flows.manager.create_volume   File "/usr/lib/python2.7/site-packages/cinder/volume/flows/manager/create_volume.py", line 501, in _copy_image_to_volume
2016-07-08 01:53:21.946 13415 TRACE cinder.volume.flows.manager.create_volume     copy_image_to_volume(context, volume_ref, image_service, image_id)
2016-07-08 01:53:21.946 13415 TRACE cinder.volume.flows.manager.create_volume   File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 105, in wrapper
2016-07-08 01:53:21.946 13415 TRACE cinder.volume.flows.manager.create_volume     return f(*args, **kwargs)
2016-07-08 01:53:21.946 13415 TRACE cinder.volume.flows.manager.create_volume   File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/lvm.py", line 381, in copy_image_to_volume
2016-07-08 01:53:21.946 13415 TRACE cinder.volume.flows.manager.create_volume     size=volume['size'])
2016-07-08 01:53:21.946 13415 TRACE cinder.volume.flows.manager.create_volume   File "/usr/lib/python2.7/site-packages/cinder/image/image_utils.py", line 226, in fetch_to_raw
2016-07-08 01:53:21.946 13415 TRACE cinder.volume.flows.manager.create_volume     run_as_root=run_as_root)
2016-07-08 01:53:21.946 13415 TRACE cinder.volume.flows.manager.create_volume   File "/usr/lib/python2.7/site-packages/cinder/image/image_utils.py", line 293, in fetch_to_volume_format
2016-07-08 01:53:21.946 13415 TRACE cinder.volume.flows.manager.create_volume     raise exception.ImageUnacceptable(image_id=image_id, reason=reason)
2016-07-08 01:53:21.946 13415 TRACE cinder.volume.flows.manager.create_volume ImageUnacceptable: Image 54954bdc-d4df-4551-8170-fbbf33fc955b is unacceptable: Size is 3GB and doesn't fit in a volume of size 1GB.
2016-07-08 01:53:21.946 13415 TRACE cinder.volume.flows.manager.create_volume 
</snip>


- The operation will be successful if we specify size of volume > than "virtual-size" of glance image.

Actual results:
while creating volume from image, cinder do not fetch/consider "virtual-size" of image

Expected results:
while creating volume from image, cinder should consider "virtual-size" of image.

Additional info:

Comment 7 Tzach Shefi 2018-09-24 07:11:33 UTC
Despite my shared wish to have this fixed, an underlying design issue which won't be changed anytime soon means this was closed as NOTABUG. 

As such for the time being nothing for QE to test/automate.