Glance CLI does not allow to pass virtual_size param

Bug #1578596 reported by Ivan Kolodyazhny
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
In Progress
Undecided
Cyril Roelandt

Bug Description

python-glanceclient validates "virtual_size" param from CLI in a wrong way. It doesn't try to cast it to int and thinks that is's a string:

e0ne@dsvm1:~/devstack$ glance image-create --name fake-3g-data --disk-format qcow2 --container-format bare --property
virtual_size=33333 < test-qcow500.imgUnable to set 'virtual_size' to '33333'. Reason: u'33333' is not of type u'null', u'integer'
Unable to set 'virtual_size' to '33333'. Reason: u'33333' is not of type u'null', u'integer'

Failed validating u'type' in schema[u'properties'][u'virtual_size']:
    {u'description': u'Virtual size of image in bytes',
     u'readOnly': True,
     u'type': [u'null', u'integer']}

On instance[u'virtual_size']:
    u'33333'

The same issue occurs using OpenStack Client:
e0ne@dsvm1:~/devstack$ openstack image create --disk-format qcow2 --container-format bare --property virtual_size=33333 < test-qcow500.img fake-3g-dataUnable to set 'virtual_size' to '33333'. Reason: '33333' is not of type u'null', u'integer'

Failed validating u'type' in schema[u'properties'][u'virtual_size']:
    {u'description': u'Virtual size of image in bytes',
     u'readOnly': True,
     u'type': [u'null', u'integer']}

On instance[u'virtual_size']:
    '33333'

Changed in python-glanceclient:
status: New → Confirmed
Revision history for this message
wangxiyuan (wangxiyuan) wrote :

virtual size is a read only property which means that users can't set it's value.

Revision history for this message
Kairat Kushaev (kkushaev) wrote :

yep, it is only can be set when we launch specific task that calculates image virtual size.

Changed in python-glanceclient:
status: Confirmed → Invalid
Revision history for this message
Ivan Kolodyazhny (e0ne) wrote :

I understand that it's a read-only property. Why can't we set it during image upload? We have to fix it or remove this option from CLI

Changed in python-glanceclient:
status: Invalid → Confirmed
Revision history for this message
Arvinder Singh (arvinder-singh) wrote :

Do we need to remove this from the CLI option or we need to set it as a integer value.

Changed in python-glanceclient:
assignee: nobody → Arvinder Singh (arvinder-09)
Changed in python-glanceclient:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)
Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

We need to make sure users cannot pass read-only properties, imho.

Changed in python-glanceclient:
assignee: Arvinder Singh (arvinder-singh) → Cyril Roelandt (cyril-roelandt)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.