145 Commits

Author SHA1 Message Date
yatin karel
f47f973d9b Updated help on cinder reset-state cli
volumes also have 'in-use', 'attaching' and 'detaching' states.
These were missing in cinder help for reset-state cli. I have added
these in help.

Partial-Bug: #1309086

Change-Id: I094a61dd4921bed83e97134a4bfbcdc7d0c9ad63
2015-03-06 01:45:08 +05:30
Jenkins
7fc093b504 Merge "Adopt CLI sorting argument guidelines" 2015-03-02 19:55:44 +00:00
Jenkins
ae9dd86093 Merge "Make cinderclient metadata CLI output consistent" 2015-03-02 00:21:11 +00:00
Steven Kaufer
fc7ebb1621 Adopt CLI sorting argument guidelines
CLI sorting guidelines are defined in the cross project specs
repository: [1]

This patch deprecates --sort_key and --sort_dir and adds support for
--sort in the 'cinder list' command with the following syntax:

  cinder list --sort <key>[:<direction>]

The --sort parameter is comma-separated and is used to specify
one or more sort keys and directions.

Server-side work for sorting by multiple keys is handled in [2].

[1] https://github.com/openstack/openstack-specs/blob/master/specs/
    cli-sorting-args.rst
[2] https://review.openstack.org/#/c/141915/

Implements: blueprint cinder-pagination

Change-Id: Ie8c2c62b8c129f647f85d66d5bcfe4c8f0f4eedb
2015-02-25 18:51:43 +00:00
liyingjun
c01529fa53 Add missing all-tenants option to transfer-list
cinder transfer-list is missing the --all-tenants option, which makes
it inconsistent with 'cinder list'. Without this fix, when running as
admin horizon will need to make multiple queries to cinder (one for
each tenant present in the volume list) in order to display the transfers
that exist for the volumes being shown.

Change-Id: Ic4d72a54c450876ff24c64efd83678062c93a24e
Closes-bug: 1351084
2015-02-24 16:11:46 +08:00
Jenkins
9dcb38f5f2 Merge "Fix up help message for reset-state call" 2015-02-05 14:56:32 +00:00
Jenkins
6883bffca4 Merge "reset-state should warn that it is DB only" 2015-02-04 23:57:46 +00:00
scottda
ff3e5a4ed6 reset-state should warn that it is DB only
The python-cinderclient command 'reset-state' will only change the state in
the Cinder database, without affecting any connection/export of a volume from
the driver backend to a Nova compute host/instance.
The Doc string should explicitly state that this is the case, and Warn that it
might result in an unusable volume, i.e. a volume is set to 'available' in the
Cinder DB, but is still attached and therefore cannot be attached to another
instance, nor detached.

Change-Id: Iee66570dbb93776490ae8fb663a7f835dc496bc2
Closes-Bug: 1417273
2015-02-04 20:25:14 +00:00
Jenkins
2f1939405a Merge "Add support for os-volume-type-access extension" 2015-02-03 03:55:13 +00:00
John Griffith
e9e8aab2ec Fix up help message for reset-state call
There's some confusion about what the reset-state
call does.  It's not clear to some that this call
simply changes the state of the object in the data-base.

This patch just updates the help message to indicate more
clearly that reset-state ONLY changes state in the DB.

Change-Id: Ia389cfd8b1a821a356706201c009cf3c8dca8419
2015-01-28 13:36:20 -06:00
Jenkins
09bfc76c02 Merge "Allow CG quota to be showed and updated" 2015-01-16 18:34:50 +00:00
Jenkins
da16703e61 Merge "v2 error message grammatical error" 2015-01-16 18:33:06 +00:00
Thang Pham
fdba364b7d Make cinderclient metadata CLI output consistent
cinder metadata-update-all and metadata-show produces
inconsistent output. The following patch makes the output of each
command above consistent, where each metadata property will
be printed on a separate table row.

Change-Id: I42933bc6c0e4f925c19cfd4db6d1a205de06a73d
Closes-Bug: #1366289
2015-01-13 16:09:34 -05:00
Jenkins
fdf6fd1d67 Merge "Add command to show pool information for backends" 2015-01-13 08:38:06 +00:00
git-harry
3a97cb27d3 v2 error message grammatical error
This commit fixes an error that occurs in a number of places in the v2
shell; the word 'the' is missing from a number of the error message
strings.

Change-Id: I6d1026c965f84c9c39fcfd175b5d5cbbbad5ef5c
2015-01-08 12:21:33 +00:00
Mitsuhiro Tanino
1d38426680 Add command to show pool information for backends
An admin-api extension to show pool info was supported at commit
https://review.openstack.org/#/c/119938/.

This change adds a command to show pool information for backends
using the admin-api. This change also closes the gap for end users.

Partial-Bug: 1403902
Change-Id: I20e0828c5403b73bc44d07eebf08e2aa2deb428a
2015-01-05 16:04:43 -05:00
Steven Kaufer
b0e4cc1b63 Client output is not sorted by --sort_key
The cinder client supports invoking the volumes REST API with the
sort_dir and sort_key parameters. However, the client output table
is always sorted by ID even though the REST API is returning in
sorted order based on the sort key/direction provided.

For example, the command below supplies the 'size' sort key but the
output table is still sorted by ID:

cinder list --sort_key size --sort_dir desc

This fix contains:
* Updates to the print_list utility to prevent any re-ordering so
  that the current object order is maintained
* Updates to the shell to disable re-ordering if the user supplies
  sort parameters

Change-Id: I4cc111a8bdd2b89158dfc4bb0d16fa6dbf36cc57
Closes-Bug: 1402846
2014-12-22 02:23:00 +00:00
Mathieu Gagné
6f8c235a92 Add support for os-volume-type-access extension
This change adds the ability to manage volume type access:
- Create non-public volume type
- List volume type access
- Add a project access
- Remove a project access

This change also adds the is_public flag to volume type list.

Note: The volume type access extension is only implemented
in the Cinder API v2.

DocImpact: Add volume type access extension support
Implements: blueprint private-volume-types
Change-Id: Ife966120d9250be8d8149cdec9c1a53405d37027
2014-12-19 13:26:21 -05:00
Gloria Gu
bc2b8bf1be Added type description for volume type client
This patch added client handling and unit tests for volume type description:

* Added 2 client methods for volume type.
  default: to get the default volume type
  update: to upate an existing volume type to update description

* Added 2 new command-line operations.
  type-update (adminitrator only)
  type-default

* type-list should display description.

* type-create should have an option for entering the description.

The corresponding cinder APIs change volume-type-description:
https://review.openstack.org/#/c/131871/

Implements: blueprint volume-type-description
Change-Id: I2735d7050d90589d19f45e21096577febdcca8bb
2014-12-17 07:27:38 -08:00
Jenkins
9295913779 Merge "Add ability to create volume from image by image name" 2014-12-04 00:19:06 +00:00
Xing Yang
d9da860371 Allow CG quota to be showed and updated
This patch added the ability for CG quota to be showed and updated.
- Added consistencygroups as a quota resource to be displayed.
- Added an option for consistencygroups quota to be updated.

Change-Id: I7e88eb426eb1733bce955b7a15b8bffdb1e8ee20
Closes-Bug: #1373766
2014-12-03 16:39:23 -05:00
Duncan Thomas
4ccb70a90f Support Volume Backup Quota
Python-cinderclient support update volume backup quota.

Cinder server side commit for this feature was:
https://review.openstack.org/#/c/111460/

blueprint volume-backup-quota

Change-Id: I1fceeb9fc0eb92370e249c46749a61e4b11420b0
2014-11-30 19:37:10 +02:00
Sean McGinnis
616b982b7d Add ability to create volume from image by image name
Follow on change from cinder code to all specifying an
image by either its name or ID for creating a volume.

This patch adds the --image option that will take either
ID or name as input. The service then will attempt to
locate the image to use and make sure there are not
multiple images with the same name.

If both --image-id and --image are used it will favor
the more explicit ID.

DocImpact
Closes-Bug: 1377823

Change-Id: I77d58258144970fac47da6da6b7870f2931e1823
2014-11-25 12:39:17 -06:00
Jenkins
8428ffd099 Merge "Fix volume name support of unmanage and replication commands" 2014-10-14 20:31:35 +00:00
Mitsuhiro Tanino
20df1cb7a7 Fix volume name support of unmanage and replication commands
Volume not found error occurs when running these commands via cinderclient
with volume name as an argument.
unmanage, replication-promote, replication-reenable

However in their help text, it is described that Name and ID are supported.
Therefore, this patch fixes volume name support to their argument.

Closes-bug: #1374211
Change-Id: I8b90523d8e79a65eb27ff4e99820e8cb3feb3120
2014-10-02 15:24:01 -04:00
John Griffith
1cb1350d16 Simplify cinder manage command args
The 'cinder manage' command argumenst are kind of a disaster.
The positionals are <host> <id> where <id> is undefined/free form
K/V pairs.  On top of it we then have --source-name and --source-id
optional arguments available.  There absolutely no way to tell from
the help what one should be entering here without referring to the
code, and even then it's not quite clear how the options work and
which one will be used.

To clean this up, change the positionals to <host> <identifier>
where both are strings.  Remove --source-name and --source-id
and consolidate those options with --id-type.

id-type will allow a user to specify the type of identifier
(source-name, source-id, or whatever), but defaults to
source-name which is most commonly used currently.

* NOTE *
Ideally we'd just do away with the designator source-name/source-id
altogether and just have an <identifier> positional arg.  Each driver
would then be responsible for figuring out what was passed an how to
deal with it.  This however requires changes in all of the drivers and
broader changes on the Cinder side which I don't think are warranted
during RC.

During Kilo we should clean all of this up, but for now at least the
syntax is somewhat ready for human consumption and a bit easier than
what we introduced.

Change-Id: I07696648ae647f17ab9180cd87b25f8cb888f5d6
Closes-Bug: 1376311
2014-10-02 14:58:19 +00:00
Jenkins
26e19ff186 Merge "Docstring of unmanage subcommand is missing" 2014-10-01 15:24:48 +00:00
Jenkins
5922af5441 Merge "Ability to pass metadata during snapshot create" 2014-09-30 03:47:30 +00:00
Mitsuhiro Tanino
1dc808124b Docstring of unmanage subcommand is missing
cinder unmanage is missing docstring.
This patch adds description of unmanage to python-cinderclient.

Closes-Bug: #1373662
Change-Id: I3ae8ee714507b82c661360e86136dab5ef461ce3
2014-09-24 20:03:58 -04:00
Jenkins
d904b6509a Merge "Make <volume-types> required option for create cg" 2014-09-12 08:41:57 +00:00
Xing Yang
40f06b8be5 Make <volume-types> required option for create cg
Change-Id: I101ec89ab95cedd8b55247301c1c3b9cba2645c5
2014-09-10 13:58:46 -04:00
Jenkins
6f6d828795 Merge "Cinder Client for Consistency Groups" 2014-09-09 07:17:30 +00:00
Jenkins
42d13be346 Merge "Quotaset update does not return result" 2014-09-08 20:26:05 +00:00
Xing Yang
9fc64a52b1 Cinder Client for Consistency Groups
This patch implements CLI commands for the Consistency Groups
feature. Only snapshots for CGs will be implemented in phase 1.

Change-Id: I447555fd8a92bceecf6f40be59030d65461e4cbb
Implements: blueprint consistency-groups
2014-09-08 10:37:04 -04:00
Subhadeep De
4a7014a46e Ability to pass metadata during snapshot create
Metadata as a parameter is supported by the underlying cinder driver.
This is not exposed by the python client. It is helpful to store additional information
for snapshots and can be used for decision within cinder driver during snapshot creation.
Similar functionality exists for volume creation in cinder client and cinder driver.
Updating cli(shell) to accomodate the new metadata parameter
Adding above change for v2

Change-Id: I002221efea1b9994da4a8d200544a88b0ed26277
Closes-Bug: #1341424
2014-08-29 00:09:43 -07:00
Ronen Kat
953ac3ec6d Add client support in Cinder for volume replication
Provide Cinder client support to manage volume replication.
Cinder-specs available at https://review.openstack.org/#/c/98308/

Change-Id: Id60bacbcc113d42730e822b29b2fa78be94d3276
Implements: blueprint volume-replication
2014-08-27 06:38:50 +03:00
Jenkins
0c5f0a92b4 Merge "Avoid extra lookups in extra-specs-list" 2014-08-23 15:27:05 +00:00
JordanP
6565e275fd Avoid extra lookups in extra-specs-list
extra-specs-list used to use the extra-specs cinder extension
to get information on volume type extra specs. This information
is publicly available through the volume-type API [1] thus we
can avoid the extra-lookups of querying the extra-specs extension.

As the extra-spec info is publicly available, remove the part of
the docstring of cinder extra-specs-list that says 'admin only'.

[1] http://docs.openstack.org/api/openstack-block-storage/2.0/content/GET_getVolumeTypes__v2__tenant_id__types_Volume_Types.html

Change-Id: I9a8256a044511ac5233d8170fc57118ccaa1e217
Closes-Bug: 1343876
2014-08-05 11:28:09 +02:00
liyingjun
f7e9ece40b Support pagination for volume list
Since v2 api supports pagination, we should add this support in
cinderclient too.

Change-Id: I9d4cb9e192523c14cf7df043deabe156dbb8e216
Closes-bug: 1325773
2014-08-02 00:08:08 +08:00
Jenkins
88ee3b385c Merge "Fix the return code of the command reset-state" 2014-08-03 17:14:06 +00:00
Jenkins
172d0ea018 Merge "Add tenant uuid when running cinder list --all-tenants" 2014-07-30 19:01:34 +00:00
Juan Manuel Olle
02b32c8aed Quotaset update does not return result
This patch adds the updated quota values to the output shell

Closes-Bug: #1316474
Change-Id: I95bbefa5fdee316a3a3ba77a5b3067345da3344f
2014-07-29 17:56:07 +00:00
Zhengguang
bf8fa0b606 Fix the return code of the command reset-state
Currently, the command reset-state return code is zero if it
failed for any of volumes, it should be nonzero.

Change-Id: Ic6da238861fd003375003399bc6def6bf860a015
Closes-Bug: #1339643
2014-07-28 09:08:36 -04:00
Jenkins
ba826fbf3c Merge "Add commands for managing and unmanaging volumes" 2014-07-24 19:06:06 +00:00
Jenkins
15cbd66138 Merge "Optional size parameter for volume creation" 2014-07-24 16:01:34 +00:00
Geraint North
4d3b9bcea3 Add commands for managing and unmanaging volumes
Add manage and unmanage commands.

Cinder code: https://review.openstack.org/#/c/72501

See also adding support for "bootable" flag for volume manage,
and changing the LVM backend to use the source-volume-name key
as part of the existing-ref structure, to make the CLI easier
to use:
https://review.openstack.org/#/c/108488/

Implements: blueprint add-export-import-volumes

Change-Id: I27d0d3396d80063a51b0fe56d2d3c92931fa9c6c
2014-07-24 11:16:57 +01:00
Jenkins
0c4010e7fb Merge "Add set-bootable command" 2014-07-16 22:30:28 +00:00
Juan Manuel Olle
bd361644f7 Optional size parameter for volume creation
This patch makes optional the parameter size
for creating a volume from a snapshot or other
volume.
The parameter is still required for other
kind of volume creation.

Change-Id: I75dcf0e647f6e82a2407bcf23ef359f5f87323e8
Closes-Bug: #1304463
2014-07-08 17:51:15 -03:00
liyingjun
ae04b4b099 Add tenant uuid when running cinder list --all-tenants
Add the tenant uuid to the output when running cinder list --all-tenants,
since this is an admin command any way, it would help to list the tenant
UUID so we do not have to run cinder show to see the tenant uuid when we
have further queries to run.

Change-Id: I661789e957fa00947c4d5595f7e0515c27963735
Closes-bug: 1333257
2014-06-27 03:29:27 +08:00
Eric Harney
811af8f374 Remove "OPTIONAL:" from optional argument help text
All arguments starting with '--' are optional and listed
under the 'Optional arguments:' header by argparse.  Remove
the extra note shown for each argument.

Change-Id: Ic361a3bdbd1f1669458e16b99995f0f108400699
2014-05-22 15:43:31 -04:00