volume-attach "already attached" and "already detached" are not mutually exclusive

Bug #1414802 reported by sparr
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
New
Undecided
Tushar Trambak Gite
OpenStack Compute (nova)
Confirmed
Low
Unassigned

Bug Description

> nova volume-attach 81eef059-1490-4ec3-b0fc-b1b4e6380ee8 639e0a87-1190-42d4-b3a1-a385090aec06
ERROR: Invalid volume: already attached (HTTP 400) (Request-ID: req-1c51a40b-1015-4cee-b313-5dda524a3555)
> nova volume-detach 81eef059-1490-4ec3-b0fc-b1b4e6380ee8 639e0a87-1190-42d4-b3a1-a385090aec06
ERROR: Invalid volume: already detached (HTTP 400) (Request-ID: req-bb99c24e-1ca8-4f02-bb0a-9bb125857637)

I'm trying to resolve a much larger problem with my openstack environment, involving volume exporting, and I ran across this situation. Whatever the tests are for these two messages, they should be mutually exclusive. Maybe a third message is needed, for some intermediate state?

Tags: volumes
Vincent Hou (houshengbo)
Changed in cinder:
assignee: nobody → Vincent Hou (houshengbo)
Revision history for this message
Vincent Hou (houshengbo) wrote :

Could you give me the detailed steps to reproduce this bug?
Which version of openstack are you using?

Revision history for this message
Vincent Hou (houshengbo) wrote :

The only condition for this issue to happen is that volume status is "available" and volume attach status is "attached".

Vincent Hou (houshengbo)
Changed in nova:
assignee: nobody → Vincent Hou (houshengbo)
Revision history for this message
sparr (sparr0) wrote :

Sadly one of the reproduction steps is "have the openstack host's kernel lock up, then hard reboot it", so it's non-trivial to accomplish. To resolve the problem we ended up having to dive into the mysql backend and update the volume statuses manually.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/164951

Changed in nova:
status: New → In Progress
Revision history for this message
Vincent Hou (houshengbo) wrote :

If the status in the database has been changed unexpected, it may lead to this error.
I modified the check_detach before doing a detach, making the condition more strict to raise the exception. Hope it can reduce the possibility of this issue.

Changed in nova:
importance: Undecided → Low
Mike Perez (thingee)
tags: added: volumes
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/164951
Reason: This patch has been stalled for quite a while, so I am going to abandon it to keep the code review queue sane. Please restore the change when it is ready for review.

Changed in nova:
status: In Progress → Confirmed
assignee: Vincent Hou (houshengbo) → nobody
Revision history for this message
Sean McGinnis (sean-mcginnis) wrote : Owner Expired

Unassigning due to no activity.

Changed in cinder:
assignee: Vincent Hou (houshengbo) → nobody
Changed in cinder:
assignee: nobody → Tushar Trambak Gite (tushargite96)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.