[Openstack] Nova can not detached a volume

Hiroki Ishikawa ishikawa84e at gmail.com
Sat Jul 7 08:42:22 UTC 2012


Hi all,

I have been faced a problem that the 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 dispalyed.
    "Success: Terminated Instance: test"
  - nova-compute.log: Error(http://paste.openstack.org/show/19306/)
-----------------------------------------------------------

Is this a bug?

If you terminated instance without detaching volume.
  - instace terminate: Success
  - detach volume: Success


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

o Terminate instance
   - iSCSI delete: Fail
     - it has been already iscsi logout.
   - DB update: Fail
-----------------------------------------------------------


As a transitory measure:
-----------------------------------------------------------
mysql> use nova
mysql> update volumes set
mountpoint=NULL,status="available",attach_status="detached",instance_id=NULL
where id=XXX;
mysql> update block_device_mapping set deleted_at = now(),deleted = 1
where id = XXX;
-----------------------------------------------------------

Best Regards,
 Hiroki Ishikawa

--
Hiroki Ishikawa <ishikawa84e at gmail.com>




More information about the Openstack mailing list