Bug 1470409

Summary: launching instance with volume created from snapshot doesn't honor original image min_disk
Product: Red Hat OpenStack Reporter: Siggy Sigwald <ssigwald>
Component: python-django-horizonAssignee: Beth White <beth.white>
Status: CLOSED ERRATA QA Contact: Radomir Dopieralski <rdopiera>
Severity: low Docs Contact:
Priority: low    
Version: 10.0 (Newton)CC: akaris, athomas, beth.white, jschluet, mrunge, pgrist, rdopiera, srevivo, tshefi
Target Milestone: Upstream M3Keywords: Triaged
Target Release: 13.0 (Queens)   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: python-django-horizon-13.0.1-0.20180411230905.c51a46e.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-27 13:32:14 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:

Description Siggy Sigwald 2017-07-12 23:59:14 UTC
Description of problem:

When launching from Horizon an instance with volume creation from an image with a min-disk parameter : 

* the volume size (GB) is automatically set in the form to the minimum size, in my case 8 (Shot1.PNG)
* if I chooe a volume size inferior to this minimum size I get a nice error message : "The Volume size must be at least 8GB).

Here are the parameters of the image I use : 

[cloud_admin_scoped_default_domain credentials]$ openstack image show rhel73_hardened_safran_gpt
+------------------+----------------------------------------------------------------------------------------------------------+
| Field            | Value                                                                                                    |
+------------------+----------------------------------------------------------------------------------------------------------+
| checksum         | e4de4f3ef5902ddd72e6291acea5939c                                                                         |
| container_format | bare                                                                                                     |
| created_at       | 2017-07-07T16:17:18Z                                                                                     |
| disk_format      | qcow2                                                                                                    |
| file             | /v2/images/aa8885d1-65ca-4cf0-a2d7-a5ab7d271cf4/file                                                     |
| id               | aa8885d1-65ca-4cf0-a2d7-a5ab7d271cf4                                                                     |
| min_disk         | 8                                                                                                        |
| min_ram          | 0                                                                                                        |
| name             | rhel73_hardened_safran_gpt                                                                               |
| owner            | None                                                                                                     |
| properties       | direct_url='rbd://3243de78-569e-11e7-a06f-525400d145eb/images/aa8885d1-65ca-4cf0-a2d7-a5ab7d271cf4/snap' |
| protected        | False                                                                                                    |
| schema           | /v2/schemas/image                                                                                        |
| size             | 2102919168                                                                                               |
| status           | active                                                                                                   |
| tags             |                                                                                                          |
| updated_at       | 2017-07-12T07:19:38Z                                                                                     |
| virtual_size     | None                                                                                                     |
| visibility       | public                                                                                                   |
+------------------+----------------------------------------------------------------------------------------------------------+

When taking the snapshot of an instance booted 

When taking the snapshot of a VM booted from image, a private image is created with a min-disk size corresponding to the flavor size of the instance : 

[cloud_admin_scoped_default_domain credentials]$ openstack image show gouda-snap
+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| Field            | Value                                                                                                                                             |
+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| checksum         | 713f68be11877e2057e0441b73d8c233                                                                                                                  |
| container_format | bare                                                                                                                                              |
| created_at       | 2017-07-12T12:33:47Z                                                                                                                              |
| disk_format      | qcow2                                                                                                                                             |
| file             | /v2/images/6113a5c3-bd44-42a7-af89-e5da980ca4a8/file                                                                                              |
| id               | 6113a5c3-bd44-42a7-af89-e5da980ca4a8                                                                                                              |
| min_disk         | 10                                                                                                                                                |
| min_ram          | 0                                                                                                                                                 |
| name             | gouda-snap                                                                                                                                        |
| owner            | 32fcbd47e39c4fa6a4fce4472047228a                                                                                                                  |
| properties       | base_image_ref='aa8885d1-65ca-4cf0-a2d7-a5ab7d271cf4', direct_url='rbd://3243de78-569e-11e7-a06f-                                                 |
|                  | 525400d145eb/images/6113a5c3-bd44-42a7-af89-e5da980ca4a8/snap', image_location='snapshot', image_state='available', image_type='snapshot',        |
|                  | instance_uuid='8f7579ee-e035-465d-a280-fb48d87bb2b7', owner_id='32fcbd47e39c4fa6a4fce4472047228a',                                                |
|                  | user_id='8772028a3fcf2b6df0557523abafdd543f9671b2de362d4005d29c352007d950'                                                                        |
| protected        | False                                                                                                                                             |
| schema           | /v2/schemas/image                                                                                                                                 |
| size             | 2079457280                                                                                                                                        |
| status           | active                                                                                                                                            |
| tags             |                                                                                                                                                   |
| updated_at       | 2017-07-12T12:34:29Z                                                                                                                              |
| virtual_size     | None                                                                                                                                              |
| visibility       | private                                                                                                                                           |
+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+

However, when trying to launch an instance with volume creation based on that snapshot, the behaviour is much less user friendlly (Shot3.PNG)

* the Volume Size (GB) field is not automatically filled in with the minimum size ;
* the error message is not dipsplayed before you click on the Launch Instance button ;
* the disk sizes are displayed in bytes which is somewhat difficult to grasp at first size.

Expected results:
The behavior should be identical to the one with the image size.

Comment 1 Andreas Karis 2017-07-24 16:12:39 UTC
Hello,

Just to see if we can get any ETA or at least traction for this.

Regards,

Andreas

Comment 3 Tzach Shefi 2017-08-14 11:50:40 UTC
To be honest this looks like a Horizon issue of a missing automation/wizard which being missing doesn't automatically suggest volume size when using snapshots as source. 


CLI boot of an insufficient volume size, returns same error. 
 
# nova boot clinst --flavor 1 --block-device source=image,id=9aeb9b3e-6796-48ee-b4df-0c5af94bcc41,dest=volume,size=1,shutdown=preserve,bootindex=0 
ERROR (BadRequest): Volume is smaller than the minimum size specified in image metadata. Volume size is 2147483648 bytes, minimum size is 3221225472 bytes. (HTTP 400) (Request-ID: req-786cba69-bca0-4d52-9361-f1302a2962f6)

Here is what I did on Horizon: 

1. Uploaded Cirros image, set min-disk to 2G.
2. Booted an instance from Cinder volume 3G, created from above image. 
3. Snapshoted the new instance, which created a new snapshot(image) with 3G as min-disk set. 

4. I did notice both the correct flow, Horizon boot use image auto set vol size, as well as bad flow Horizon use vol snap no flavor selected. 


5. on cli I attempted to boot an instance create volume (size 2G) from said snap image, which failed with a descriptive error same as shown on shot3.png. I too would prefer to see size in GB rather than bytes agree. 

6. However on Horizon, this explain in my mind why this bug is a Horizon issue , when I clicked under images tab the "launch" button next to snap(image) the new volume size is selected automatically.

IMHO this is a half baked Horizon "wizard/automation" that works as expected, only if you initiate instance booting from image tab snapshot lunch. As if you start it from instance tab launch it doesn't kick in. Cinder isn't to blame as it reports and returns data to Horizon.

Comment 8 Beth White 2018-03-09 10:11:04 UTC
backported to stable/queens

Comment 11 errata-xmlrpc 2018-06-27 13:32:14 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/RHEA-2018:2086