diff options
| author | Brian Elliott <brian.elliott@rackspace.com> | 2013-01-02 16:35:23 +0000 |
|---|---|---|
| committer | Brian Elliott <brian.elliott@rackspace.com> | 2013-01-02 17:30:58 +0000 |
| commit | 6afae496d2314ca6900f6f9709d093aa6bb7f29d (patch) | |
| tree | d83e5ac4162d1105bc93f3fab6f88f4df3a46ce4 /nova/compute | |
| parent | fff67a693a947c2d99c710682c999493558ea6f5 (diff) | |
Add compute build/resize errors to instance faults
Save exception during build and resize operations in instance faults.
This will making it easier to see the individual compute errors that
occurred when an operation got re-scheduled.
Change-Id: I4224b9638aa9b7572fc0ee1ef6fa3e6654b84805
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 9e4ac301e..6bf171635 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -626,8 +626,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: @@ -649,16 +650,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: @@ -1841,8 +1844,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( @@ -1853,7 +1857,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. @@ -1863,10 +1867,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, |
