summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Still <mikal@stillhq.com>2012-07-28 21:01:16 +1000
committerMichael Still <mikal@stillhq.com>2012-08-02 09:48:20 +1000
commit1bfeca6fb74a7554ff67dba3015ec5e9f914bc35 (patch)
treed9adb3958bd5ffd87e6cb3f0d2b11a5e8e13d997
parent4afaf1792de257c7ba9168d53628218706fa438a (diff)
downloadnova-1bfeca6fb74a7554ff67dba3015ec5e9f914bc35.tar.gz
nova-1bfeca6fb74a7554ff67dba3015ec5e9f914bc35.tar.xz
nova-1bfeca6fb74a7554ff67dba3015ec5e9f914bc35.zip
Audit log messages in nova/compute/manager.py
To include instance whereever possible. This resolves bug 977978. Change-Id: Ic113489c464458f9b1859a21942b1bbe203698bd
-rw-r--r--nova/compute/manager.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 4540b76cf..85a0a13ad 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -567,7 +567,7 @@ class ComputeManager(manager.SchedulerDependentManager):
except Exception:
rescheduled = False
LOG.exception(_("Error trying to reschedule"),
- instance_uuid=instance_uuid)
+ instance_uuid=instance_uuid)
if rescheduled:
# log the original build error
@@ -584,19 +584,19 @@ class ComputeManager(manager.SchedulerDependentManager):
if not retry:
# no retry information, do not reschedule.
LOG.debug(_("Retry info not present, will not reschedule"),
- instance_uuid=instance_uuid)
+ instance_uuid=instance_uuid)
return
request_spec = kwargs.get('request_spec', None)
if not request_spec:
LOG.debug(_("No request spec, will not reschedule"),
- instance_uuid=instance_uuid)
+ instance_uuid=instance_uuid)
return
request_spec['num_instances'] = 1
LOG.debug(_("Re-scheduling instance: attempt %d"),
- retry['num_attempts'], instance_uuid=instance_uuid)
+ retry['num_attempts'], instance_uuid=instance_uuid)
self.scheduler_rpcapi.run_instance(context, FLAGS.compute_topic,
request_spec, admin_password, injected_files,
requested_networks, is_first_time, filter_properties,
@@ -2479,7 +2479,7 @@ class ComputeManager(manager.SchedulerDependentManager):
# force an update to the instance's info_cache
self.network_api.get_instance_nw_info(context, instance)
LOG.debug(_('Updated the info_cache for instance'),
- instance=instance)
+ instance=instance)
except Exception:
# We don't care about any failures
pass
@@ -2741,7 +2741,8 @@ class ComputeManager(manager.SchedulerDependentManager):
# time and retried.
# For example, there might be another task scheduled.
LOG.exception(_("error during stop() in "
- "sync_power_state."))
+ "sync_power_state."),
+ instance=db_instance)
elif vm_power_state in (power_state.PAUSED,
power_state.SUSPENDED):
LOG.warn(_("Instance is paused or suspended "
@@ -2751,7 +2752,8 @@ class ComputeManager(manager.SchedulerDependentManager):
self.compute_api.stop(context, db_instance)
except Exception:
LOG.exception(_("error during stop() in "
- "sync_power_state."))
+ "sync_power_state."),
+ instance=db_instance)
elif vm_state == vm_states.STOPPED:
if vm_power_state not in (power_state.NOSTATE,
power_state.SHUTDOWN,
@@ -2764,7 +2766,8 @@ class ComputeManager(manager.SchedulerDependentManager):
self.compute_api.stop(context, db_instance)
except Exception:
LOG.exception(_("error during stop() in "
- "sync_power_state."))
+ "sync_power_state."),
+ instance=db_instance)
elif vm_state in (vm_states.SOFT_DELETED,
vm_states.DELETED):
if vm_power_state not in (power_state.NOSTATE,