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

Bug 1093383

Summary: glance: creating an image with --size reports the image created as qcow2 but creates it as raw
Product: Red Hat OpenStack Reporter: Dafna Ron <dron>
Component: openstack-glanceAssignee: RHOS Maint <rhos-maint>
Status: CLOSED WONTFIX QA Contact: Dafna Ron <dron>
Severity: urgent Docs Contact:
Priority: high    
Version: 4.0CC: dron, eglynn, fpercoco, scohen, yeylon
Target Milestone: z6Keywords: Reopened
Target Release: 5.0 (RHEL 7)   
Hardware: x86_64   
OS: Linux   
Whiteboard: storage
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-07 12:35:42 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
glance log none

Description Dafna Ron 2014-05-01 14:56:32 UTC
Created attachment 891552 [details]
glance log

Description of problem:

when I create an image using --size and select format qcow2 while the image source is raw, the image is created as raw but reported as qcow2

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

[root@orange-vdsf images(keystone_admin)]# rpm -qa |grep glance 
openstack-glance-2013.2.3-2.el6ost.noarch
python-glanceclient-0.12.0-2.el6ost.noarch
python-glance-2013.2.3-2.el6ost.noarch


How reproducible:

100%

Steps to Reproduce:
1. run: 
glance image-create --name <name> --disk-format qcow2 --container-format bare --copy-from http://download.eng.tlv.redhat.com/pub/rhel/released/RHEL-6/6.4/Appliance/rhel-client-x86_64-ec2-starter-6.4_20130130.0-1-sda.raw --size 21474836480
2. after the image is created go to where the glance images are located (in my case it was a gluster mount) and run: qemu-img info <info>
3.

Actual results:

image is created as raw but reported as qcow2

Expected results:

image should be created as qcow2

Additional info:


[root@puma32 ~(keystone_admin)]# glance image-list --human 
+--------------------------------------+-------------+-------------+------------------+---------+--------+
| ID                                   | Name        | Disk Format | Container Format | Size    | Status |
+--------------------------------------+-------------+-------------+------------------+---------+--------+
| 2d3f7e14-b55c-4fc0-8363-7a905b0497c1 | cirros      | qcow2       | bare             | 9.3MB   | active |
| cb827448-a3a4-46b6-b421-9815dd656a8c | dafna3      | qcow2       | bare             | 20GB    | saving |
| e50e8dac-35b7-459d-a434-fda5e2e24217 | dafna_cli   | qcow2       | bare             | 1.8GB   | active |
| 1027c977-4cc6-4dc1-9895-eb1b63ef0bb4 | dafna_cli   | raw         | bare             | 6GB     | active |
| 834360fa-ebcd-46ed-a1b2-b64cc6a80e81 | dafna_cli   | raw         | bare             | 6GB     | active |
| 31631db6-6a52-4bf7-9e17-78588fc11536 | dafna_qcow  | qcow2       | bare             | 666.2MB | active |
| f6f75fa7-be01-4d35-9f8e-2d1e03731c11 | dafna_raw   | raw         | bare             | 6GB     | active |
| 125d993b-1965-456c-b73b-a6096c0930f7 | dafna_zise  | raw         | bare             | 6GB     | active |
| 292c11dd-a16b-46a0-b176-d665293273b3 | dafna_zise1 | qcow2       | bare             | 6GB     | active |
| eba45bdb-eec4-4254-821c-ffd1f65be371 | dafna_zise2 | qcow2       | bare             | 1.8GB   | active |
| caecf7f4-f017-4b6e-a711-826fa62601cd | tshefi3     | raw         | bare             | 6GB     | active |
| 645d7759-90cc-4873-baad-8d7cf4b3831d | tshefi_cli  | raw         | bare             | 6GB     | active |
| ac574a2b-6e68-4833-89f3-16a94e7f3479 | tshefi_cli2 | raw         | bare             | 6GB     | active |
| 5e8913e7-d4b6-4d44-9aa8-58dd9482c2a3 | tshefi_cli2 | raw         | bare             | 6GB     | active |
+--------------------------------------+-------------+-------------+------------------+---------+--------+


[root@orange-vdsf images(keystone_admin)]# qemu-img info cb827448-a3a4-46b6-b421-9815dd656a8c
image: cb827448-a3a4-46b6-b421-9815dd656a8c
file format: raw
virtual size: 6.0G (6442451456 bytes)
disk size: 6.0G
[root@orange-vdsf images(keystone_admin)]# glance image-list 
+--------------------------------------+-------------+-------------+------------------+------------+--------+
| ID                                   | Name        | Disk Format | Container Format | Size       | Status |
+--------------------------------------+-------------+-------------+------------------+------------+--------+
| 2d3f7e14-b55c-4fc0-8363-7a905b0497c1 | cirros      | qcow2       | bare             | 9761280    | active |
| cb827448-a3a4-46b6-b421-9815dd656a8c | dafna3      | qcow2       | bare             | 6442450945 | active |
| e50e8dac-35b7-459d-a434-fda5e2e24217 | dafna_cli   | qcow2       | bare             | 1974140928 | active |
| 1027c977-4cc6-4dc1-9895-eb1b63ef0bb4 | dafna_cli   | raw         | bare             | 6442450945 | active |
| 834360fa-ebcd-46ed-a1b2-b64cc6a80e81 | dafna_cli   | raw         | bare             | 6442450945 | active |
| 31631db6-6a52-4bf7-9e17-78588fc11536 | dafna_qcow  | qcow2       | bare             | 698578432  | active |
| f6f75fa7-be01-4d35-9f8e-2d1e03731c11 | dafna_raw   | raw         | bare             | 6442450945 | active |
| 125d993b-1965-456c-b73b-a6096c0930f7 | dafna_zise  | raw         | bare             | 6442450945 | active |
| 292c11dd-a16b-46a0-b176-d665293273b3 | dafna_zise1 | qcow2       | bare             | 6442450945 | active |
| eba45bdb-eec4-4254-821c-ffd1f65be371 | dafna_zise2 | qcow2       | bare             | 1974140928 | active |
| caecf7f4-f017-4b6e-a711-826fa62601cd | tshefi3     | raw         | bare             | 6442450945 | active |
| 645d7759-90cc-4873-baad-8d7cf4b3831d | tshefi_cli  | raw         | bare             | 6442450945 | active |
| ac574a2b-6e68-4833-89f3-16a94e7f3479 | tshefi_cli2 | raw         | bare             | 6442450945 | active |
| 5e8913e7-d4b6-4d44-9aa8-58dd9482c2a3 | tshefi_cli2 | raw         | bare             | 6442450945 | active |
+--------------------------------------+-------------+-------------+------------------+------------+--------+

Comment 1 Flavio Percoco 2014-05-02 07:59:09 UTC
Glance doesn't do any image conversion nor inspection. If the user specified the --disk-format as qcow2 but the image is raw, then it's an user's error.

Comment 2 Dafna Ron 2014-05-02 08:31:37 UTC
Flavio, 
1. reporting a wrong image format (even if it's a user error in creating the image) is a bug. 
2. if I can create the a different format image when not creating the --size I don't see what --size should have any effect. 
3. even if we decide that something is not supported we need to block it with a clear error message for the user.

Comment 3 Flavio Percoco 2014-05-05 09:13:33 UTC
(In reply to Dafna Ron from comment #2)
> 2. if I can create the a different format image when not creating the --size
> I don't see what --size should have any effect.

I don't follow this point. What did you mean? What happens when you don't pass --size ?

> 1. reporting a wrong image format (even if it's a user error in creating the
> image) is a bug. 
> 3. even if we decide that something is not supported we need to block it
> with a clear error message for the user.

We *don't have* a way to know if it is wrong or not! Without inspecting the image - which we don't do now - we can't know whether the image is valid, the format is correct whatsoever.

Comment 4 Dafna Ron 2014-05-07 09:27:57 UTC
you're right on the --size - it happens without the --size as well. 

can we have a check run once the image is downloaded to see that the image reported format fits with the actual image format and if not do one or more of the following:
1. report error in log + cli output.
2. change the format reported in the db

Comment 5 Flavio Percoco 2014-05-07 12:35:42 UTC
We can't as of now but I believe some time in the future. The reason is that Glance, since its inception, has been an image registry. That is, a place to have a catalog of images. It has never been a *real* image service capable of doing operations on images. This may/may not change in the future, what will happen has yet to be discussed.

Checking the image extension is certainly not a valid option.