block_device: Rollback volumes to in-use on DeviceDetachFailed
The call to os-roll_detaching was dropped when I3800b466a50b1e5f5d1e8c8a963d9a6258af67ee started to catch and reraise DeviceDetachFailed. This call is required to ensure a volume returns to an in-use state when the instance is unable to detach. Closes-Bug: #1786318 Change-Id: I6b3dc09acc6f360806ce0ef8c8a65addbf4a8c51
This commit is contained in:
parent
93888df0da
commit
3a4b4b91b0
|
@ -248,6 +248,8 @@ class TestDriverBlockDevice(test.NoDBTestCase):
|
|||
self.context, inst, vol_api, virt)
|
||||
self.assertFalse(log.exception.called)
|
||||
self.assertTrue(log.warning.called)
|
||||
vol_api.roll_detaching.assert_called_once_with(self.context,
|
||||
driver_bdm.volume_id)
|
||||
|
||||
def test_no_device_raises(self):
|
||||
for name, cls in self.driver_classes.items():
|
||||
|
|
|
@ -322,6 +322,7 @@ class DriverVolumeBlockDevice(DriverBlockDevice):
|
|||
with excutils.save_and_reraise_exception():
|
||||
LOG.warning('Guest refused to detach volume %(vol)s',
|
||||
{'vol': volume_id}, instance=instance)
|
||||
volume_api.roll_detaching(context, volume_id)
|
||||
except Exception:
|
||||
with excutils.save_and_reraise_exception():
|
||||
LOG.exception('Failed to detach volume '
|
||||
|
|
Loading…
Reference in New Issue