Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'cinder delete' should have an option to specify ID or NAME unambiguous otherwise wrong volume might be deleted if its ID is same with some other volume's NAME. #3

Open
shan-wan opened this issue Nov 24, 2015 · 0 comments

Comments

@shan-wan
Copy link
Collaborator

Description:

Currently 'cinder' command does not have any option associated with 'delete'.

$ cinder help delete
usage: cinder delete <volume> [<volume> ...]

Removes one or more volumes.

Positional arguments:
  <volume>  Name or ID of volume or volumes to delete.

It takes arguments as volume ID or volume NAME. This is OK for most cases.
But what if there're 2 such volumes, say: volume A has ID '1234' and volume B has NAME '1234' and 'cinder delete 1234' will delete volume A even if the user intends to delete volume B. This is ambiguous and 'cinder delete' should give an warning at least. It's better for 'cinder delete' to accept an option to specify '--id' or '--name'.

Project:

Openstack

Project Area:

Openstack cinder

Release:

Openstack Liberty

Severity:

S1

Full Details:

Test Environment and PreCondtion:

Devstack deployed Openstack environment

Detailed Test Steps:

the first volume's ID is same as the third volume's name

[root@scaleiovm1 cinder]# cinder list
+--------------------------------------+-----------+--------------------------------------+------+-------------+----------+-------------+-------------+
|                  ID                  |   Status  |                 Name                 | Size | Volume Type | Bootable | Multiattach | Attached to |
+--------------------------------------+-----------+--------------------------------------+------+-------------+----------+-------------+-------------+
| 8c09d88f-8db2-4bc6-a8d8-a380264fd237 | available |                 123                  |  1   |   scaleio   |  false   |    False    |             |
| c25e8627-e7fd-4293-b39f-e506ab6915e8 | available |               dzhpeng2               |  1   |   scaleio   |  false   |    False    |             |
| f906cad1-768e-4a1d-aa21-19c5c283661d | available | 8c09d88f-8db2-4bc6-a8d8-a380264fd237 |  1   |   scaleio   |  false   |    False    |             |
+--------------------------------------+-----------+--------------------------------------+------+-------------+----------+-------------+-------------+

User wants to use 'cinder delete '

[root@scaleiovm1 cinder]# cinder delete dzhpeng2 8c09d88f-8db2-4bc6-a8d8-a380264fd237  ---> both are volume Name
Request to delete volume dzhpeng2 has been accepted.
Request to delete volume 8c09d88f-8db2-4bc6-a8d8-a380264fd237 has been accepted.

[root@scaleiovm1 cinder]# cinder list ---> the first volume and second volume deleted, here should warning or use --id --name way should be better
+--------------------------------------+-----------+--------------------------------------+------+-------------+----------+-------------+-------------+
|                  ID                  |   Status  |                 Name                 | Size | Volume Type | Bootable | Multiattach | Attached to |
+--------------------------------------+-----------+--------------------------------------+------+-------------+----------+-------------+-------------+
| f906cad1-768e-4a1d-aa21-19c5c283661d | available | 8c09d88f-8db2-4bc6-a8d8-a380264fd237 |  1   |   scaleio   |  false   |    False    |             |
+--------------------------------------+-----------+--------------------------------------+------+-------------+----------+-------------+-------------+

Expected Results:

test step pass

Actual results:

test step fail

Problem details:

Support Materials:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant