ofri masad has uploaded a new change for review.

Change subject: core: Add migration start message (#744813)
......................................................................

core: Add migration start message (#744813)

When migration of a VM was initiated by the system as in order to carry
out a resources distribution policy, no message was presented in the
log (only completion message presented).

The massaging mechanism was fitted to internal calls.

Change-Id: I61d7ba796253ea05d7c9c41647538bc11beafc5f
Signed-off-by: Ofri Masad <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsLoadBalancingAlgorithm.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
M 
backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
4 files changed, 16 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/94/7694/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
index 106a5da..7cf1dca 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
@@ -138,11 +138,13 @@
 
     @Override
     public AuditLogType getAuditLogTypeValue() {
+        AuditLogType startMessage = isInternalExecution() ? 
AuditLogType.VM_MIGRATION_START_SYSTEM_INITIATED
+                : AuditLogType.VM_MIGRATION_START;
         // all good, succeeded and the vm is up
         // succeeded false, rerun
         // succeeded false, rerun false = migration failed
-        return getSucceeded() ? (VMStatus) getActionReturnValue() == 
VMStatus.Up ? AuditLogType.VM_MIGRATION_DONE
-                : AuditLogType.VM_MIGRATION_START
+        return getSucceeded() ? getActionReturnValue() == VMStatus.Up ? 
AuditLogType.VM_MIGRATION_DONE
+                :startMessage
                 : _isRerun ? AuditLogType.VM_MIGRATION_TRYING_RERUN
                         : getVds().getstatus() == 
VDSStatus.PreparingForMaintenance ? 
AuditLogType.VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTANANCE
                                 : AuditLogType.VM_MIGRATION_FAILED;
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsLoadBalancingAlgorithm.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsLoadBalancingAlgorithm.java
index 6d4456e..3319f60 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsLoadBalancingAlgorithm.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsLoadBalancingAlgorithm.java
@@ -180,7 +180,6 @@
                      */
                     MigrateVmToServerParameters parameters =
                         new MigrateVmToServerParameters(false, vm.getId(), 
destinationVdsId);
-                    parameters.setShouldBeLogged(false);
                     
Backend.getInstance().runInternalAction(VdcActionType.MigrateVmToServer,
                             parameters,
                             ExecutionHandler.createInternalJobContext());
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
index 47ac8cf..e945317 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
@@ -271,6 +271,7 @@
     VM_MIGRATION_DONE(63),
     VM_MIGRATION_ABORT(64),
     VM_MIGRATION_FAILED(65),
+    VM_MIGRATION_START_SYSTEM_INITIATED(67),
     VM_MIGRATION_FAILED_FROM_TO(120),
     VM_MIGRATION_TRYING_RERUN(128),
     VM_CANCEL_MIGRATION(161),
diff --git 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
index 3aca230..cb863a0 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
@@ -199,6 +199,7 @@
 VM_SET_TO_UNKNOWN_STATUS=VM ${VmName} was set to the Unknown status.
 VM_MIGRATION_FAILED_FROM_TO=Migration Failed${DueToMigrationError}. (VM: 
${VmName}, Source Host: ${VdsName}, Destination Host:${VdsToName} ).
 VM_MIGRATION_START=Starting migration of VM ${VmName} from Host ${VdsName} to 
Host ${VdsDestination} (User: ${UserName}.).
+VM_MIGRATION_START_SYSTEM_INITIATED=System has initiated migration of VM 
${VmName} from Host ${VdsName} to Host ${VdsDestination}
 VM_MIGRATION_TRYING_RERUN=Migration failed${DueToMigrationError} (VM: 
${VmName}, Source Host: ${VdsName}). Trying to migrate to another Host.
 VM_CANCEL_MIGRATION=Migration cancelled for VM: ${VmName}
 VM_CANCEL_MIGRATION_FAILED=Failed to cancel migration for VM: ${VmName}
@@ -515,16 +516,16 @@
 RELOAD_CONFIGURATIONS_FAILURE=System Configurations failed to reload.
 USER_ACCOUNT_DISABLED_OR_LOCKED=User ${UserName} cannot login, as it got 
disabled or locked. Please contact the system administrator.
 USER_ACCOUNT_PASSWORD_EXPIRED=User ${UserName} cannot login, as the user 
account password has expired. Please contact the system administrator.
-IMPORTEXPORT_IMPORT_VM_INVALID_INTERFACES=While importing VM ${VmName}, the 
Network/s ${Networks} were found to be Non-VM Networks or do not exist in 
Cluster. Network Name was not set in the Interface/s ${Interfaces}.
-IMPORTEXPORT_IMPORT_TEMPLATE_INVALID_INTERFACES=While importing Template 
${VmTemplateName}, the Network/s ${Networks} were found to be Non-VM Networks 
or do not exist in Cluster. Network Name was not set in the Interface/s 
${Interfaces}.
-VDS_SET_NON_OPERATIONAL_VM_NETWORK_IS_BRIDGELESS=Host ${VdsName} does not 
comply with the cluster ${VdsGroupName} networks, the following VM networks are 
bridgeless: '${Networks}'
-# Gluster Messages
-GLUSTER_VOLUME_CREATE=Gluster Volume ${glusterVolumeName} created.
-GLUSTER_VOLUME_CREATE_FAILED=Creation of Gluster Volume ${glusterVolumeName} 
failed.
-GLUSTER_VOLUME_OPTION_SET=Volume Option set on  ${glusterVolumeName}.
-GLUSTER_VOLUME_OPTION_SET_FAILED=Volume Option could not be set on 
${glusterVolumeName}.
-GLUSTER_VOLUME_START=Gluster Volume ${glusterVolumeName} started.
-GLUSTER_VOLUME_START_FAILED=Could not start Gluster Volume 
${glusterVolumeName}.
+IMPORTEXPORT_IMPORT_VM_INVALID_INTERFACES=While importing VM ${VmName}, the 
Network/s ${Networks} were found to be Non-VM Networks or do not exist in 
Cluster. Network Name was not set in the Interface/s ${Interfaces}.
+IMPORTEXPORT_IMPORT_TEMPLATE_INVALID_INTERFACES=While importing Template 
${VmTemplateName}, the Network/s ${Networks} were found to be Non-VM Networks 
or do not exist in Cluster. Network Name was not set in the Interface/s 
${Interfaces}.
+VDS_SET_NON_OPERATIONAL_VM_NETWORK_IS_BRIDGELESS=Host ${VdsName} does not 
comply with the cluster ${VdsGroupName} networks, the following VM networks are 
bridgeless: '${Networks}'
+# Gluster Messages
+GLUSTER_VOLUME_CREATE=Gluster Volume ${glusterVolumeName} created.
+GLUSTER_VOLUME_CREATE_FAILED=Creation of Gluster Volume ${glusterVolumeName} 
failed.
+GLUSTER_VOLUME_OPTION_SET=Volume Option set on  ${glusterVolumeName}.
+GLUSTER_VOLUME_OPTION_SET_FAILED=Volume Option could not be set on 
${glusterVolumeName}.
+GLUSTER_VOLUME_START=Gluster Volume ${glusterVolumeName} started.
+GLUSTER_VOLUME_START_FAILED=Could not start Gluster Volume 
${glusterVolumeName}.
 GLUSTER_VOLUME_STOP=Gluster Volume ${glusterVolumeName} stopped.
 GLUSTER_VOLUME_STOP_FAILED=Could not stop Gluster Volume ${glusterVolumeName}.
 GLUSTER_VOLUME_OPTIONS_RESET=Gluster Volume ${glusterVolumeName} Options reset.


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

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

Reply via email to