Eldan Shachar has uploaded a new change for review.

Change subject: core: Fixed log for cluster unsupported emulated machine
......................................................................

core: Fixed log for cluster unsupported emulated machine

When a cluster upgrade occurred and a host didn't support the new
cluster requirement, the error that was given included the cluster
old emulated machine value (which the host did support).
Error printout logic was fixed and messages changed accordingly.

Change-Id: I8397cd64364c98aa76818613dbe78ddef2391027
Bug-Url: https://bugzilla.redhat.com/1141508
Signed-off-by: Eldan Shachar <eshac...@redhat.com>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/NonOperationalReason.java
M 
backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategy.java
3 files changed, 12 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/00/32900/1

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 609b7c2..1648308 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
@@ -23,7 +23,8 @@
     GLUSTER_HOST_UUID_ALREADY_EXISTS(15),
     ARCHITECTURE_INCOMPATIBLE_WITH_CLUSTER(16),
     NETWORK_INTERFACE_IS_DOWN(17),
-    RNG_SOURCES_INCOMPATIBLE_WITH_CLUSTER(18);
+    RNG_SOURCES_INCOMPATIBLE_WITH_CLUSTER(18),
+    EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER_LEVEL(19);
 
     private final int value;
 
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 0b10900..db47642 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
@@ -679,7 +679,8 @@
 IMPORTEXPORT_SNAPSHOT_VM_INVALID_INTERFACES=While previewing a snapshot of VM 
${EntityName}, 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}.
 ADD_VM_FROM_SNAPSHOT_INVALID_INTERFACES=While adding vm ${EntityName} from 
snapshot, 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 
non-VM networks: '${Networks}'
-EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER=Host ${VdsName} does not comply 
with the cluster ${VdsGroupName} emulated machines. The Hosts emulated machines 
are ${hostSupportedEmulatedMachines} and the cluster is 
${clusterEmulatedMachines}}
+EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER=Host ${VdsName} does not comply 
with the cluster ${VdsGroupName} emulated machine. The cluster emulated machine 
is ${clusterEmulatedMachines} and the host emulated machines are 
${hostSupportedEmulatedMachines}.
+EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER_LEVEL=Host ${VdsName} does not 
comply with the cluster ${VdsGroupName} emulated machines. The current cluster 
compatibility level supports ${clusterEmulatedMachines} and the host emulated 
machines are ${hostSupportedEmulatedMachines}.
 RNG_SOURCES_INCOMPATIBLE_WITH_CLUSTER=Host ${VdsName} does not comply with the 
cluster ${VdsGroupName} Random Number Generator sources. The Hosts supported 
sources are: ${hostSupportedRngSources}; and the cluster requirements are: 
${clusterRequiredRngSources}.
 # NUMA Messages
 NUMA_ADD_VM_NUMA_NODE_SUCCESS=Add VM NUMA node successfully.
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategy.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategy.java
index 9cf267a..7f14031 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategy.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategy.java
@@ -56,11 +56,15 @@
 
             Map<String, String> customLogValues = new HashMap<>();
             customLogValues.put("hostSupportedEmulatedMachines", 
vds.getSupportedEmulatedMachines());
-            customLogValues.put("clusterEmulatedMachines", 
StringUtils.isEmpty(vdsGroup.getEmulatedMachine()) ?
-                    
Config.<List<String>>getValue(ConfigValues.ClusterEmulatedMachines, 
vds.getVdsGroupCompatibilityVersion().getValue()).toString() :
-                    vdsGroup.getEmulatedMachine());
+            if(vdsGroup.isDetectEmulatedMachine()) {
+                
customLogValues.put("clusterEmulatedMachines",Config.<List<String>>getValue(ConfigValues.ClusterEmulatedMachines,
 vds.getVdsGroupCompatibilityVersion().getValue()).toString());
+                vdsNonOperational(vds, 
NonOperationalReason.EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER_LEVEL, 
customLogValues);
+            } else {
+                
customLogValues.put("clusterEmulatedMachines",vdsGroup.getEmulatedMachine());
+                vdsNonOperational(vds, 
NonOperationalReason.EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER, 
customLogValues);
+            }
 
-            vdsNonOperational(vds, 
NonOperationalReason.EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER, 
customLogValues);
+
             vds.setStatus(VDSStatus.NonOperational);
         }
 


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

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

Reply via email to