diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-01-07 17:57:08 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-01-07 17:57:08 +0000 |
| commit | f4a8a484cc86d11c58ba2d99a58097b70848155c (patch) | |
| tree | 5b58d67dcc1c1d0994e8ff53ae9d685c3fd78b76 /nova/compute | |
| parent | 4d4cddbb9aeb26fe8d9831f20553f04e8cf29c44 (diff) | |
| parent | 6afae496d2314ca6900f6f9709d093aa6bb7f29d (diff) | |
Merge "Add compute build/resize errors to instance faults"
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/manager.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 9e7e0e1fb..7ac6b1518 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -629,8 +629,9 @@ class ComputeManager(manager.SchedulerDependentManager): LOG.exception(msg, instance=instance) raise except Exception: + exc_info = sys.exc_info() # try to re-schedule instance: - self._reschedule_or_reraise(context, instance, + self._reschedule_or_reraise(context, instance, exc_info, requested_networks, admin_password, injected_files, is_first_time, request_spec, filter_properties) else: @@ -652,16 +653,18 @@ class ComputeManager(manager.SchedulerDependentManager): traceback.format_exception(type_, value, tb), instance_uuid=instance_uuid) - def _reschedule_or_reraise(self, context, instance, requested_networks, - admin_password, injected_files, is_first_time, - request_spec, filter_properties): + def _reschedule_or_reraise(self, context, instance, exc_info, + requested_networks, admin_password, injected_files, is_first_time, + request_spec, filter_properties): """Try to re-schedule the build or re-raise the original build error to error out the instance. """ - exc_info = sys.exc_info() instance_uuid = instance['uuid'] rescheduled = False + compute_utils.add_instance_fault_from_exc(context, instance_uuid, + exc_info[0], exc_info=exc_info) + try: self._deallocate_network(context, instance) except Exception: @@ -1850,8 +1853,9 @@ class ComputeManager(manager.SchedulerDependentManager): reservations, request_spec, filter_properties, node) except Exception: # try to re-schedule the resize elsewhere: + exc_info = sys.exc_info() self._reschedule_resize_or_reraise(context, image, instance, - instance_type, reservations, request_spec, + exc_info, instance_type, reservations, request_spec, filter_properties) finally: extra_usage_info = dict( @@ -1862,7 +1866,7 @@ class ComputeManager(manager.SchedulerDependentManager): context, instance, "resize.prep.end", extra_usage_info=extra_usage_info) - def _reschedule_resize_or_reraise(self, context, image, instance, + def _reschedule_resize_or_reraise(self, context, image, instance, exc_info, instance_type, reservations, request_spec, filter_properties): """Try to re-schedule the resize or re-raise the original error to error out the instance. @@ -1872,10 +1876,12 @@ class ComputeManager(manager.SchedulerDependentManager): if not filter_properties: filter_properties = {} - exc_info = sys.exc_info() rescheduled = False instance_uuid = instance['uuid'] + compute_utils.add_instance_fault_from_exc(context, instance_uuid, + exc_info[0], exc_info=exc_info) + try: scheduler_method = self.scheduler_rpcapi.prep_resize method_args = (instance, instance_type, image, request_spec, |
