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

Bug 1133560

Summary: Creating volume from snapshot dialog in horizon gives wrong size guidance
Product: Red Hat OpenStack Reporter: Eduard Barrera <ebarrera>
Component: python-django-horizonAssignee: Julie Pichon <jpichon>
Status: CLOSED ERRATA QA Contact: Ami Jeain <ajeain>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.0CC: aortega, athomas, eharney, fpercoco, jpichon, mrunge, sclewis, yeylon
Target Milestone: z2Keywords: Triaged, ZStream
Target Release: 5.0 (RHEL 7)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-django-horizon-2014.1.3-1.el7ost Doc Type: Bug Fix
Doc Text:
Cause: When creating a volume from an image, the suggested minimum size was based on the image size. Consequence: It is not unusual for images to be compressed and require much more space to actually work. Images have a min_disk attribute to indicate this. Fix: Prefill the volume disk size field with whichever is the largest value, between the image size or the image min_disk size. Result: When creating a volume from an image, the suggested size is sufficient to ensure the volume creation will succeed. Also, if the size is insufficient compared to the image requirements, a clear error message is displayed when trying to create the volume.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-03 14:39:33 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
Dialog none

Description Eduard Barrera 2014-08-25 13:06:18 UTC
Created attachment 930476 [details]
Dialog

Description of problem:

Creating volume from snapshot dialog in horizon gives wrong size guidance, please refer to the screenshot attached.


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


How reproducible:
Always

Steps to Reproduce:

I boot the instance from an image.
So the order is:
1) boot instance from image
2) create snapshot from instance
3) create volume from snapshot -> this is where the wrong minimum size is indicated.




Actual results:

wrong size in the dialog, please see the screenshot, I will see what I mean with dialog

Comment 2 Eric Harney 2014-08-25 14:09:12 UTC
Looks like this is a Horizon issue based on the notes in the case:

"""
For exmaple:
 1) Start an instanfe with a vdisk of 28GB.
 2) create a snapshot. This ends up being 1,3 GB. 
 3) clone a volume from this snapshot. The dialog has a tooltip on the size field that tells you that the volume must be at least 1,3 GB. But if you for example select 2GB you will get an error, and the volume will not e created. If you enter 28GB as volume size the volume creation succeeds.
 So this tooltip is incorrect.
"""

Horizon seems to generate this message based on the image "size" attribute rather than "min_disk" which is not correct.  (The image's min_disk is 28 and size is 1541603328.)

Comment 3 Julie Pichon 2014-09-10 03:32:04 UTC
Thanks for the tips in the comment Eric. In theory this should be fixed in Icehouse / RHEL-OSP 5 by https://bugs.launchpad.net/horizon/+bug/1241253 which shows whichever is higher between the image size or minimum disk size. However I may have just found another bug in that area, I'll investigate further.

Comment 4 Julie Pichon 2014-09-11 04:56:23 UTC
The bug I linked to fixed this behaviour only for images that are directly created with a min disk size:

$ glance image-show <id_of_image>
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
...
| min_disk         | 2                                    |
...

However when an image is created from an instance, the min_disk attribute on the image is set to 0, and the actual min_disk value is set instead as a property:

$ glance image-show <id_of_snapshot>
+---------------------------------+------------------------+
| Property                        | Value                  |
+---------------------------------+------------------------+
...
| Property 'min_disk'             | 2                      |
...
| min_disk                        | 0                      |
...

(The same seems to apply to the 'size' attribute and property, too.)

I'm not sure what is the reason for this. Adding a needinfo on Flavio: would you be aware as to why the min_disk value isn't set directly on the image when creating an instance snapshot (e.g. with nova image-create)? Is this the expected behaviour?

From the Horizon side, the fix looks simple enough if we can count on either attribute to be set.

Comment 5 Flavio Percoco 2014-09-15 09:33:58 UTC
@Julie, I don't think this is the expected behavior. I tried to find where in nova this is happening but I couldn't find the exact line of code. That said, `min_disk` value should be the same or higher as the original image.

Comment 6 Julie Pichon 2014-09-16 05:28:07 UTC
Thanks Flavio! Based on your comment I opened https://bugs.launchpad.net/glance/+bug/1369854 upstream. Poking at it a bit more this doesn't seem to happen when creating an image from a "regular" instance (simply booted using an image). Only when the instance was also launched with a volume.

Comment 7 Matthias Runge 2014-10-08 09:43:59 UTC
The fix is included in python-django-horizon-2014.1.3-1.el7ost

Comment 9 Ami Jeain 2014-10-20 11:49:08 UTC
verified in latest horizon:
# rpm -qa |grep horizon
python-django-horizon-2014.1.3-1.el7ost.noarch

Comment 10 Scott Lewis 2014-11-03 14:39:33 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://rhn.redhat.com/errata/RHBA-2014-1778.html