Bug 1310578 - Horizon unable to create volume from image qcow with min_disk set to 0 - size issue
Horizon unable to create volume from image qcow with min_disk set to 0 - size...
Status: CLOSED UPSTREAM
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-glance (Show other bugs)
7.0 (Kilo)
Unspecified Unspecified
medium Severity medium
: ---
: 10.0 (Newton)
Assigned To: Cyril Roelandt
nlevinki
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-22 05:00 EST by Cyril Lopez
Modified: 2016-08-08 08:24 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-07-27 10:55:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
cylopez: needinfo-


Attachments (Terms of Use)

  None (edit)
Description Cyril Lopez 2016-02-22 05:00:09 EST
Description of problem:
On RHOS deploy by director 7.2 with CEPH

If I use a QCOW2 image and i try to create a volume from this image via Horizon, it's failling due to horizon (i presume) ask cinder to create a volume to less than the RAW size.

Version-Release number of selected component (if applicable):
python-cinderclient-1.2.1-1.el7ost.noarch
python-cinder-2015.1.2-5.el7ost.noarch
python-django-horizon-2015.1.2-4.el7ost.noarch
openstack-cinder-2015.1.2-5.el7ost.noarch

How reproducible:


Steps to Reproduce:
1. Download a QCOW2 image
2. With Horizon try to create a volume
3.

Actual results:
/var/log/cinder/volume.log:2016-02-22 12:27:53.617 135955 TRACE oslo_messaging.rpc.dispatcher     raise exception.ImageUnacceptable(ex)
/var/log/cinder/volume.log:2016-02-22 12:27:53.617 135955 TRACE oslo_messaging.rpc.dispatcher ImageUnacceptable: Image 7e3e6651-ede5-4739-815a-64b212669466 is unacceptable: Size is 17GB and doesn't fit in a volume of size 16GB.
/var/log/cinder/volume.log:2016-02-22 12:27:53.617 135955 TRACE oslo_messaging.rpc.dispatcher

Expected results:

Create a volume from the virtual size and not the disk size. 

If a try with the virtual size is working good
cinder create --display-name testcli --image-id 7e3e6651-ede5-4739-815a-64b212669466 17
+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|     attachments     |                  []                  |
|  availability_zone  |                 nova                 |
|       bootable      |                false                 |
|      created_at     |      2016-02-22T09:40:12.257374      |
| display_description |                 None                 |
|     display_name    |               testcli                |
|      encrypted      |                False                 |
|          id         | 760501ca-8e6d-47d9-b37a-5b6920924f28 |
|       image_id      | 7e3e6651-ede5-4739-815a-64b212669466 |
|       metadata      |                  {}                  |
|     multiattach     |                false                 |
|         size        |                  17                  |
|     snapshot_id     |                 None                 |
|     source_volid    |                 None                 |
|        status       |               creating               |
|     volume_type     |                 None                 |
+---------------------+--------------------------------------+
cinder list
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
|                  ID                  |   Status  | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| 760501ca-8e6d-47d9-b37a-5b6920924f28 | available |   testcli    |  17  |      -      |   true   |             |
+--------------------------------------+-----------+--------------+------+-------------+----------+-----


Additional info:

The image :
qemu-img info windows_server_2012_r2_standard_eval_kvm_20151021.qcow2
image: windows_server_2012_r2_standard_eval_kvm_20151021.qcow2
file format: qcow2
virtual size: 17G (18253611008 bytes)
disk size: 16G
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false
Comment 1 Matthias Runge 2016-02-22 05:05:52 EST
horizon uses a tmp dir 
FILE_UPLOAD_TEMP_DIR
which should be big enough to contain the uploaded file.
If that's not set, it defaults to /tmp

Could you please check that?
Comment 3 Cyril Lopez 2016-02-22 05:11:20 EST
(In reply to Matthias Runge from comment #1)
> horizon uses a tmp dir 
> FILE_UPLOAD_TEMP_DIR
> which should be big enough to contain the uploaded file.
> If that's not set, it defaults to /tmp
> 
> Could you please check that?

I'm sorry but is not during the upload in glance time. Is when you ask for a volume from an image already in glance.

FYI:
[root@xxx-ctrl02 ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       279G   18G  262G   7% /
devtmpfs         63G     0   63G   0% /dev
tmpfs            63G   39M   63G   1% /dev/shm
tmpfs            63G  3.2M   63G   1% /run
tmpfs            63G     0   63G   0% /sys/fs/cgroup
tmpfs            13G     0   13G   0% /run/user/991
tmpfs            13G     0   13G   0% /run/user/992
tmpfs            13G     0   13G   0% /run/user/1000
Comment 4 Matthias Runge 2016-02-22 05:21:41 EST
sorry, I fail to follow here.

This bug is about letting you to create a volume with insufficient size?
Comment 5 Cyril Lopez 2016-02-22 06:50:27 EST
After verification, if min_disk is not set, glance provide disk size and not virtual size.
Comment 6 Matthias Runge 2016-02-22 07:06:10 EST
so, my takeaway is here: 
you create an image in glance, but for qcows, you have to specify a min_disk size. 

This bug is something like a RFE to update images to set the min_disk size from introspected qcows.
Comment 8 Cyril Roelandt 2016-03-10 06:40:05 EST
@Cyril: I'm not sure I really understand where Glance comes into play, here, since you said it was an issue between Cinder and Horizon. Or does this only happen with images created through Glance? If so, how did you create it?
Comment 9 Matthias Runge 2016-03-12 14:45:47 EST
iirc, this is the request to let glance set min_disk size automatically with a sane value. Apparently, this is not being done.

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