Nova can not detached a volume

Bug #1022520 reported by Hiroki Ishikawa
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Dan Smith

Bug Description

That a volume can not be detached when an instance is booted from a volume with an invalid name.

* Here is a sequence that the problem happens:
-----------------------------------------------------------
Version: Essex, Folsom-2
(use nova.volume.driver.ISCSIDriver)

1. Create volume (volume name: vol001)

2. Lunch instance (Boot From Volume)
   - name: test001
   - Volume or Volume Snapshot: vol001
   - Device Name: aaa <- select illegal device

3. Check: instance status
   - Status: error
   - Task: Spawning
   - Power State: No State

4.
4-1. detach volume
   - Horizon: Success message is displayed.
     "Success: Detached Volume: Attachment aaa on [UUID]"
   - nova-compute.log: Error (http://paste.openstack.org/show/19305/)

4-2. terminate instance
  - Horizon: Success message is displayed.
    "Success: Terminated Instance: test"
  - nova-compute.log: Error(http://paste.openstack.org/show/19306/)
-----------------------------------------------------------

Cause:
-----------------------------------------------------------
o Detach volume
  - iSCSI delete: Success
  - DB update: Fail
    - libvirt can not find domain
      (# virsh list --all -> none)

o Terminate instance
   - iSCSI delete: Fail
     - it has been already iscsi logout.
   - DB update: Fail
-----------------------------------------------------------
If you terminated instance without detaching volume.
  - instace terminate: Success
  - detach volume: Success
-----------------------------------------------------------

Dan Smith (danms)
Changed in nova:
assignee: nobody → Dan Smith (danms)
status: New → In Progress
Eoghan Glynn (eglynn)
Changed in nova:
status: In Progress → Confirmed
assignee: Dan Smith (danms) → Eoghan Glynn (eglynn)
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/9547

Changed in nova:
assignee: Eoghan Glynn (eglynn) → Dan Smith (danms)
status: Confirmed → In Progress
Revision history for this message
Eoghan Glynn (eglynn) wrote :

Sorry Dan, didn't realize you were working on this also.

I'll step aside as you've already proposed a patch.

Revision history for this message
Thierry Carrez (ttx) wrote :

Might be related to bug 1016111

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

Reviewed: https://review.openstack.org/9547
Committed: http://github.com/openstack/nova/commit/ab7e4f2817d8201cd2364cf09aa01f505e911183
Submitter: Jenkins
Branch: master

commit ab7e4f2817d8201cd2364cf09aa01f505e911183
Author: Dan Smith <email address hidden>
Date: Mon Jul 9 13:37:01 2012 -0700

    When deleting an instance, avoid freakout if iscsi device is gone

    It's fairly easy to get into a state where an instance is not running,
    the iscsi infrastructure has been torn down, and the instance cannot
    be deleted because the iscsi device cannot be successfully removed.
    This patch ignores the associated return value for that scenario and
    marches forward in the teardown process.

    Fixes bug 1022520

    Change-Id: Ib28790892eebe341ac10a92250cf872605fefe9b

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-3 → 2012.2
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.