Yaniv Bronhaim has uploaded a new change for review.

Change subject: Fix log print values when vdsm version is not supported in 
cluster
......................................................................

Fix log print values when vdsm version is not supported in cluster

Before we print the same log as we print when cluster supported version
is not compatible with VDS version.

Change-Id: Iacfb3875a0617f978b4453769a0b1c5704282fa5
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=974101
Signed-off-by: Yaniv Bronhaim <ybron...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HandleVdsVersionCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetNonOperationalVdsCommand.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/NonOperationalReason.java
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
M 
backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
6 files changed, 21 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/19/17719/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HandleVdsVersionCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HandleVdsVersionCommand.java
index 7b8b429..d68f549 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HandleVdsVersionCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HandleVdsVersionCommand.java
@@ -1,6 +1,7 @@
 package org.ovirt.engine.core.bll;
 
 import static 
org.ovirt.engine.core.common.businessentities.NonOperationalReason.VERSION_INCOMPATIBLE_WITH_CLUSTER;
+import static 
org.ovirt.engine.core.common.businessentities.NonOperationalReason.CLUSTER_VERSION_INCOMPATIBLE_WITH_CLUSTER;
 
 import java.util.HashMap;
 import java.util.HashSet;
@@ -65,13 +66,23 @@
 
         // move to non operational if vds-vdc version not supported OR cluster
         // version is not supported
-        if (!vdsmVersionSupported
-                || 
!VersionSupport.checkClusterVersionSupported(cluster.getcompatibility_version(),
 vds)) {
+        if (!vdsmVersionSupported) {
+            Map<String, String> customLogValues = new HashMap<String, 
String>();
+            customLogValues.put("CompatibilityVersion",
+                    Config.<HashSet<Version>> 
GetValue(ConfigValues.SupportedVDSMVersions).toString());
+            customLogValues.put("VdsSupportedVersions", 
vdsmVersion.toString());
+            SetNonOperationalVdsParameters tempVar = new 
SetNonOperationalVdsParameters(getVdsId(),
+                    VERSION_INCOMPATIBLE_WITH_CLUSTER,
+                    customLogValues);
+            tempVar.setSaveToDb(true);
+            
Backend.getInstance().runInternalAction(VdcActionType.SetNonOperationalVds, 
tempVar,  ExecutionHandler.createInternalJobContext());
+        }
+        if 
(!VersionSupport.checkClusterVersionSupported(cluster.getcompatibility_version(),
 vds)) {
             Map<String, String> customLogValues = new HashMap<String, 
String>();
             customLogValues.put("CompatibilityVersion", 
cluster.getcompatibility_version().toString());
             customLogValues.put("VdsSupportedVersions", 
vds.getSupportedClusterLevels());
             SetNonOperationalVdsParameters tempVar = new 
SetNonOperationalVdsParameters(getVdsId(),
-                    VERSION_INCOMPATIBLE_WITH_CLUSTER,
+                    CLUSTER_VERSION_INCOMPATIBLE_WITH_CLUSTER,
                     customLogValues);
             tempVar.setSaveToDb(true);
             
Backend.getInstance().runInternalAction(VdcActionType.SetNonOperationalVds, 
tempVar,  ExecutionHandler.createInternalJobContext());
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetNonOperationalVdsCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetNonOperationalVdsCommand.java
index c8a1897..7d6b710 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetNonOperationalVdsCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetNonOperationalVdsCommand.java
@@ -110,6 +110,8 @@
             return AuditLogType.VDS_RUN_IN_NO_KVM_MODE;
         case VERSION_INCOMPATIBLE_WITH_CLUSTER:
             return AuditLogType.VDS_VERSION_NOT_SUPPORTED_FOR_CLUSTER;
+        case CLUSTER_VERSION_INCOMPATIBLE_WITH_CLUSTER:
+            return AuditLogType.VDS_CLUSTER_VERSION_NOT_SUPPORTED;
         case VM_NETWORK_IS_BRIDGELESS:
             return 
AuditLogType.VDS_SET_NON_OPERATIONAL_VM_NETWORK_IS_BRIDGELESS;
         case GLUSTER_COMMAND_FAILED:
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 42cd84d..e28bb7a 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
@@ -372,6 +372,7 @@
     VM_NOT_RESPONDING(126),
     VDS_RUN_IN_NO_KVM_MODE(127),
     VDS_VERSION_NOT_SUPPORTED_FOR_CLUSTER(141),
+    VDS_CLUSTER_VERSION_NOT_SUPPORTED(10201),
     VM_CLEARED(129),
     VM_PAUSED_ENOSPC(138),
     VM_PAUSED_ERROR(139),
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/NonOperationalReason.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/NonOperationalReason.java
index d1c3aa0f..564d85b 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/NonOperationalReason.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/NonOperationalReason.java
@@ -19,6 +19,7 @@
     EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER(11),
     UNTRUSTED(10),
     UNINITIALIZED(11),
+    CLUSTER_VERSION_INCOMPATIBLE_WITH_CLUSTER(12),
     ;
 
     private final int value;
diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
index 66cc04c..1506d2e 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
@@ -272,6 +272,7 @@
         
severities.put(AuditLogType.VDS_ALERT_SECONDARY_AGENT_USED_FOR_FENCE_OPERATION, 
AuditLogSeverity.ALERT);
         severities.put(AuditLogType.VDS_RUN_IN_NO_KVM_MODE, 
AuditLogSeverity.ERROR);
         severities.put(AuditLogType.VDS_VERSION_NOT_SUPPORTED_FOR_CLUSTER, 
AuditLogSeverity.ERROR);
+        severities.put(AuditLogType.VDS_CLUSTER_VERSION_NOT_SUPPORTED, 
AuditLogSeverity.ERROR);
         severities.put(AuditLogType.VDS_CPU_LOWER_THAN_CLUSTER, 
AuditLogSeverity.WARNING);
         severities.put(AuditLogType.CPU_FLAGS_NX_IS_MISSING, 
AuditLogSeverity.WARNING);
         severities.put(AuditLogType.VDS_CPU_RETRIEVE_FAILED, 
AuditLogSeverity.WARNING);
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 ad4e5f5..9131029 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
@@ -348,7 +348,8 @@
 USER_FAILED_CLEAR_UNKNOWN_VMS=Failed to clear VMs' status on Non Responsive 
Host ${VdsName}. (User: ${UserName}).
 CERTIFICATE_FILE_NOT_FOUND=Could not find oVirt Engine Certificate file.
 VDS_RUN_IN_NO_KVM_MODE=Host ${VdsName} running without virtualization hardware 
acceleration
-VDS_VERSION_NOT_SUPPORTED_FOR_CLUSTER=Host ${VdsName} is compatible with 
versions (${VdsSupportedVersions}) and cannot join Cluster ${VdsGroupName} 
which is set to version ${CompatibilityVersion}.
+VDS_VERSION_NOT_SUPPORTED_FOR_CLUSTER=Host ${VdsName} is installed with VDS 
version (${VdsSupportedVersions}) and cannot join cluster ${VdsGroupName} which 
is compatible with VDS versions ${CompatibilityVersion}.
+VDS_CLUSTER_VERSION_NOT_SUPPORTED=Host ${VdsName} is compatible with versions 
(${VdsSupportedClusters}) and cannot join Cluster ${VdsGroupName} which is set 
to version ${CompatibilityVersion}.
 RUN_VM_FAILED=Cannot run VM ${VmName} on Host ${VdsName}. Error: ${ErrMsg}
 USER_ADD_PERMISSION=User/Group ${SubjectName} was granted permission for Role 
${RoleName} on ${VdcObjectType} ${VdcObjectName}, by ${UserName}.
 USER_ADD_PERMISSION_FAILED=User ${UserName} failed to grant permission for 
Role ${RoleName} on ${VdcObjectType} ${VdcObjectName} to User/Group 
${SubjectName}.


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iacfb3875a0617f978b4453769a0b1c5704282fa5
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybron...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to