Volume type 'None' gives indistinguishable CLI output

Bug #1261713 reported by Rushi Agrawal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-cinderclient
Fix Released
Low
Unassigned

Bug Description

If I create a volume type with name 'None'
    $ cinder type-create None

And then create a volume with type 'None' and another volume without any type:
  $ cinder create 1
  $ cinder create 1 --volume-type None

And then when I list out the volumes:
  $ cinder list
  +--------------------------------------+-----------+------+------+-------------+----------+-------------+
  | ID | Status | Name | Size | Volume Type | Bootable | Attached to |
  +--------------------------------------+-----------+------+------+-------------+----------+-------------+
  | 0754f0a6-08f6-4579-a279-8510f728cd2b | available | None | 1 | None | false | |
  | 1ac61e36-88b6-4b8e-baff-3f956237e8e5 | available | None | 1 | None | false | |
  +--------------------------------------+-----------+------+------+-------------+----------+-------------+

I am unable to distinguish which one is of which type.

Tags: api
Mike Perez (thingee)
tags: added: api
Changed in cinder:
status: New → Confirmed
milestone: none → icehouse-2
Revision history for this message
Rushi Agrawal (rushiagr) wrote :

@Mike, any thought on what should be the solution? Should we just disallow the string 'None' for volume type, or make the CLI output appear different for volume type 'None' and no volume type?

Note that currently there is no way in Cinder API to list all the volumes created with no type. When we call '/v2/<tenantID>/volumes?volume_type=None', all the volumes with 'None' volume type are returned.

This makes me lean towards the first solution. Thoughts?

Rohan (kanaderohan)
Changed in cinder:
assignee: nobody → Rohan (kanaderohan)
Changed in cinder:
assignee: Rohan (kanaderohan) → Shrirang Phadke (shrirangphadke)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/63099

Changed in cinder:
status: Confirmed → In Progress
Rohan (kanaderohan)
Changed in python-cinderclient:
assignee: nobody → Rohan (kanaderohan)
Revision history for this message
Rohan (kanaderohan) wrote :

This is a cinderclient side issue, Mainly because the cinder rest api correctly distinguishes between NoneType (seen in json output as null) values and "None" values as a string[1]

The confusion arises when the python cinder client tries to parse the json eg '{"key1": null, "key2": "None"}

parsed dict : {"key1": None, "key2": "None"}

This is the reason we cannot differentiate between the "cinder list" output when "None" str is passed as a volume_type name and when no name is set to the volume_type.

Amazon aws handles None values by showing a hyphen "-" in its dashboard and cmd clients (euca2ools). IMO, this should be fixed in python-cinderclient since the api output is correct.

We can take further discussions on this thread[2]

[1] http://paste.openstack.org/show/55648/
[2] http://lists.openstack.org/pipermail/openstack-dev/2013-December/022843.html

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-cinderclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/64665

Changed in python-cinderclient:
assignee: Rohan (kanaderohan) → Shrirang Phadke (shrirangphadke)
status: New → In Progress
no longer affects: cinder
Revision history for this message
Sheel Rana (ranasheel2000) wrote :

Its been long no progress seen on this issue...

So, changing its status from progress.

Revision history for this message
Sheel Rana (ranasheel2000) wrote :

This issue seems fixed by someone already:

+--------------------------------------+-----------+--------+------+-------------+----------+-------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+--------+------+-------------+----------+-------------+
| c70257fc-2319-491c-8442-36e7e37a2208 | available | - | 1 | lvmdriver-1 | false | |
| e31870d9-99b5-4ce9-acc2-87e5787fbfc4 | available | - | 1 | None | false | |
+--------------------------------------+-----------+--------+------+-------------+----------+-------------+

Changed in python-cinderclient:
importance: Undecided → Low
status: In Progress → Fix Released
assignee: Shrirang Phadke (shrirangphadke) → nobody
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.