From a475155e43c6368f06cfc12deeac6f80ab48eafe Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Tue, 27 Feb 2018 12:04:24 -0500 Subject: [PATCH] Enhance logging around remove snapshot operations Prior to removing a snapshot log the id, uid_ems, ems_ref, name, and description to aid in diagnosing errors. https://bugzilla.redhat.com/show_bug.cgi?id=1549299 --- app/models/vm_or_template/operations/snapshot.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/vm_or_template/operations/snapshot.rb b/app/models/vm_or_template/operations/snapshot.rb index a5d97a6a0d5..46dcf42f44c 100644 --- a/app/models/vm_or_template/operations/snapshot.rb +++ b/app/models/vm_or_template/operations/snapshot.rb @@ -63,6 +63,8 @@ def raw_remove_snapshot(snapshot_id) snapshot = snapshots.find_by(:id => snapshot_id) raise _("Requested VM snapshot not found, unable to remove snapshot") unless snapshot begin + _log.info("removing snapshot ID: [#{snapshot.id}] uid_ems: [#{snapshot.uid_ems}] ems_ref: [#{snapshot.ems_ref}] name: [#{snapshot.name}] description [#{snapshot.description}]") + run_command_via_parent(:vm_remove_snapshot, :snMor => snapshot.uid_ems) rescue => err create_notification(:vm_snapshot_failure, :error => err.to_s, :snapshot_op => "remove")