Omer Frenkel has uploaded a new change for review.

Change subject: core: Add log for error on run-vm failure
......................................................................

core: Add log for error on run-vm failure

In most cases, when running vm fails there is re-run.
when there is an error in the create process (for example before
createVmVdsCommand is called), the error is not logged anywhere.

This patch adds a log to this error,
also remove the word "VDSM" from the exception message,
unfortunately its not always vdsm fault.

Change-Id: Ia936fee01fa781eff5d5b3959ae6478129c2a136
Signed-off-by: Omer Frenkel <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBLLException.java
2 files changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/27/17627/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
index 388a938..1512c0c 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
@@ -250,6 +250,7 @@
                 case PROVIDER_FAILURE:
                     throw e;
                 default:
+                    log.warnFormat("Failed to run VM {0}: {1}", getVmName(), 
e.getMessage());
                 }
 
             } finally {
@@ -263,7 +264,7 @@
             } else {
                 // Try to rerun Vm on different vds no need to log the command 
because it is
                 // being logged inside the rerun
-                log.infoFormat("Failed to run desktop {0}, rerun", 
getVm().getName());
+                log.infoFormat("Trying to rerun VM {0}", getVm().getName());
                 setCommandShouldBeLogged(false);
                 setSucceeded(true);
                 rerun();
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBLLException.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBLLException.java
index 89ab472..6d38af7 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBLLException.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBLLException.java
@@ -44,7 +44,7 @@
 
     @Override
     public String getMessage() {
-        return String.format(super.getMessage() + " (Failed with VDSM error 
%1$s and code %2$s)",
+        return String.format(super.getMessage() + " (Failed with error %1$s 
and code %2$s)",
                 privateVdsError.getCode(),
                 privateVdsError.getCode().getValue());
     }


-- 
To view, visit http://gerrit.ovirt.org/17627
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia936fee01fa781eff5d5b3959ae6478129c2a136
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Omer Frenkel <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to