Martin Peřina has uploaded a new change for review.

Change subject: core: Display warning when fencing is disabled in cluster
......................................................................

core: Display warning when fencing is disabled in cluster

Displays warning during add/update cluster if fencing is disabled in
fencing policy of the cluster.

Change-Id: I4853b349571523fbb4dac54cae45d9d6a9df01f3
Bug-Url: https://bugzilla.redhat.com/1120858
Signed-off-by: Martin Perina <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsGroupCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsGroupCommand.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(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/58/31258/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsGroupCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsGroupCommand.java
index 2d1feae..9e111a2 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsGroupCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsGroupCommand.java
@@ -19,6 +19,8 @@
 import org.ovirt.engine.core.common.validation.group.CreateEntity;
 import org.ovirt.engine.core.compat.Version;
 import org.ovirt.engine.core.dal.dbbroker.DbFacade;
+import org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector;
+import org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase;
 import org.ovirt.engine.core.utils.NetworkUtils;
 import org.ovirt.engine.core.utils.linq.LinqUtils;
 import org.ovirt.engine.core.utils.linq.Predicate;
@@ -41,6 +43,12 @@
         getVdsGroup().setDetectEmulatedMachine(true);
         DbFacade.getInstance().getVdsGroupDao().save(getVdsGroup());
 
+        if (!getVdsGroup().getFencingPolicy().isFencingEnabled()) {
+            AuditLogableBase alb = new AuditLogableBase();
+            alb.setVdsGroupId(getVdsGroup().getId());
+            AuditLogDirector.log(alb, 
AuditLogType.FENCING_DISABLED_IN_CLUSTER_POLICY);
+        }
+
         // add default network
         if (getParameters().getVdsGroup().getStoragePoolId() != null) {
             final String networkName = NetworkUtils.getEngineNetwork();
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsGroupCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsGroupCommand.java
index c75cb0b..d163fc6 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsGroupCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsGroupCommand.java
@@ -115,6 +115,12 @@
                     true));
         }
 
+        if (!getVdsGroup().getFencingPolicy().isFencingEnabled()) {
+            AuditLogableBase alb = new AuditLogableBase();
+            alb.setVdsGroupId(getParameters().getVdsGroup().getId());
+            AuditLogDirector.log(alb, 
AuditLogType.FENCING_DISABLED_IN_CLUSTER_POLICY);
+        }
+
         setSucceeded(true);
     }
 
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 f19fb4d..e654470 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
@@ -105,6 +105,7 @@
             AuditLogTimeInterval.MINUTE.getValue()),
     VDS_NOT_RESTARTED_DUE_TO_POLICY(618),
     VDS_FENCE_DISABLED_BY_CLUSTER_POLICY(620),
+    FENCING_DISABLED_IN_CLUSTER_POLICY(621, AuditLogSeverity.WARNING),
 
     // Host time drift Alert
     VDS_TIME_DRIFT_ALERT(604, 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 74193bb..a985ab2 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
@@ -577,6 +577,7 @@
 SYSTEM_VDS_RESTART=Host ${VdsName} was restarted by the engine.
 SYSTEM_FAILED_VDS_RESTART=A restart initiated by the engine to Host ${VdsName} 
has failed.
 VDS_FENCE_DISABLED_BY_CLUSTER_POLICY=Host ${VdsName} was not fenced, fencing 
is disabled in Fencing Policy of the Cluster.
+FENCING_DISABLED_IN_CLUSTER_POLICY=Fencing is disabled in Fencing Policy of 
the Cluster ${VdsGroupName}, so VM operations on HA VMs in the Cluster are 
currently limited.
 VDS_TIME_DRIFT_ALERT=Host ${VdsName} has time-drift of ${Actual} seconds while 
maximum configured value is ${Max} seconds.
 PROXY_HOST_SELECTION=Host ${Proxy} from ${Origin} was chosen as a proxy to 
execute ${Command} command on Host ${VdsName}.
 RECONSTRUCT_MASTER_FAILED_NO_MASTER=No valid Data Storage Domains are 
available in Data Center ${StoragePoolName} (please check your storage 
infrastructure).


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

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

Reply via email to