Yaniv Bronhaim has uploaded a new change for review.

Change subject: Allow activate hosts that support the engine's version
......................................................................

Allow activate hosts that support the engine's version

HandleVdsVersion prevented activation of any hosts with vdsm version that
was not supported by the engine (SupportedVDSMVersions). This patch
adds validation for the installed Vdsm's supportedENGINEs value. If one of the
two is supported we can allow the activation.

Vdsm minor version might bumped up after new present feature, major
version doesn't change in such case. Under the vdsm capabilities we define the
supported engine's version to allow working with new features even
though the engine's version wasn't changed. If the vdsm version supports the
engine's version its enough to allow the activation.

This check was omitted as part of http://gerrit.ovirt.org/#/c/17719

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1016461
Change-Id: I70b10f9ede37de858df0aa88185c75f2d84fc141
Signed-off-by: Yaniv Bronhaim <ybron...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HandleVdsVersionCommand.java
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/92/19992/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 404ec21..da14207 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
@@ -4,6 +4,7 @@
 import java.util.HashSet;
 import java.util.Map;
 
+import org.apache.commons.lang.StringUtils;
 import org.ovirt.engine.core.bll.job.ExecutionHandler;
 import org.ovirt.engine.core.bll.utils.VersionSupport;
 import org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters;
@@ -44,14 +45,21 @@
     protected void executeCommand() {
         VDS vds = getVds();
         VDSGroup cluster = getVdsGroup();
+        boolean vdsmVersionSupportedByEngine = false;
 
         // check that vdc support vds OR vds support vdc
+        Version partialVdcVersion =
+                new Version(new Version(Config.<String> 
GetValue(ConfigValues.VdcVersion)).toString(2));
         RpmVersion vdsVersion = vds.getVersion();
         Version vdsmVersion = new 
Version(vdsVersion.getMajor(),vdsVersion.getMinor());
+        if (!StringUtils.isEmpty(vds.getSupportedEngines())) {
+            vdsmVersionSupportedByEngine = 
vds.getSupportedENGINESVersionsSet().contains(partialVdcVersion);
+        }
 
         // move to non operational if vds-vdc version not supported OR cluster
         // version is not supported
-        if (!Config.<HashSet<Version>> 
GetValue(ConfigValues.SupportedVDSMVersions).contains(vdsmVersion)) {
+        if (!vdsmVersionSupportedByEngine &&
+            !Config.<HashSet<Version>> 
GetValue(ConfigValues.SupportedVDSMVersions).contains(vdsmVersion)) {
             
reportNonOperationReason(NonOperationalReason.VERSION_INCOMPATIBLE_WITH_CLUSTER,
                                      Config.<HashSet<Version>> 
GetValue(ConfigValues.SupportedVDSMVersions).toString(),
                                      vdsmVersion.toString());


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I70b10f9ede37de858df0aa88185c75f2d84fc141
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