This isn't really a valid workflow. You need to first detach the volume from the server via the compute API:
https://docs.openstack.org/python-openstackclient/latest/cli/command- objects/server.html#server-remove-volume And then you can delete the volume. The volume attachments API in Cinder is really meant for nova/cinder internal communication, not really for end users. Think of it like the neutron port binding API extension which is admin-only by default. The difference is until I think Queens, nova didn't have configuration options to have admin/service credentials for cinder. That is possible now, but it's not yet required so Cinder can't just change the policy rules on the attachments API without breaking some backward compatibility. See: https://docs.openstack.org/cinder/latest/configuration/block- storage/policy.html volume:attachment_create Default: <empty string> Operations: POST /attachments Create attachment. volume:attachment_update Default: rule:admin_or_owner Operations: PUT /attachments/{attachment_id} Update attachment. volume:attachment_delete Default: rule:admin_or_owner Operations: DELETE /attachments/{attachment_id} Delete attachment. volume:attachment_complete Default: rule:admin_or_owner Operations: POST /attachments/{attachment_id}/action (os-complete) Mark a volume attachment process as completed (in-use) And: https://docs.openstack.org/nova/latest/configuration/config.html#cinder ** Changed in: nova Status: New => Invalid -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1785800 Title: Not possible to delete volume which was attached Status in OpenStack Compute (nova): Invalid Bug description: Description =========== Fail to delete a volume after detaching the volume using Cinder command. [stack@undercloud~(tm5)]$ openstack volume list +--------------------------------------+------------------------------+--------+--------+-------------------------------------------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+------------------------------+--------+--------+-------------------------------------------------+ | 471ed957-7c6d-492f-ac83-978d15fc1aa9 | vol-du-2222 | in-use | 2222 | Attached to vm-du on /dev/vdb | +--------------------------------------+------------------------------+--------+--------+-------------------------------------------------+ [stack@undercloud~(tm5)]$ openstack volume show 471ed957-7c6d-492f-ac83-978d15fc1aa9 +--------------------------------+---------------------------------------------------------------------------------------------------------------------+ | Field | Value | +--------------------------------+---------------------------------------------------------------------------------------------------------------------+ | attachments | [{u'server_id': u'9e20ca48-0651-4099-b2ea-aafcfd2a8ecf', u'attachment_id': u'4412a78a-053e-41ab-8576-50d8e2f0ae33', [stack@undercloud~(tm5)]$ cinder --os-volume-api-version 3.27 attachment-delete 4412a78a-053e-41ab-8576-50d8e2f0ae33 [stack@undercloud~(tm5)]$ openstack volume list +--------------------------------------+------------------------------+-----------+--------+-------------------------------------------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+------------------------------+-----------+--------+-------------------------------------------------+ | 471ed957-7c6d-492f-ac83-978d15fc1aa9 | vol-du-2222 | available | 2222 | | +--------------------------------------+------------------------------+-----------+--------+-------------------------------------------------+ [stack@undercloud~(tm5)]$ openstack volume delete 471ed957-7c6d-492f-ac83-978d15fc1aa9 [stack@undercloud~(tm5)]$ openstack volume list +--------------------------------------+------------------------------+----------+--------+-------------------------------------------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+------------------------------+----------+--------+-------------------------------------------------+ | 471ed957-7c6d-492f-ac83-978d15fc1aa9 | vol-du-2222 | deleting | 2222 | | +--------------------------------------+------------------------------+----------+--------+-------------------------------------------------+ [stack@undercloud~(tm5)]$ openstack volume list +--------------------------------------+------------------------------+-----------+--------+-------------------------------------------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+------------------------------+-----------+--------+-------------------------------------------------+ | 471ed957-7c6d-492f-ac83-978d15fc1aa9 | vol-du-2222 | available | 2222 | | +--------------------------------------+------------------------------+-----------+--------+-------------------------------------------------+ Steps to reproduce ================== 1. Create volume. 2. Create VM. 3. Attach the VM to the volume - volume status - "in-use". 4. Delete the attachment using cinder - cinder --os-volume-api-version 3.27 attachment-delete <attachment-id >. 5. Check that the volume status is - "available". 6. Delete the volume. - See that the volume not deleted and remain in "available" status. Expected result =============== 1. Volume will be deleted after the attachment delete using cinder. Actual result ============= 1. Fails to delete the Volume. logs show: cinder-volume.log 2018-08-07 13:59:50.705 56 ERROR cinder.volume.manager [req-82d30576-84c6-43a5-aada-5a8ce0aacd6f 8976f232d27248d791d4f11aae85569d 17cd957fbbc9463797e37bee9afa366d - default default] Unable to delete busy volume.: VolumeIsBusy: ImageBusy error raised while deleting rbd volume. This may have been caused by a connection from a client that has crashed and, if so, may be resolved by retrying the delete after 30 second Environment =========== [stack@undercloud~(tm5)]$ openstack --version openstack 3.14.2 [stack@undercloud~(tm5)]$ rpm -qa --last | grep nova openstack-nova-scheduler-17.0.6-0.20180704141006.3163c93.el7.noarch Mon 09 Jul 2018 07:38:21 PM UTC openstack-nova-placement-api-17.0.6-0.20180704141006.3163c93.el7.noarch Mon 09 Jul 2018 07:38:21 PM UTC openstack-nova-conductor-17.0.6-0.20180704141006.3163c93.el7.noarch Mon 09 Jul 2018 07:38:21 PM UTC openstack-nova-api-17.0.6-0.20180704141006.3163c93.el7.noarch Mon 09 Jul 2018 07:38:21 PM UTC openstack-nova-compute-17.0.6-0.20180704141006.3163c93.el7.noarch Mon 09 Jul 2018 07:38:20 PM UTC python-nova-17.0.6-0.20180704141006.3163c93.el7.noarch Mon 09 Jul 2018 07:38:18 PM UTC openstack-nova-common-17.0.6-0.20180704141006.3163c93.el7.noarch Mon 09 Jul 2018 07:38:18 PM UTC python2-novaclient-10.1.0-0.20180605113302.ed73aad.el7.noarch Mon 09 Jul 2018 07:37:49 PM UTC puppet-nova-12.4.1-0.20180617130812.b5284f1.el7.noarch Mon 09 Jul 2018 07:33:17 PM UTC [stack@undercloud~(tm5)]$ [stack@undercloud~(tm5)]$ rpm -qa --last | grep cinder python2-cinderclient-3.5.0-0.20180211213738.1de605c.el7.centos.noarch Mon 09 Jul 2018 07:37:49 PM UTC puppet-cinder-12.4.1-0.20180628102250.641e036.el7.noarch Mon 09 Jul 2018 07:33:17 PM UTC [stack@undercloud~(tm5)]$ [stack@undercloud~(tm5)]$ sudo dmidecode | egrep -i 'manufacturer|product|vendor' Vendor: Seabios Manufacturer: Red Hat Product Name: KVM Manufacturer: Bochs Storage: ceph version 12.2.4 To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1785800/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

