Bug 1293185
Summary: | [RFE][cinder] Delete volumes with associated snapshots | ||
---|---|---|---|
Product: | Red Hat OpenStack | Reporter: | Sean Cohen <scohen> |
Component: | openstack-cinder | Assignee: | Eric Harney <eharney> |
Status: | CLOSED ERRATA | QA Contact: | lkuchlan <lkuchlan> |
Severity: | low | Docs Contact: | |
Priority: | high | ||
Version: | 7.0 (Kilo) | CC: | ddomingo, dron, eharney, hazeez.basha, jschluet, lkuchlan, sclewis, scohen, srevivo |
Target Milestone: | ga | Keywords: | FutureFeature |
Target Release: | 9.0 (Mitaka) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | https://blueprints.launchpad.net/cinder/+spec/del-vols-with-snaps | ||
Whiteboard: | upstream_milestone_none upstream_definition_obsolete upstream_status_slow-progress | ||
Fixed In Version: | Doc Type: | Enhancement | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-08-11 12:13:52 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: | |||
Bug Depends On: | |||
Bug Blocks: | 1340960 |
Description
Sean Cohen
2015-12-21 01:45:38 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions *** Bug 982693 has been marked as a duplicate of this bug. *** The Cinder server side of this change is present in Mitaka. Tested using: openstack-cinder-8.0.0-4.el7ost.noarch Tested according to the following test-plan: https://polarion.engineering.redhat.com/polarion/#/project/RHELOpenStackPlatform/wiki/Cinder/RFE-1293185-Delete%20volumes%20with%20associated%20snapshots?sidebar=testrun&testrun=LVM%20driver%20-%20over%20subscription%20in%20thin%20provisioning_run_23_11_2015 Verification flow: Functional Tests: 1. Delete a Volume with Associated Snapshots [stack@undercloud ~]$ cinder list +--------------------------------------+-----------+------+------+-------------+----------+-------------+ | ID | Status | Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+-----------+------+------+-------------+----------+-------------+ | 8697148c-9eb1-489e-ac18-853d6ab11a30 | available | - | 1 | - | false | | +--------------------------------------+-----------+------+------+-------------+----------+-------------+ [stack@undercloud ~]$ cinder snapshot-list +--------------------------------------+--------------------------------------+-----------+------+------+ | ID | Volume ID | Status | Name | Size | +--------------------------------------+--------------------------------------+-----------+------+------+ | 56dcb0e8-33e8-42f3-b887-4621e8b2bc0f | 8697148c-9eb1-489e-ac18-853d6ab11a30 | available | - | 1 | +--------------------------------------+--------------------------------------+-----------+------+------+ [stack@undercloud ~]$ curl -g -i -X DELETE http://10.0.0.101:8776/v2/b2632e60a9a14330afffd912c90f3879/volumes/8697148c-9eb1-489e-ac18-853d6ab11a30?cascade=True -H "User-Agent: python-cinderclient" -H "Accept: application/json" -H "X-Auth-Token: e7f08ed251f845dbaa13684470f492b6" HTTP/1.1 202 Accepted Content-Type: text/html; charset=UTF-8 Content-Length: 0 X-Openstack-Request-Id: req-f1ec52dd-23e5-4012-872c-89eeb975aa82 Date: Sun, 26 Jun 2016 06:50:18 GMT [stack@undercloud ~]$ cinder list +--------------------------------------+----------+------+------+-------------+----------+-------------+ | ID | Status | Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+----------+------+------+-------------+----------+-------------+ | 8697148c-9eb1-489e-ac18-853d6ab11a30 | deleting | - | 1 | - | false | | +--------------------------------------+----------+------+------+-------------+----------+-------------+ [stack@undercloud ~]$ cinder list +----+--------+------+------+-------------+----------+-------------+ | ID | Status | Name | Size | Volume Type | Bootable | Attached to | +----+--------+------+------+-------------+----------+-------------+ +----+--------+------+------+-------------+----------+-------------+ [stack@undercloud ~]$ cinder snapshot-list +----+-----------+--------+------+------+ | ID | Volume ID | Status | Name | Size | +----+-----------+--------+------+------+ +----+-----------+--------+------+------+ 2. Delete a Volume with Associated Snapshots while there is an additional Volume from One of the Snapshots [stack@undercloud ~]$ cinder create 1 +--------------------------------+--------------------------------------+ | Property | Value | +--------------------------------+--------------------------------------+ | attachments | [] | | availability_zone | nova | | bootable | false | | consistencygroup_id | None | | created_at | 2016-06-26T06:56:03.000000 | | description | None | | encrypted | False | | id | a620ae1d-9565-400a-88ec-2e38e01fd8f4 | | metadata | {} | | migration_status | None | | multiattach | False | | name | None | | os-vol-host-attr:host | None | | os-vol-mig-status-attr:migstat | None | | os-vol-mig-status-attr:name_id | None | | os-vol-tenant-attr:tenant_id | b2632e60a9a14330afffd912c90f3879 | | replication_status | disabled | | size | 1 | | snapshot_id | None | | source_volid | None | | status | creating | | updated_at | None | | user_id | b11a0c0ba6b7473abb720cf0037cb2b7 | | volume_type | None | +--------------------------------+--------------------------------------+ [stack@undercloud ~]$ cinder snapshot-create a620ae1d-9565-400a-88ec-2e38e01fd8f4 +-------------+--------------------------------------+ | Property | Value | +-------------+--------------------------------------+ | created_at | 2016-06-26T06:56:30.090427 | | description | None | | id | ebdb00c9-ed5d-4ced-9a7a-7fb6a6a918fc | | metadata | {} | | name | None | | size | 1 | | status | creating | | updated_at | None | | volume_id | a620ae1d-9565-400a-88ec-2e38e01fd8f4 | +-------------+--------------------------------------+ [stack@undercloud ~]$ cinder snapshot-create a620ae1d-9565-400a-88ec-2e38e01fd8f4 +-------------+--------------------------------------+ | Property | Value | +-------------+--------------------------------------+ | created_at | 2016-06-26T06:56:35.957234 | | description | None | | id | f3806607-b3dc-49c9-b23f-f1fb2d3d004f | | metadata | {} | | name | None | | size | 1 | | status | creating | | updated_at | None | | volume_id | a620ae1d-9565-400a-88ec-2e38e01fd8f4 | +-------------+--------------------------------------+ [stack@undercloud ~]$ cinder snapshot-list +--------------------------------------+--------------------------------------+-----------+------+------+ | ID | Volume ID | Status | Name | Size | +--------------------------------------+--------------------------------------+-----------+------+------+ | ebdb00c9-ed5d-4ced-9a7a-7fb6a6a918fc | a620ae1d-9565-400a-88ec-2e38e01fd8f4 | available | - | 1 | | f3806607-b3dc-49c9-b23f-f1fb2d3d004f | a620ae1d-9565-400a-88ec-2e38e01fd8f4 | available | - | 1 | +--------------------------------------+--------------------------------------+-----------+------+------+ [stack@undercloud ~]$ cinder create --snapshot-id ebdb00c9-ed5d-4ced-9a7a-7fb6a6a918fc +--------------------------------+---------------------------------------+ | Property | Value | +--------------------------------+---------------------------------------+ | attachments | [] | | availability_zone | nova | | bootable | false | | consistencygroup_id | None | | created_at | 2016-06-26T06:57:42.000000 | | description | None | | encrypted | False | | id | 2d399a22-8f61-4dab-b49c-63edb63be7d9 | | metadata | {} | | migration_status | None | | multiattach | False | | name | None | | os-vol-host-attr:host | hostgroup@tripleo_iscsi#tripleo_iscsi | | os-vol-mig-status-attr:migstat | None | | os-vol-mig-status-attr:name_id | None | | os-vol-tenant-attr:tenant_id | b2632e60a9a14330afffd912c90f3879 | | replication_status | disabled | | size | 1 | | snapshot_id | ebdb00c9-ed5d-4ced-9a7a-7fb6a6a918fc | | source_volid | None | | status | creating | | updated_at | 2016-06-26T06:57:43.000000 | | user_id | b11a0c0ba6b7473abb720cf0037cb2b7 | | volume_type | None | +--------------------------------+---------------------------------------+ [stack@undercloud ~]$ cinder list +--------------------------------------+-----------+------+------+-------------+----------+-------------+ | ID | Status | Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+-----------+------+------+-------------+----------+-------------+ | 2d399a22-8f61-4dab-b49c-63edb63be7d9 | creating | - | 1 | - | false | | | a620ae1d-9565-400a-88ec-2e38e01fd8f4 | available | - | 1 | - | false | | +--------------------------------------+-----------+------+------+-------------+----------+-------------+ [stack@undercloud ~]$ cinder list +--------------------------------------+-----------+------+------+-------------+----------+-------------+ | ID | Status | Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+-----------+------+------+-------------+----------+-------------+ | 2d399a22-8f61-4dab-b49c-63edb63be7d9 | available | - | 1 | - | false | | | a620ae1d-9565-400a-88ec-2e38e01fd8f4 | available | - | 1 | - | false | | +--------------------------------------+-----------+------+------+-------------+----------+-------------+ [stack@undercloud ~]$ curl -g -i -X DELETE http://10.0.0.101:8776/v2/b2632e60a9a14330afffd912c90f3879/volumes/a620ae1d-9565-400a-88ec-2e38e01fd8f4?cascade=True -H "User-Agent: python-cinderclient" -H "Accept: application/json" -H "X-Auth-Token: 1941b85d6e4f47ffbf19c88babd187b9" HTTP/1.1 202 Accepted Content-Type: text/html; charset=UTF-8 Content-Length: 0 X-Openstack-Request-Id: req-3a7e7432-e876-482d-a3b0-3af12a9fdda3 Date: Sun, 26 Jun 2016 06:59:30 GMT [stack@undercloud ~]$ cinder list +--------------------------------------+-----------+------+------+-------------+----------+-------------+ | ID | Status | Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+-----------+------+------+-------------+----------+-------------+ | 2d399a22-8f61-4dab-b49c-63edb63be7d9 | available | - | 1 | - | false | | | a620ae1d-9565-400a-88ec-2e38e01fd8f4 | deleting | - | 1 | - | false | | +--------------------------------------+-----------+------+------+-------------+----------+-------------+ [stack@undercloud ~]$ cinder snapshot-list +----+-----------+--------+------+------+ | ID | Volume ID | Status | Name | Size | +----+-----------+--------+------+------+ +----+-----------+--------+------+------+ [stack@undercloud ~]$ cinder list +--------------------------------------+-----------+------+------+-------------+----------+-------------+ | ID | Status | Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+-----------+------+------+-------------+----------+-------------+ | 2d399a22-8f61-4dab-b49c-63edb63be7d9 | available | - | 1 | - | false | | +--------------------------------------+-----------+------+------+-------------+----------+-------------+ 3. Force Delete with Cascade when Volume Status is not "available" [stack@undercloud ~]$ cinder list +--------------------------------------+----------------+------+------+-------------+----------+-------------+ | ID | Status | Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+----------------+------+------+-------------+----------+-------------+ | 267e2d7c-aa07-4c94-91f3-a3aa67a3207a | error_deleting | - | 1 | - | false | | +--------------------------------------+----------------+------+------+-------------+----------+-------------+ [stack@undercloud ~]$ curl -g -i -X POST http://10.0.0.101:8776/v2/b2632e60a9a14330afffd912c90f3879/volumes/267e2d7c-aa07-4c94-91f3-a3aa67a3207a/action?cascade=True -H "User-Agent: python-cinderclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: d7da95b69d4a483caa4ec913527af98a" -d '{"os-force_delete": null}' HTTP/1.1 202 Accepted Content-Type: text/html; charset=UTF-8 Content-Length: 0 X-Openstack-Request-Id: req-78dafd0c-a519-4a7d-97d7-e33a4faf9e55 Date: Sun, 26 Jun 2016 07:12:23 GMT [stack@undercloud ~]$ cinder list +----+--------+------+------+-------------+----------+-------------+ | ID | Status | Name | Size | Volume Type | Bootable | Attached to | +----+--------+------+------+-------------+----------+-------------+ +----+--------+------+------+-------------+----------+-------------+ Negative Tests: 4. Delete an Attached Volume with Associated Snapshots [stack@undercloud ~]$ cinder create 1 +--------------------------------+--------------------------------------+ | Property | Value | +--------------------------------+--------------------------------------+ | attachments | [] | | availability_zone | nova | | bootable | false | | consistencygroup_id | None | | created_at | 2016-06-26T07:14:09.000000 | | description | None | | encrypted | False | | id | 1442afb2-c71d-4065-93f9-c0e5d1b51002 | | metadata | {} | | migration_status | None | | multiattach | False | | name | None | | os-vol-host-attr:host | None | | os-vol-mig-status-attr:migstat | None | | os-vol-mig-status-attr:name_id | None | | os-vol-tenant-attr:tenant_id | b2632e60a9a14330afffd912c90f3879 | | replication_status | disabled | | size | 1 | | snapshot_id | None | | source_volid | None | | status | creating | | updated_at | None | | user_id | b11a0c0ba6b7473abb720cf0037cb2b7 | | volume_type | None | +--------------------------------+--------------------------------------+ [stack@undercloud ~]$ cinder reset-state 1442afb2-c71d-4065-93f9-c0e5d1b51002 --state "in-use" [stack@undercloud ~]$ cinder list +--------------------------------------+--------+------+------+-------------+----------+-------------+ | ID | Status | Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+--------+------+------+-------------+----------+-------------+ | 1442afb2-c71d-4065-93f9-c0e5d1b51002 | in-use | - | 1 | - | false | | +--------------------------------------+--------+------+------+-------------+----------+-------------+ [stack@undercloud ~]$ cinder reset-state 1442afb2-c71d-4065-93f9-c0e5d1b51002 --state "available" [stack@undercloud ~]$ cinder snapshot-create 1442afb2-c71d-4065-93f9-c0e5d1b51002 +-------------+--------------------------------------+ | Property | Value | +-------------+--------------------------------------+ | created_at | 2016-06-26T07:16:07.556240 | | description | None | | id | a137d8cd-ae4e-4e66-87b2-2d5509f068a7 | | metadata | {} | | name | None | | size | 1 | | status | creating | | updated_at | None | | volume_id | 1442afb2-c71d-4065-93f9-c0e5d1b51002 | +-------------+--------------------------------------+ [stack@undercloud ~]$ cinder reset-state 1442afb2-c71d-4065-93f9-c0e5d1b51002 --state "in-use" [stack@undercloud ~]$ cinder list +--------------------------------------+--------+------+------+-------------+----------+-------------+ | ID | Status | Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+--------+------+------+-------------+----------+-------------+ | 1442afb2-c71d-4065-93f9-c0e5d1b51002 | in-use | - | 1 | - | false | | +--------------------------------------+--------+------+------+-------------+----------+-------------+ [stack@undercloud ~]$ cinder snapshot-list +--------------------------------------+--------------------------------------+-----------+------+------+ | ID | Volume ID | Status | Name | Size | +--------------------------------------+--------------------------------------+-----------+------+------+ | a137d8cd-ae4e-4e66-87b2-2d5509f068a7 | 1442afb2-c71d-4065-93f9-c0e5d1b51002 | available | - | 1 | +--------------------------------------+--------------------------------------+-----------+------+------+ [stack@undercloud ~]$ curl -g -i -X DELETE http://10.0.0.101:8776/v2/b2632e60a9a14330afffd912c90f3879/volumes/1442afb2-c71d-4065-93f9-c0e5d1b51002?cascade=True -H "User-Agent: python-cinderclient" -H "Accept: application/json" -H "X-Auth-Token: 6c8339fc38a846e8b9cf4baca34ed21d" HTTP/1.1 400 Bad Request Openstack-Api-Version: 2.0 Vary: OpenStack-API-Version Content-Length: 224 Content-Type: application/json; charset=UTF-8 X-Compute-Request-Id: req-67fc8590-c86d-4e9f-bda2-155945f0f629 X-Openstack-Request-Id: req-67fc8590-c86d-4e9f-bda2-155945f0f629 Date: Sun, 26 Jun 2016 07:18:12 GMT {"badRequest": {"message": "Invalid volume: Volume status must be available or error or error_restoring or error_extending and must not be migrating, attached, belong to a consistency group or have snapshots.", "code": 400}}[stack@undercloud ~]$ 5. Delete a Volume when One of the Snapshots is Not "available" or "error" [stack@undercloud ~]$ cinder list cinder snapshot-+--------------------------------------+-----------+------+------+-------------+----------+-------------+ | ID | Status | Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+-----------+------+------+-------------+----------+-------------+ | 826a4768-0765-4081-816e-ba49ea31fa52 | available | - | 1 | - | false | | +--------------------------------------+-----------+------+------+-------------+----------+-------------+ li[stack@undercloud ~]$ cinder snapshot-list +--------------------------------------+--------------------------------------+-----------+------+------+ | ID | Volume ID | Status | Name | Size | +--------------------------------------+--------------------------------------+-----------+------+------+ | 72e45977-86b9-4946-9092-9202d271e9ce | 826a4768-0765-4081-816e-ba49ea31fa52 | available | - | 1 | | baf682f6-21c1-44c9-b980-ca9a27a0c160 | 826a4768-0765-4081-816e-ba49ea31fa52 | available | - | 1 | +--------------------------------------+--------------------------------------+-----------+------+------+ [stack@undercloud ~]$ cinder snapshot-reset-state baf682f6-21c1-44c9-b980-ca9a27a0c160 --state "error_deleting" [stack@undercloud ~]$ cinder snapshot-list +--------------------------------------+--------------------------------------+----------------+------+------+ | ID | Volume ID | Status | Name | Size | +--------------------------------------+--------------------------------------+----------------+------+------+ | 72e45977-86b9-4946-9092-9202d271e9ce | 826a4768-0765-4081-816e-ba49ea31fa52 | available | - | 1 | | baf682f6-21c1-44c9-b980-ca9a27a0c160 | 826a4768-0765-4081-816e-ba49ea31fa52 | error_deleting | - | 1 | +--------------------------------------+--------------------------------------+----------------+------+------+ [stack@undercloud ~]$ curl -g -i -X DELETE http://10.0.0.101:8776/v2/b2632e60a9a14330afffd912c90f3879/volumes/826a4768-0765-4081-816e-ba49ea31fa52?cascade=True -H "User-Agent: python-cinderclient" -H "Accept: application/json" -H "X-Auth-Token: 67b12c8a8c024fc295ea59c27dfdb4c5" HTTP/1.1 400 Bad Request Openstack-Api-Version: 2.0 Vary: OpenStack-API-Version Content-Length: 224 Content-Type: application/json; charset=UTF-8 X-Compute-Request-Id: req-0d3067db-21b2-4d53-95c6-ca536d585f2e X-Openstack-Request-Id: req-0d3067db-21b2-4d53-95c6-ca536d585f2e Date: Sun, 26 Jun 2016 07:23:02 GMT {"badRequest": {"message": "Invalid volume: Volume status must be available or error or error_restoring or error_extending and must not be migrating, attached, belong to a consistency group or have snapshots.", "code": 400}}[stack@undercloud ~]$ cinder list Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHEA-2016-1597.html Please use below command when you are getting error Failed to delete volume with name or ID '6b9fb6de-1c3a-44f3-9725-fde706d89363': Invalid volume: Volume must not be migrating, attached, belong to a consistency group or have snapshots. (HTTP 400) (Request-ID: req-45b6972f-083a-40a0-81ee-fb3acda02675) 1 of 1 volumes failed to delete. openstack volume delete --purge <volume-id> The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days |