Description of problem: The "RBD clone v2 support" feature doesn't work as expected. If there's a volume, any snapshot is created from it and then you try to delete the volume without delete the snapshot first, it fails, even with the "CinderRbdFlattenVolumeFromSnapshot: true" and "rbd_flatten_volume_from_snapshot=True" parameters set for Cinder. But according to the RHOSP 16.2 Release Notes [1], "This feature allows you to delete resources that have dependencies, such as snapshots." [1] https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/0/html/release_notes/chap-top_new_features#storage Version-Release number of selected component (if applicable): RHOSP 16.2 Ceph 4.1 How reproducible: Always. Steps to Reproduce: 1. Deploy RHOSP 16.2 and Ceph 4.1 containerized (deployed by Director). 2. Make sure "CinderRbdFlattenVolumeFromSnapshot: true" and "rbd_flatten_volume_from_snapshot=True" are enabled for Cinder. 3. Create a volume. 4. Create a snapshot from the volume. 5. Try to delete the volume without delete the snapshot first. It fails. 6. Try to unprotect the snapshot image directly into Ceph. 7. Try to delete the volume again without success. Actual results: Failed to delete volume with name or ID 'rbd-v2': Invalid volume: Volume status must be available or error or error_restoring or error_extending or error_managing and must not be migrating, attached, belong to a group, have snapshots or be disassociated from snapshots after volume transfer. (HTTP 400) Expected results: This feature should support to delete resources that have dependencies, such as snapshots. Additional info: === (overcloud) [stack@alexon-undercloud ~]$ openstack volume list +--------------------------------------+------------+-----------+------+-------------------------------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+------------+-----------+------+-------------------------------------+ | f3dd8110-11bd-469e-ab90-d8755e33cbff | rbd-v2 | available | 8 | | | b7e57b3b-717d-41dd-a2bb-476d59b63a9d | pet-volume | in-use | 8 | Attached to pet-server on /dev/vda | +--------------------------------------+------------+-----------+------+-------------------------------------+ (overcloud) [stack@alexon-undercloud ~]$ openstack volume snapshot list +--------------------------------------+----------+------------------------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+----------+------------------------------+-----------+------+ | adba1127-5bf0-4ce9-89bf-238c698ca6ce | rbd-snap | Testing RBD clone v2 support | available | 8 | +--------------------------------------+----------+------------------------------+-----------+------+ (overcloud) [stack@alexon-undercloud ~]$ openstack volume snapshot show rbd-snap +--------------------------------------------+--------------------------------------+ | Field | Value | +--------------------------------------------+--------------------------------------+ | created_at | 2021-10-06T17:45:47.000000 | | description | Testing RBD clone v2 support | | id | adba1127-5bf0-4ce9-89bf-238c698ca6ce | | name | rbd-snap | | os-extended-snapshot-attributes:progress | 100% | | os-extended-snapshot-attributes:project_id | e1c128010aab4f718eb405994ea51a64 | | properties | | | size | 8 | | status | available | | updated_at | 2021-10-06T17:45:47.000000 | | volume_id | f3dd8110-11bd-469e-ab90-d8755e33cbff | +--------------------------------------------+--------------------------------------+ (overcloud) [stack@alexon-undercloud ~]$ openstack volume delete rbd-v2 Failed to delete volume with name or ID 'rbd-v2': Invalid volume: Volume status must be available or error or error_restoring or error_extending or error_managing and must not be migrating, attached, belong to a group, have snapshots or be disassociated from snapshots after volume transfer. (HTTP 400) (Request-ID: req-291891ea-8988-49b6-bfd9-b2793543afee) 1 of 1 volumes failed to delete. [root@alexon-controller-0 /]# rbd --pool volumes ls volume-b7e57b3b-717d-41dd-a2bb-476d59b63a9d volume-f3dd8110-11bd-469e-ab90-d8755e33cbff [root@alexon-controller-0 /]# rbd snap ls --pool volumes volume-f3dd8110-11bd-469e-ab90-d8755e33cbff SNAPID NAME SIZE PROTECTED TIMESTAMP 4 snapshot-adba1127-5bf0-4ce9-89bf-238c698ca6ce 8 GiB yes Wed Oct 6 13:45:47 2021 [root@alexon-controller-0 /]# rbd snap unprotect volumes/volume-f3dd8110-11bd-469e-ab90-d8755e33cbff@snapshot-adba1127-5bf0-4ce9-89bf-238c698ca6ce [root@alexon-controller-0 /]# (overcloud) [stack@alexon-undercloud ~]$ openstack volume delete rbd-v2 Failed to delete volume with name or ID 'rbd-v2': Invalid volume: Volume status must be available or error or error_restoring or error_extending or error_managing and must not be migrating, attached, belong to a group, have snapshots or be disassociated from snapshots after volume transfer. (HTTP 400) (Request-ID: req-0135eb4d-3a46-4933-b106-5de42cd8af46) 1 of 1 volumes failed to delete. (overcloud) [stack@alexon-undercloud ~]$ cat ~/templates/cinder-rbdv2-support.yaml parameter_defaults: CinderRbdFlattenVolumeFromSnapshot: true (undercloud) [stack@alexon-undercloud ~]$ for i in 146 108 133; do echo "=== 10.10.0.$i ==="; ssh heat-admin.0.$i sudo grep -i rbd_flatten /var/lib/config-data/puppet-generated/cinder/etc/cinder/cinder.conf; done === 10.10.0.146 === rbd_flatten_volume_from_snapshot = true rbd_flatten_volume_from_snapshot=True === 10.10.0.108 === rbd_flatten_volume_from_snapshot = true rbd_flatten_volume_from_snapshot=True === 10.10.0.133 === rbd_flatten_volume_from_snapshot = true rbd_flatten_volume_from_snapshot=True [root@alexon-controller-0 cinder]# grep -i -e error -e fail * cinder-api.log:2021-10-06 15:50:01.785 10 INFO cinder.volume.api [req-55a8ecd2-344c-4623-8dba-ae17aaf646f3 665ae018f623434a8141f8ab38bf7b64 e1c128010aab4f718eb405994ea51a64 - default default] Volume status must be available or error or error_restoring or error_extending or error_managing and must not be migrating, attached, belong to a group, have snapshots or be disassociated from snapshots after volume transfer. cinder-api.log:2021-10-06 15:50:17.629 10 INFO cinder.volume.api [req-ad752198-9e05-4c0f-bb31-dc0c4b2d7e2a 665ae018f623434a8141f8ab38bf7b64 e1c128010aab4f718eb405994ea51a64 - default default] Volume status must be available or error or error_restoring or error_extending or error_managing and must not be migrating, attached, belong to a group, have snapshots or be disassociated from snapshots after volume transfer. ===
The flattening should not be set (that's the point of the feature), however the scope of the feature was reduced (see now bug 1764324) and this is most likely a duplicate of bug 1997715.