Bug 1034233

Summary: cinder cli: add snapshots information to cinder list/show
Product: Red Hat OpenStack Reporter: Dafna Ron <dron>
Component: python-cinderclientAssignee: RHOS Maint <rhos-maint>
Status: CLOSED UPSTREAM QA Contact: Giulio Fidente <gfidente>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.0CC: eharney, hateya, jruzicka, yeylon
Target Milestone: ---   
Target Release: 4.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: storage
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-25 15:10:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dafna Ron 2013-11-25 13:19:31 UTC
Description of problem:

f we try to delete volumes and it has a snapshot we would fail on dependency.
I think being able to see in list which volume has a snapshot and than using show to see which snapshots are linked to it would be helpful.

Version-Release number of selected component (if applicable):

python-cinderclient-1.0.6-2.el6ost.noarch

How reproducible:

100%

Steps to Reproduce:
1. create a snapshot and a snapshot for the volume: 
cinder create <size> --display-name <name> 
cinder snapshot-create <vol>  --display-name <display-name>
2. try to delete volume: 
cinder delete <volume> 
3. run: cinder list and cinder show <vol>; run cinder help list and cinder help show

Actual results:

There is no way to know which volume has a snapshot depending on it by running cinder list/cinder show

Expected results:

we should be able to see what volumes have a snapshot and what is the snapshot ID by running show

Additional info:


[root@cougar06 ~(keystone_admin)]# cinder delete 128681f1-8af2-44fc-bcd6-e3075687f67a
ERROR: Invalid volume: Volume still has 1 dependent snapshots (HTTP 400) (Request-ID: req-a857bbcf-b754-4d85-8343-c3435ecaf1f3)
[root@cougar06 ~(keystone_admin)]#

[root ~(keystone_admin)]# cinder list
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| 128681f1-8af2-44fc-bcd6-e3075687f67a | available | vol1 | 12 | None | true | |
| 188d5e9f-7bb3-4e4a-95e9-6ba964f5a52a | available | new8 | 10 | None | false | |
| 292e6a93-922f-4370-806a-33fbf1ef48c7 | available | vol5 | 9 | None | false | |
| 49088941-73f8-48a4-a906-dc7bf024f0ea | available | new3 | 10 | None | true | |
| 4ee66206-1ce4-442c-8dfb-d7f2d50d32f1 | available | upload1 | 10 | None | false | |
| 684bdfe8-1f73-405b-ad71-d8c2b67af8de | available | upload | 10 | None | false | |
| 79f6dbb3-4897-427e-9ad6-7acc21e1d12b | available | baba1 | 10 | None | true | |
| 7e3df44e-14e1-4a92-b612-b0dd7731a4e2 | available | new4 | 10 | None | true | |
| 82045366-538e-41d5-8a7f-632e0c8e3550 | available | new2 | 10 | None | true | |
| 928dc8d9-9658-4df0-93a1-20a1bd245f4f | available | new7 | 10 | None | false | |
| a142d020-1fec-4b39-967c-c171696920a5 | available | vol7 | 10 | None | true | |
| b9e99855-dd4a-4268-a342-90312ff2adf8 | available | new5 | 10 | None | true | |
| bd2c6980-1f9b-4271-9675-0fcae037744f | available | new1 | 10 | None | true | |
| cc5405cb-5024-4215-ab2b-be80aa7f1ccf | available | baba2 | 10 | None | true | |
| df17e52b-c153-4d51-b4a0-9e53b8b02745 | available | baba | 10 | None | true | |
| e2fc5cc7-dca4-4470-a995-7ad92f85d283 | available | baba3 | 10 | None | true | |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+

[root ~(keystone_admin)]# cinder show 128681f1-8af2-44fc-bcd6-e3075687f67a
+--------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property | Value |
+--------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | true |
| created_at | 2013-11-21T13:13:28.000000 |
| display_description | |
| display_name | vol1 |
| id | 128681f1-8af2-44fc-bcd6-e3075687f67a |
| metadata | {u'readonly': u'False'} |
| os-vol-host-attr:host | xxx.xxx.lab.tlv.redhat.com |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | 7eb59aa89e8944d098554ff6f5a4cf88 |
| size | 12 |
| snapshot_id | None |
| source_volid | None |
| status | available |
| volume_image_metadata | {u'container_format': u'bare', u'min_ram': u'0', u'disk_format': u'qcow2', u'image_name': u'rhel1', u'image_id': u'8ee09587-67bb-4e79-91fc-7c816f9957b3', u'checksum': u'e793566cf8aa170db033e37467334ecd', u'min_disk': u'0', u'size': u'699592704'} |
| volume_type | None |
+--------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
[root ~(keystone_admin)]# cinder help show
usage: cinder show <volume>

Show details about a volume.

Positional arguments:
  <volume> Name or ID of the volume.

Comment 1 Jakub Ruzicka 2013-11-25 15:10:24 UTC
Thanks for reporting this RFE upstream.

Once implemented, it will be included in next RHOS client version. I see no reason to track this downstream.