diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-09-12 23:19:30 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-09-12 23:19:30 +0000 |
| commit | 3390c70d2f4481527aaf2fbc3847664b3f45de0e (patch) | |
| tree | 0a863500d5f06797f1aaa48e527cfd5d509b022c /nova/compute | |
| parent | de63434fec28987f4a7e6850e05cce0fa0082d44 (diff) | |
| parent | ca9428037a33cf970d4d0c229121ee526614885a (diff) | |
Merge "Add 'detaching' to volume status"
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 1 | ||||
| -rw-r--r-- | nova/compute/manager.py | 14 |
2 files changed, 12 insertions, 3 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index a85e01d46..399ac6dd3 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1839,6 +1839,7 @@ class API(base.Base): volume = self.volume_api.get(context, volume_id) self.volume_api.check_detach(context, volume) + self.volume_api.begin_detaching(context, volume) self.compute_rpcapi.detach_volume(context, instance=instance, volume_id=volume_id) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 1177d052d..6251027d7 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -1979,9 +1979,17 @@ class ComputeManager(manager.SchedulerDependentManager): # but added for completeness in case we ever do. if connection_info and 'serial' not in connection_info: connection_info['serial'] = volume_id - self.driver.detach_volume(connection_info, - instance['name'], - mp) + try: + self.driver.detach_volume(connection_info, + instance['name'], + mp) + except Exception: # pylint: disable=W0702 + with excutils.save_and_reraise_exception(): + msg = _("Faild to detach volume %(volume_id)s from %(mp)s") + LOG.exception(msg % locals(), context=context, + instance=instance) + volume = self.volume_api.get(context, volume_id) + self.volume_api.roll_detaching(context, volume) @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id()) @reverts_task_state |
