← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1423690] [NEW] rebuild_instance doesn't detach cinder volumes correctly

 

Public bug reported:

The compute manager's rebuild_instance doesn't detach a volume correctly
prior to trying to stand up the vm again.

https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L2873

rebuild_instance()  defines detach_block_devices to call cinder's
detach_volume() API.

This doesn't actually detach anything.  Cinder's detach API just updates
the record of the volume in the Cinder DB.

https://github.com/openstack/cinder/blob/master/cinder/volume/manager.py#L748

The cinder volume manager calls the cinder driver's detach_volume
method, which doesn't actually detach anything.


The proper way to detach a volume is to call terminate_connection and
then detach_volume.


Nova compute manager detach_volume does this correctly

https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L4725


I have included a stack dump of what happens due to this.

** Affects: nova
     Importance: Undecided
         Status: New


** Tags: cinder

** Attachment added: "nova compute log failure due to cinder volume still being attached."
   https://bugs.launchpad.net/bugs/1423690/+attachment/4322781/+files/22677.txt

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1423690

Title:
  rebuild_instance doesn't detach cinder volumes correctly

Status in OpenStack Compute (Nova):
  New

Bug description:
  The compute manager's rebuild_instance doesn't detach a volume
  correctly prior to trying to stand up the vm again.

  https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L2873

  rebuild_instance()  defines detach_block_devices to call cinder's
  detach_volume() API.

  This doesn't actually detach anything.  Cinder's detach API just
  updates the record of the volume in the Cinder DB.

  https://github.com/openstack/cinder/blob/master/cinder/volume/manager.py#L748

  The cinder volume manager calls the cinder driver's detach_volume
  method, which doesn't actually detach anything.


  
  The proper way to detach a volume is to call terminate_connection and then detach_volume.


  Nova compute manager detach_volume does this correctly

  https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L4725


  I have included a stack dump of what happens due to this.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1423690/+subscriptions


Follow ups

References