please add view for snapshot dependency to cinder list
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| python-cinderclient |
Opinion
|
Undecided
|
Unassigned | ||
Bug Description
If 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.
[root@cougar06 ~(keystone_admin)]# cinder delete 128681f1-
ERROR: Invalid volume: Volume still has 1 dependent snapshots (HTTP 400) (Request-ID: req-a857bbcf-
[root@cougar06 ~(keystone_admin)]#
[<email address hidden> ~(keystone_admin)]# cinder list
+------
| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to |
+------
| 128681f1-
| 188d5e9f-
| 292e6a93-
| 49088941-
| 4ee66206-
| 684bdfe8-
| 79f6dbb3-
| 7e3df44e-
| 82045366-
| 928dc8d9-
| a142d020-
| b9e99855-
| bd2c6980-
| cc5405cb-
| df17e52b-
| e2fc5cc7-
+------
[<email address hidden> ~(keystone_admin)]# cinder show 128681f1-
+------
| Property | Value |
+------
| attachments | [] |
| availability_zone | nova |
| bootable | true |
| created_at | 2013-11-
| display_description | |
| display_name | vol1 |
| id | 128681f1-
| metadata | {u'readonly': u'False'} |
| os-vol-
| os-vol-
| os-vol-
| os-vol-
| size | 12 |
| snapshot_id | None |
| source_volid | None |
| status | available |
| volume_
| volume_type | None |
+------
[<email address hidden> ~(keystone_admin)]# cinder help show
usage: cinder show <volume>
Show details about a volume.
Positional arguments:
<volume> Name or ID of the volume.

I think the snapshot to volume association can be found by using snapshot-list | grep "volume-id" which I think makes sense rather than adding additional field in cinder-list.
e.g.
$ cinder list ------- ------- ------- ------- ----+-- ------- --+---- --+---- --+---- ------- --+---- ------+ ------- ------+ ------- ------- ------- ------- ----+-- ------- --+---- --+---- --+---- ------- --+---- ------+ ------- ------+ e6a0-4a2f- 9888-0a2903c699 61 | available | None | 1 | None | false | | ------- ------- ------- ------- ----+-- ------- --+---- --+---- --+---- ------- --+---- ------+ ------- ------+
+------
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+------
| 7aa56d35-
+------
$ cinder snapshot-list ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------+ ------+ ------+ ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------+ ------+ ------+ a94f-4fb5- 80d0-863bde9d44 45 | 7aa56d35- e6a0-4a2f- 9888-0a2903c699 61 | available | None | 1 | 3f59-4263- 832b-4a8b68d1f5 4f | 7aa56d35- e6a0-4a2f- 9888-0a2903c699 61 | available | None | 1 | ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------+ ------+ ------+
+------
| ID | Volume ID | Status | Name | Size |
+------
| 16df4fd6-
| ade18398-
+------
$ cinder snapshot-list | grep "7aa56d35- e6a0-4a2f- 9888-0a2903c699 61" a94f-4fb5- 80d0-863bde9d44 45 | 7aa56d35- e6a0-4a2f- 9888-0a2903c699 61 | available | None | 1 | 3f59-4263- 832b-4a8b68d1f5 4f | 7aa56d35- e6a0-4a2f- 9888-0a2903c699 61 | available | None | 1 |
| 16df4fd6-
| ade18398-