cinder client does not have handling for "--bootable" parameter for cinder list command

Bug #1535749 reported by Sheel Rana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Sheel Rana
python-cinderclient
Fix Released
Medium
Sheel Rana

Bug Description

sheelrana@sheelrana-VirtualBox:~/cinder$ cinder list --availability_zone nova
usage: cinder [--version] [-d] [--os-auth-system <auth-system>]
              [--service-type <service-type>] [--service-name <service-name>]
              [--volume-service-name <volume-service-name>]
              [--endpoint-type <endpoint-type>]
              [--os-endpoint-type <os-endpoint-type>]
              [--os-volume-api-version <volume-api-ver>]
              [--bypass-url <bypass-url>] [--retries <retries>]
              [--profile HMAC_KEY] [--os-auth-strategy <auth-strategy>]
              [--os-username <auth-user-name>] [--os-password <auth-password>]
              [--os-tenant-name <auth-tenant-name>]
              [--os-tenant-id <auth-tenant-id>] [--os-auth-url <auth-url>]
              [--os-user-id <auth-user-id>]
              [--os-user-domain-id <auth-user-domain-id>]
              [--os-user-domain-name <auth-user-domain-name>]
              [--os-project-id <auth-project-id>]
              [--os-project-name <auth-project-name>]
              [--os-project-domain-id <auth-project-domain-id>]
              [--os-project-domain-name <auth-project-domain-name>]
              [--os-region-name <region-name>] [--os-token <token>]
              [--os-url <url>] [--insecure] [--os-cacert <ca-certificate>]
              [--os-cert <certificate>] [--os-key <key>] [--timeout <seconds>]
              <subcommand> ...
error: unrecognized arguments: --availability_zone nova
Try 'cinder help ' for more information.
sheelrana@sheelrana-VirtualBox:~/cinder$

sheelrana@sheelrana-VirtualBox:~/cinder$ cinder list --name sheel
+--------------------------------------+-----------+------------------+-------+------+-------------+----------+-------------+-------------+
| ID | Status | Migration Status | Name | Size | Volume Type | Bootable | Multiattach | Attached to |
+--------------------------------------+-----------+------------------+-------+------+-------------+----------+-------------+-------------+
| 66bd1513-3791-4de1-933c-d3198ecf5038 | available | - | sheel | 1 | lvmdriver-1 | false | False | |
+--------------------------------------+-----------+------------------+-------+------+-------------+----------+-------------+-------------+
sheelrana@sheelrana-VirtualBox:~/cinder$ cinder list --status available
+--------------------------------------+-----------+------------------+-------+------+-------------+----------+-------------+-------------+
| ID | Status | Migration Status | Name | Size | Volume Type | Bootable | Multiattach | Attached to |
+--------------------------------------+-----------+------------------+-------+------+-------------+----------+-------------+-------------+
| 66bd1513-3791-4de1-933c-d3198ecf5038 | available | - | sheel | 1 | lvmdriver-1 | false | False | |
+--------------------------------------+-----------+------------------+-------+------+-------------+----------+-------------+-------------+
sheelrana@sheelrana-VirtualBox:~/cinder$ cinder list --bootable false
usage: cinder [--version] [-d] [--os-auth-system <auth-system>]
              [--service-type <service-type>] [--service-name <service-name>]
              [--volume-service-name <volume-service-name>]
              [--endpoint-type <endpoint-type>]
              [--os-endpoint-type <os-endpoint-type>]
              [--os-volume-api-version <volume-api-ver>]
              [--bypass-url <bypass-url>] [--retries <retries>]
              [--profile HMAC_KEY] [--os-auth-strategy <auth-strategy>]
              [--os-username <auth-user-name>] [--os-password <auth-password>]
              [--os-tenant-name <auth-tenant-name>]
              [--os-tenant-id <auth-tenant-id>] [--os-auth-url <auth-url>]
              [--os-user-id <auth-user-id>]
              [--os-user-domain-id <auth-user-domain-id>]
              [--os-user-domain-name <auth-user-domain-name>]
              [--os-project-id <auth-project-id>]
              [--os-project-name <auth-project-name>]
              [--os-project-domain-id <auth-project-domain-id>]
              [--os-project-domain-name <auth-project-domain-name>]
              [--os-region-name <region-name>] [--os-token <token>]
              [--os-url <url>] [--insecure] [--os-cacert <ca-certificate>]
              [--os-cert <certificate>] [--os-key <key>] [--timeout <seconds>]
              <subcommand> ...
error: unrecognized arguments: --bootable false
Try 'cinder help ' for more information.

Changed in cinder:
assignee: nobody → Sheel Rana (ranasheel2000)
summary: - cinder client does not have handling for parameters for cinder list
- command
+ cinder client does not have handling for "--availability_zone" parameter
+ for cinder list command
summary: - cinder client does not have handling for "--availability_zone" parameter
- for cinder list command
+ cinder client does not have handling for "--bootable" parameter for
+ cinder list command
Changed in cinder:
status: New → In Progress
Revision history for this message
Mitsuhiro Tanino (mitsuhiro-tanino) wrote :

I think this is not a bug but adds a new feature.
Why do you want to add bootable option to list command?

We can get same result like this.
  cinder list --fields bootable | grep False
  cinder list --fields bootable | grep True

If there is a good use-case, this might help users.

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

Dear Mitsuhiro,

Yes, this can be done this way as well.

Why I proposed this change is to keep same behavior at CINDER-API, CinderClient and Horizon.

API allows to query in this format as well as HORIZON can also select on the basis of bootable=yes.
So, I thought lets keep it same everywhere. :)

We can add this as new functionality as well to facilitate user with:
1. To list only bootable volumes from CLI to use with instances.
2. May be its preferable(usability point of view) to use filter than searching through grep and all at user/admin level.
3. Also, In good softwares, linux level commands are not exposed to user to use on CLI prompt.
I need to check with openstack if this kind of behavior exists or it's all open to user.
4. Its kind of overhead to handle this kind of things at client end.

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

I agree this as new functionality.
If you agree with use case or reason mentioned in above comments, I would like to raise BP for same.

Changed in python-cinderclient:
assignee: nobody → Sheel Rana (ranasheel2000)
status: New → In Progress
Revision history for this message
Mitsuhiro Tanino (mitsuhiro-tanino) wrote :

Thank you for your explanation.
In above case, I think opening new BP is proper steps, and I saw you have already opened new BP.
I understand your concern using CLI with other commands, but I'm curios why you'd like to get only bootable volume.

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

Dear Mitsuhiro,

>I understand your concern using CLI with other commands, but I'm curios why you'd like to get only bootable volume.
Actually its not about only bootable rather its about combination of default filter options supported in cinder-api + options which are available under output of cinder list command.

|Default Arguments in API:
['name', 'status', 'metadata', 'availability_zone'],

|cinder list output
sheelrana@sheelrana-VirtualBox:~/cinder$ cinder list --name sheel
+--------------------------------------+-----------+------------------+-------+------+-------------+----------+-------------+-------------+
| ID | Status | Migration Status | Name | Size | Volume Type | Bootable | Multiattach | Attached to |
+--------------------------------------+-----------+------------------+-------+------+-------------+----------+-------------+-------------+
| 66bd1513-3791-4de1-933c-d3198ecf5038 | available | - | sheel | 1 | lvmdriver-1 | false | False | |
+--------------------------------------+-----------+------------------+------

So, user can visualize "Bootable" in cinder list output and same is part of default argument support in cinder-api.
Availibility_zone is also part of default arguments but that is not visible in cinder list output.
So, not taking that into consideration.

Though its ok to add support for other options as well if required and usable from user point of view.
You may suggest if you think something else as well required.

Thank you!!

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

mentioning BP url for reference(not to disturb others in case BP contents changes)

https://blueprints.launchpad.net/python-cinderclient/+spec/select-volume-through-bootable-option

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/272229

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/272232

Changed in cinder:
importance: Undecided → Medium
Changed in python-cinderclient:
importance: Undecided → Medium
Changed in cinder:
milestone: none → ongoing
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/272229
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=47ec84182007024eba86b50de59a0bd5978b64a2
Submitter: Jenkins
Branch: master

commit 47ec84182007024eba86b50de59a0bd5978b64a2
Author: Sheel Rana <email address hidden>
Date: Thu Feb 4 00:00:11 2016 +0530

    Bootable filter for listening volumes from CLI

    Currently cinder treats all values passed to it as True
    for bootable filter in volume GET call.

    For ex, if bootable=invalid, it converts it into True being
    bootable as boolean value in db table 'volume'.

    Need to update filtering functionality in cinder to address
    'True' and 'False' values seperately.

    Existing behavior will be kept same.
    Only True/False/true/false input handling is done to treat
    true/false seperately
    (In current behavior, whatever input is passed for boolean
    parameter, cinder convetrs it to True)

    Implements : blueprint select-volume-through-bootable-option

    Closes-Bug: #1535749

    Change-Id: I1f1ec20441b28e01bf07bc4f60d848b653e58d58

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-cinderclient (master)

Reviewed: https://review.openstack.org/272232
Committed: https://git.openstack.org/cgit/openstack/python-cinderclient/commit/?id=3dec787a52094250a597524eee933c5a1eedb2b9
Submitter: Jenkins
Branch: master

commit 3dec787a52094250a597524eee933c5a1eedb2b9
Author: Sheel Rana <email address hidden>
Date: Tue Jan 26 00:44:48 2016 +0530

    Bootable filter for listening volumes from CLI

    This fix depends upon fix proposed in cinder.

    Depends-On: I1f1ec20441b28e01bf07bc4f60d848b653e58d58

    DocImpact

    Implements : blueprint select-volume-through-bootable-option

    Closes-Bug: #1535749

    Change-Id: Ibf3eadc95307e0c803ad9fa449578f8ca6f654d0

Changed in python-cinderclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to cinder (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/278605

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/python-cinderclient 1.6.0

This issue was fixed in the openstack/python-cinderclient 1.6.0 release.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/cinder 8.0.0.0b3

This issue was fixed in the openstack/cinder 8.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/295985

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/liberty)

Reviewed: https://review.openstack.org/295985
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=3c28bdf4766fc2f9483281cf4f3b0f3478d69f5a
Submitter: Jenkins
Branch: stable/liberty

commit 3c28bdf4766fc2f9483281cf4f3b0f3478d69f5a
Author: root <email address hidden>
Date: Tue Mar 22 23:51:03 2016 +0530

    Bootable filter for listening volumes

    Currently cinder treats all values passed to it as True
    for bootable filter in volume GET call.

    For ex, if bootable=invalid, it converts it into True being
    bootable as boolean value in db table 'volume'.

    Need to update filtering functionality in cinder to address
    'True' and 'False' values seperately.

    This is cherry picked from mitaka, change ID
    I1f1ec20441b28e01bf07bc4f60d848b653e58d58

    Change-Id: Ib2ea7bcf3177c06614c41108c4fff3726222502a
    Closes-Bug: #1535749

tags: added: in-stable-liberty
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/cinder 7.0.2

This issue was fixed in the openstack/cinder 7.0.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

This issue was fixed in the openstack/cinder 7.0.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-cinderclient 1.6.0

This issue was fixed in the openstack/python-cinderclient 1.6.0 release.

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.