Bug 1481809 - create from image fails if glance image is raw with qcow2 header
Summary: create from image fails if glance image is raw with qcow2 header
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-cinder
Version: 11.0 (Ocata)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: z3
: 11.0 (Ocata)
Assignee: Eric Harney
QA Contact: Avi Avraham
URL:
Whiteboard:
Depends On:
Blocks: 1470217
TreeView+ depends on / blocked
 
Reported: 2017-08-15 19:06 UTC by Eric Harney
Modified: 2020-12-14 09:32 UTC (History)
9 users (show)

Fixed In Version: openstack-cinder-10.0.4-4.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1470217
Environment:
Last Closed: 2017-10-31 17:44:20 UTC
Target Upstream Version:
Embargoed:
tshefi: automate_bug+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1703892 0 None None None 2017-08-15 19:06:30 UTC
OpenStack gerrit 483012 0 None MERGED Don't verify format with autodetect after image conversion 2021-02-01 20:43:30 UTC
Red Hat Product Errata RHBA-2017:3103 0 normal SHIPPED_LIVE openstack-cinder bug fix advisory 2017-10-31 21:40:20 UTC

Description Eric Harney 2017-08-15 19:06:30 UTC
+++ This bug was initially created as a clone of Bug #1470217 +++

$ qemu-img create -f qcow2 testqcow2.img 1G
$ glance image-create --file ./testqcow2.img  --disk-format raw --container-format bare
$ cinder create 1 --image-id <image>


This fails with:

ImageUnacceptable: Image e020e664-fe3a-40a0-8d32-928fbc7b4a75 is unacceptable: Converted to raw, but format is now qcow2


This is because Cinder does a "qemu-img info" check to determine the file format, which is detected as qcow2.  Raw images from Glance need to do this check differently because they could contain any header/format.

Comment 4 Tzach Shefi 2017-10-15 19:36:48 UTC
Verified on openstack-cinder-10.0.6-1.el7ost.noarch

Repro steps work without error, volume is created from image. 

qemu-img create -f qcow2 testqcow2.img 1G
Formatting 'testqcow2.img', fmt=qcow2 size=1073741824 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16

[stack@undercloud-0 ~]$ glance image-create --file ./testqcow2.img  --disk-format raw --container-format bare
+------------------+-----------------------------------------------------------------+
| Property         | Value                                                           |
+------------------+-----------------------------------------------------------------+
| checksum         | 8810863346314775e74ae12bc2228ef1                                |
| container_format | bare                                                            |
| created_at       | 2017-10-15T19:33:20Z                                            |
| direct_url       | swift+config://ref1/glance/0b8d3abc-72cd-4341-9547-eb234f5e203b |                                                                                           
| disk_format      | raw                                                             |                                                                                           
| id               | 0b8d3abc-72cd-4341-9547-eb234f5e203b                            |                                                                                           
| min_disk         | 0                                                               |                                                                                           
| min_ram          | 0                                                               |                                                                                           
| name             | None                                                            |                                                                                           
| owner            | 83d18c34b9b34a7e8eb9707e8b315306                                |                                                                                           
| protected        | False                                                           |                                                                                           
| size             | 196624                                                          |                                                                                           
| status           | active                                                          |                                                                                           
| tags             | []                                                              |                                                                                           
| updated_at       | 2017-10-15T19:33:20Z                                            |                                                                                           
| virtual_size     | None                                                            |                                                                                           
| visibility       | shared                                                          |                                                                                           
+------------------+-----------------------------------------------------------------+    

[stack@undercloud-0 ~]$ cinder create 1 --image-id 0b8d3abc-72cd-4341-9547-eb234f5e203b
+--------------------------------+--------------------------------------+
| Property                       | Value                                |
+--------------------------------+--------------------------------------+
| attachments                    | []                                   |
| availability_zone              | nova                                 |
| bootable                       | false                                |
| consistencygroup_id            | None                                 |
| created_at                     | 2017-10-15T19:33:51.000000           |
| description                    | None                                 |
| encrypted                      | False                                |
| id                             | 0c736fab-e373-44da-b5fa-8dda9d21f4d4 |
| metadata                       | {}                                   |
| migration_status               | None                                 |
| multiattach                    | False                                |
| name                           | None                                 |
| os-vol-host-attr:host          | None                                 |
| os-vol-mig-status-attr:migstat | None                                 |
| os-vol-mig-status-attr:name_id | None                                 |
| os-vol-tenant-attr:tenant_id   | 83d18c34b9b34a7e8eb9707e8b315306     |
| replication_status             | None                                 |
| size                           | 1                                    |
| snapshot_id                    | None                                 |
| source_volid                   | None                                 |
| status                         | creating                             |
| updated_at                     | None                                 |
| user_id                        | 2e034e7699db454cbe2e415dad80565c     |
| volume_type                    | None                                 |
+--------------------------------+--------------------------------------+
[stack@undercloud-0 ~]$ cinder list
+--------------------------------------+-----------+------+------+-------------+----------+-------------+
| ID                                   | Status    | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+------+------+-------------+----------+-------------+
| 0c736fab-e373-44da-b5fa-8dda9d21f4d4 | available | -    | 1    | -           | true     |             |
+--------------------------------------+-----------+------+------+-------------+----------+-------------+

Comment 6 errata-xmlrpc 2017-10-31 17:44:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:3103


Note You need to log in before you can comment on or make changes to this bug.