Sahina Bose has uploaded a new change for review.

Change subject: engine: Version check for gluster network role feature
......................................................................

engine: Version check for gluster network role feature

Added a compat version check to see if the gluster
network role feature is supported.
This requires feature support from gluster to identify
a host with multiple names

Change-Id: I2cf926a5446b2489e65d844be692761e02e42639
Bug-Url: https://bugzilla.redhat.com/1049994
Signed-off-by: Sahina Bose <sab...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/cluster/NetworkClusterCommandBase.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/cluster/NetworkClusterValidatorBase.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/gluster/GlusterFeatureSupported.java
M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
M 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
M 
frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
M packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
9 files changed, 40 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/08/38708/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/cluster/NetworkClusterCommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/cluster/NetworkClusterCommandBase.java
index 9aef793..af5de79 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/cluster/NetworkClusterCommandBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/cluster/NetworkClusterCommandBase.java
@@ -46,6 +46,7 @@
         result = result && 
validate(validator.managementNetworkNotExternal(network));
         result = result && validate(validator.managementNetworkChange());
         result = result && validate(validator.migrationPropertySupported());
+        result = result && validate(validator.glusterNetworkSupported());
         result = result && (!getPersistedNetwork().isExternal() || 
validateExternalNetwork(validator));
 
         return result;
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/cluster/NetworkClusterValidatorBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/cluster/NetworkClusterValidatorBase.java
index 06ce9f1..525e816 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/cluster/NetworkClusterValidatorBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/cluster/NetworkClusterValidatorBase.java
@@ -6,6 +6,7 @@
 import org.ovirt.engine.core.common.businessentities.network.Network;
 import org.ovirt.engine.core.common.businessentities.network.NetworkCluster;
 import org.ovirt.engine.core.common.errors.VdcBllMessages;
+import org.ovirt.engine.core.common.gluster.GlusterFeatureSupported;
 import org.ovirt.engine.core.compat.Version;
 import org.ovirt.engine.core.dal.dbbroker.DbFacade;
 import org.ovirt.engine.core.dao.VdsDAO;
@@ -129,4 +130,17 @@
                         String.format(NETWORK_NAME_REPLACEMENT, networkName))
                 : ValidationResult.VALID;
     }
+
+    /**
+     * Make sure the gluster network is supported for the cluster version
+     *
+     * @param cluster
+     * @return error if gluster network role is not supported for the 
compatibility version
+     */
+    public ValidationResult glusterNetworkSupported() {
+        return networkCluster.isGluster()
+                && 
!GlusterFeatureSupported.glusterNetworkRoleSupported(version)
+                ? new 
ValidationResult(VdcBllMessages.GLUSTER_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL)
+                : ValidationResult.VALID;
+    }
 }
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
index 153e622..f5bb7a4 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
@@ -1451,6 +1451,10 @@
     @DefaultValueAttribute("300")
     GlusterRefreshRateSnapshotDiscovery,
 
+    @TypeConverterAttribute(Boolean.class)
+    @DefaultValueAttribute("true")
+    GlusterNetworkRoleSupported,
+
     @TypeConverterAttribute(String.class)
     @DefaultValueAttribute("AttestationService/resources/PollHosts")
     PollUri,
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
index be462f1..d5441c1 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
@@ -993,6 +993,7 @@
     
ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_ALREADY_DEACTIVATED(ErrorType.CONFLICT),
     
GLUSTER_TASKS_NOT_SUPPORTED_FOR_CLUSTER_LEVEL(ErrorType.INCOMPATIBLE_VERSION),
     
ACTION_TYPE_FAILED_STORAGE_PROVISIONING_NOT_SUPPORTED_BY_CLUSTER(ErrorType.NOT_SUPPORTED),
+    GLUSTER_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL(ErrorType.NOT_SUPPORTED),
 
     // OpenStack Glance
     ACTION_TYPE_FAILED_IMAGE_DOWNLOAD_ERROR(ErrorType.BAD_PARAMETERS),
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/gluster/GlusterFeatureSupported.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/gluster/GlusterFeatureSupported.java
index 369e05b..7985fe2 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/gluster/GlusterFeatureSupported.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/gluster/GlusterFeatureSupported.java
@@ -112,4 +112,16 @@
   public static boolean glusterBrickProvisioning(Version version) {
         return supportedInConfig(ConfigValues.GlusterBrickProvisioningEnabled, 
version);
   }
+
+  /**
+  *
+  * @param version
+  *            Compatibility version to check for.
+  * @return <code>true</code> if gluster supports peer probing by multiple 
interfaces via gluster network role
+  *         <code>false</code> if it's not.
+  */
+  public static boolean glusterNetworkRoleSupported(Version version) {
+      return supportedInConfig(ConfigValues.GlusterNetworkRoleSupported, 
version);
+  }
+
 }
diff --git 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
index 06fbeb2..6788b36 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
@@ -1060,6 +1060,7 @@
 ACTION_TYPE_FAILED_BASE_TEMPLATE_DOES_NOT_EXIST=Cannot ${action} ${type}. Base 
Template does not exist for this Template Version.
 
 NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL=Non-VM networks are not supported 
in this Data-Center.
+GLUSTER_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL=Gluster networks are not 
supported in this cluster compatibility version.
 
 VM_SLA_POLICY_NOT_SUPPORTED=VM SLA Policy is not supported in this Cluster.
 # Gluster Error Messages
diff --git 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
index 153c350..9720750 100644
--- 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
+++ 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
@@ -2848,6 +2848,9 @@
     @DefaultStringValue("Non-VM networks are not supported in this 
Data-Center.")
     String NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL();
 
+    @DefaultStringValue("Gluster networks are not supported in this cluster 
compatibility version.")
+    String GLUSTER_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL();
+
     @DefaultStringValue("Disk description must be formed only from 
alpha-numeric characters and special characters that conform to the standard 
ASCII character set.")
     String VALIDATION_DISK_DESCRIPTION_INVALID();
 
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
index b87ea06..48b4492 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
+++ 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
@@ -1048,6 +1048,7 @@
 ACTION_TYPE_FAILED_NETWORK_NOT_IN_CLUSTER=Failed ${action} ${type}. The 
following networks (${networks}) are not defined in the cluster.
 ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED=Failed ${action} ${type}. 
One or more network interfaces have incomplete network configuration. Please 
configure these interfaces and try again.
 NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL=Non-VM networks are not supported 
in this Data-Center.
+GLUSTER_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL=Gluster networks are not 
supported in this cluster compatibility version.
 VMPAYLOAD_INVALID_PAYLOAD_TYPE=VM Payload only supported in CDROM or Floppy 
devices
 VMPAYLOAD_SIZE_EXCEEDED=Payload is limited to ${size}K
 VMPAYLOAD_FLOPPY_EXCEEDED=Payload Floppy cannot be used when using an 
additional Floppy
diff --git a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql 
b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
index fb9e65a..4050429 100644
--- a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
+++ b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
@@ -175,6 +175,9 @@
 select 
fn_db_add_config_value('MountPointsToIgoreInGlusterStorageList','/,/home,/boot','general');
 select 
fn_db_add_config_value('FileSystemTypesToIgoreInGlusterStorageList','swap','general');
 
+-- Gluster Network Role --
+select 
fn_db_add_config_value_for_versions_up_to('GlusterNetworkRoleSupported', 
'false', '3.5');
+
 -- OpenStack related
 select fn_db_add_config_value('KeystoneAuthUrl', '', 'general');
 


-- 
To view, visit https://gerrit.ovirt.org/38708
To unsubscribe, visit https://gerrit.ovirt.org/settings

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

Reply via email to