Comment 10 for bug 1335889

Revision history for this message
Walt Boring (walter-boring) wrote :

I think changing the cinder API to just allow a volume to be deleted, without a force flag, when it's 'in-use' is a dangerous and wrong to do. We'll get users who do it by mistake and then nuke their volumes attached to live VMs.

So, it seems the issue is related to the fact that in Nova's code we nuke the VM first and then try and delete the volumes.
https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L2365-L2375

Shouldn't nova ensure that it detaches the volume first before deleting it?
https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L2307-L2315

Or check the exception that comes back from the volume_api.delete call and see if it complains because it's attached, then call terminate_connection, then delete.