Volume detach leaves volume attached to instance on start/rebuild/reboot

Bug #1471271 reported by Roman Podoliaka
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Undecided
Roman Podoliaka

Bug Description

When starting/restarting/rebuilding instances, it may happen that a volume detach request comes right in the middle of attaching a volume in the driver. In this case the hypervisor (e.g. libvirt) will throw DiskNotFound exception in driver.detach_volume() call, but still the volume gets attached eventually, when the instance starts.

This leaves the instance in the state, when the volume is `de-facto` attached to it (i.e. shown in the `virsh dumpxmp $instance` output for libvirt), but both Nova and Cinder think the volume is actually *not* in-use.

Steps to reproduce:

1. Create an instance and attach a volume to it.
2. Stop the instance.
3. Start the instance and send a couple of volume-detach requests in a row, like:

   nova start demo && nova volume-detach demo $volume_id || nova volume-detach demo $volume_id || nova volume-detach demo $volume_id
 || nova volume-detach demo $volume_id

4. Check the cinder list, nova show $inst, virsh dumpxml $inst output.

Expected result:

Both cinder list and nova show report volume is not in-use anymore. There is no volume related elements in virsh dumpxml output.

Actual result:

Both cinder list and nova show report volume is not in-use anymore. But virsh dumpxml shows that the volume is still attached to the instance.

description: updated
Changed in nova:
assignee: nobody → Roman Podoliaka (rpodolyaka)
Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Roman Podoliaka (<email address hidden>) on branch: master
Review: https://review.openstack.org/198414
Reason: abandon in favour of https://review.openstack.org/#/c/175067/

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.