Comment 4 for bug 1335889

Revision history for this message
Trung Trinh (trung-t-trinh) wrote :

Proposed work-around of Cinder source code to allow deleting of volume attached to the already-deleted VM:

In the function cinder.volume.api.API.delete(), there exists an if-clause as follows:

        if volume['attach_status'] == "attached":
            MY_LOG.debug("%s - API::delete - Volume is still attached, "\
                         "need to detach first" % __name__)

            # Volume is still attached, need to detach first
            raise exception.VolumeAttached(volume_id=volume_id)

Based on the above if-clause, it's possible to add further code to check if volume['instance_uuid'] results in a non-existed instance, then the deleting operation is still passed through.
The question is how to check if some instance_uuid exists or not from Cinder side?