cinder create with name = 'None' and without name is ambiguous

Bug #1422244 reported by yatin
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-cinderclient
Fix Released
Undecided
yatin

Bug Description

The steps to reproduce the bug:

1) necadmin@otcpcontroller-PowerEdge-2950:~$ cinder create 1
+---------------------+--------------------------------------+
| Property | Value |
+---------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| created_at | 2015-02-16T04:32:06.680833 |
| display_description | None |
| display_name | None |
| encrypted | False |
| id | 4fe8bc26-529a-4f83-82f9-8f74c24f71c0 |
| metadata | {} |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| volume_type | None |
+---------------------+--------------------------------------+

2) necadmin@otcpcontroller-PowerEdge-2950:~$ cinder create 1 --display-name None
+---------------------+--------------------------------------+
| Property | Value |
+---------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| created_at | 2015-02-16T04:34:43.843513 |
| display_description | None |
| display_name | None |
| encrypted | False |
| id | 87d8d9b0-b1f0-41e3-8b6c-8fe6c3a3c50f |
| metadata | {} |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| volume_type | None |
+---------------------+--------------------------------------+

3)necadmin@otcpcontroller-PowerEdge-2950:~$ cinder list
+--------------------------------------+-----------+----------------+------+-------------+----------+-------------+
| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+----------------+------+-------------+----------+-------------+
| 39151370-ce3f-4447-b7c1-f77631767b6c | available | window8_X86_64 | 25 | None | true | |
| 4fe8bc26-529a-4f83-82f9-8f74c24f71c0 | available | None | 1 | None | false | |
| 6f03502d-a37f-4fed-b720-3a8c112e4be8 | available | win7-X86_64 | 25 | None | true | |
| 87d8d9b0-b1f0-41e3-8b6c-8fe6c3a3c50f | available | None | 1 | None | false | |
| aad047de-a936-45c3-a060-addfb1c112c8 | available | centos7 | 20 | None | true | |
+--------------------------------------+-----------+----------------+------+-------------+----------+-------------+

We can not descriminate here that the volume has a name None or no name is assigned to it. For Ex:

4) necadmin@otcpcontroller-PowerEdge-2950:~$ cinder delete None
one volume to which we assigned the name 'None' gets deleted.

5)necadmin@otcpcontroller-PowerEdge-2950:~$ cinder list
+--------------------------------------+-----------+----------------+------+-------------+----------+-------------+
| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+----------------+------+-------------+----------+-------------+
| 39151370-ce3f-4447-b7c1-f77631767b6c | available | window8_X86_64 | 25 | None | true | |
| 4fe8bc26-529a-4f83-82f9-8f74c24f71c0 | available | None | 1 | None | false | |
| 6f03502d-a37f-4fed-b720-3a8c112e4be8 | available | win7-X86_64 | 25 | None | true | |
| aad047de-a936-45c3-a060-addfb1c112c8 | available | centos7 | 20 | None | true | |
+--------------------------------------+-----------+----------------+------+-------------+----------+-------------+
6) cinder delete None
Delete for volume None failed: No volume with a name or ID of 'None' exists.
ERROR: Unable to delete any of the specified volumes.

I have also verified the bug with --os-volume-api-version 2.
I think it should not be allowed to create a volume with Name = 'None' and message should be displayed as: 'None' is a reserved word.

Changed in python-cinderclient:
assignee: nobody → Yamini Sardana (yamini-sardana)
Revision history for this message
Yamini Sardana (yamini-sardana) wrote :

Other components like Nova, Neutron, Glance etc also allows the Name to be used as None.

In this case, when we are not giving any Name to the volume, the display of volume details should show a blank instead of None. So, this in my opinion in a display issue.

Changed in python-cinderclient:
status: New → In Progress
Changed in python-cinderclient:
assignee: Yamini Sardana (yamini-sardana) → Kanchan Gupta (kanchan-gupta1)
Revision history for this message
Kanchan Gupta (kanchan-gupta1) wrote :

Patch has been submitted for this bug.
Review link: https://review.openstack.org/#/c/157714/

Revision history for this message
yatin (yatinkarel) wrote :

Hi Kanchan

You took the bug wrongly. Are you still working on this. If not, i would like to fix this bug. Please reply.

Thanks

Revision history for this message
Kanchan Gupta (kanchan-gupta1) wrote :

Hi Yatin,

Based on the review comments on the patch I am working on it again. Almost the changes are done and will be submitting the patch soon for cinderclient.

Thanks.

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

Changed in python-cinderclient:
assignee: Kanchan Gupta (kanchan-gupta1) → yatin (yatinkarel)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-cinderclient (master)

Reviewed: https://review.openstack.org/159814
Committed: https://git.openstack.org/cgit/openstack/python-cinderclient/commit/?id=0f73c5fb8ab593da7e332ade273e7da31ea8e303
Submitter: Jenkins
Branch: master

commit 0f73c5fb8ab593da7e332ade273e7da31ea8e303
Author: yatin karel <email address hidden>
Date: Mon Mar 16 23:26:12 2015 +0530

    cinder list now prints dash '-' when data is None

    cinder list used to print None when volume was created without name.
    Now it prints '-' dash when display_name is None

    Closes-Bug: #1422244
    Change-Id: I195ccc37fe96dbb54a0460527fabf55146170bc7

Changed in python-cinderclient:
status: In Progress → Fix Committed
Changed in python-cinderclient:
milestone: none → 1.3.1
status: Fix Committed → Fix Released
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.