Bug 1969440

Summary: volume snapshot deletion should fail with an error if it has a volume created from it.
Product: Red Hat OpenStack Reporter: vivek koul <vkoul>
Component: openstack-cinderAssignee: Cinder Bugs List <cinder-bugs>
Status: CLOSED DUPLICATE QA Contact: Tzach Shefi <tshefi>
Severity: medium Docs Contact: Chuck Copello <ccopello>
Priority: medium    
Version: 16.1 (Train)CC: abishop, ltoscano
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-08 13:37:09 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 vivek koul 2021-06-08 13:06:47 UTC
Description of problem:

Snapshot deletion should fail with an error. Please check the below commands:

~~~
openstack volume list
+--------------------------------------+------------------+-----------+------+-------------+
| ID                                   | Name             | Status    | Size | Attached to |
+--------------------------------------+------------------+-----------+------+-------------+
| 403e117d-0d57-4062-aba9-17d19a16668b | test             | available |    1 |             |
+--------------------------------------+------------------+-----------+------+-------------+

openstack volume snapshot create --volume test test-snap
+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| created_at  | 2021-06-08T12:56:56.911444           |
| description | None                                 |
| id          | e236b062-5cac-40f1-a5b7-45c40b3467d9 |
| name        | test-snap                            |
| properties  |                                      |
| size        | 1                                    |
| status      | creating                             |
| updated_at  | None                                 |
| volume_id   | 403e117d-0d57-4062-aba9-17d19a16668b |
+-------------+--------------------------------------+

openstack volume snapshot list
+--------------------------------------+-----------+-------------+-----------+------+
| ID                                   | Name      | Description | Status    | Size |
+--------------------------------------+-----------+-------------+-----------+------+
| e236b062-5cac-40f1-a5b7-45c40b3467d9 | test-snap | None        | available |    1 |
+--------------------------------------+-----------+-------------+-----------+------+

openstack volume create --snapshot test-snap test-snap-vol
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| attachments         | []                                   |
| availability_zone   | nova                                 |
| bootable            | false                                |
| consistencygroup_id | None                                 |
| created_at          | 2021-06-08T12:57:40.000000           |
| description         | None                                 |
| encrypted           | False                                |
| id                  | 28c03a36-b281-46ce-b29e-497519e799b5 |
| migration_status    | None                                 |
| multiattach         | False                                |
| name                | test-snap-vol                        |
| properties          |                                      |
| replication_status  | None                                 |
| size                | 1                                    |
| snapshot_id         | e236b062-5cac-40f1-a5b7-45c40b3467d9 |
| source_volid        | None                                 |
| status              | creating                             |
| type                | tripleo                              |
| updated_at          | None                                 |
| user_id             | 92452da4acce4c49b3011ec1ad71d544     |
+---------------------+--------------------------------------+

openstack volume list
+--------------------------------------+------------------+-----------+------+-------------+
| ID                                   | Name             | Status    | Size | Attached to |
+--------------------------------------+------------------+-----------+------+-------------+
| 28c03a36-b281-46ce-b29e-497519e799b5 | test-snap-vol    | available |    1 |             |
| 403e117d-0d57-4062-aba9-17d19a16668b | test             | available |    1 |             |
+--------------------------------------+------------------+-----------+------+-------------+
openstack volume snapshot delete test-snap
openstack volume snapshot list
+--------------------------------------+-----------+-------------+-----------+------+
| ID                                   | Name      | Description | Status    | Size |
+--------------------------------------+-----------+-------------+-----------+------+
| e236b062-5cac-40f1-a5b7-45c40b3467d9 | test-snap | None        | available |    1 |
| 957073a7-bfdb-4ba6-ae27-379dfd3ff6a0 | test      | None        | available |    1 |
+--------------------------------------+-----------+-------------+-----------+------+
~~~

Version-Release number of selected component (if applicable):
rpm -qa | grep cinder
python3-cinderclient-5.0.1-1.20201113202643.8fa0882.el8ost.noarch
puppet-cinder-15.4.1-1.20201114011233.ff571a9.el8ost.noarch

cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.2 (Ootpa)

cat /etc/rhosp-release 
Red Hat OpenStack Platform release 16.1.4 GA (Train)

Comment 1 Alan Bishop 2021-06-08 13:37:09 UTC
I looked at the support case and see the cinder backend is ceph. Decoupling a snapshot from a volume created from that snapshot requires RBD cloning v2, which will be supported in OSP-16.2 (but not 16.1). See bug #1870282 and bug #1764324.

*** This bug has been marked as a duplicate of bug 1870282 ***

Comment 2 Luigi Toscano 2021-06-08 15:55:38 UTC

*** This bug has been marked as a duplicate of bug 1968526 ***