Bug 1226064

Summary: [cinder][nova]: Orphaned Undeletable Volumes
Product: Red Hat OpenStack Reporter: Aaron Thomas <aathomas>
Component: openstack-cinderAssignee: Eric Harney <eharney>
Status: CLOSED DUPLICATE QA Contact: nlevinki <nlevinki>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0 (Juno)CC: aathomas, eharney, sgotliv, yeylon
Target Milestone: ---   
Target Release: 7.0 (Kilo)   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-04 12:21:27 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 Aaron Thomas 2015-05-28 21:45:48 UTC
Description of problem:
-----------------------------------------
The customer attached to the following support case has encountered an easily reproducible bug in their environment that creates volumes that are labeled as attached to "none" and are undeletable.

The volumes cannot be deleted in any way. And must be removed from the database and from the file system manually.

How reproducible:
-----------------------------------------
100% in the customer's environment, however we have not been able to reproduce this in house. 

Steps to Reproduce:
-----------------------------------------
1) Upload an ISO image into openstack, it doesn't matter what it is.

2) Create an instance using the ISO as the image

3) Power off the instance and wait for it to power off

4) Create a volume

5) Attach the volume to the instance on /dev/hdb

6) Power on the instance 

7) Try to detach the volume while the instance is powered on

8) Delete the instance

9) Go to the volumes screen and note that "Attached To" now says "Attached to  None on /dev/hdb"

Actual results:
-----------------------------------------
Creates volumes that are labeled as attached to "none" and are undeletable if attached to an instance that is deleted.

Expected results:
-----------------------------------------
Created volumes that were attached to instance are deletable if attached to an instance that is deleted, after the instance was deleted. 

Additional info:
-----------------------------------------
We've provided the following workaround to the customer, which allows the volumes to be deleted.

# mysql cinder

MariaDB [cinder]> UPDATE volumes SET attach_status='detached', instance_uuid=NULL, \
attach_time=NULL, status="available" WHERE id='volume_id';

# cinder delete volume_id

Comment 5 Eric Harney 2015-06-01 14:47:03 UTC
Do we know why the AMQP errors are occurring, which seems to be the root cause of this?

In Liberty some work is being done in Cinder to improve the API interactions between Cinder and Nova.  It is possible that that work will improve the error recovery in this case, but I don't have a lot of specifics I can provide there for now.

Comment 8 Sergey Gotliv 2015-06-04 12:21:27 UTC

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