Martin Sivák has uploaded a new change for review.

Change subject: core: Use pin to host only when present in cluster policy
......................................................................

core: Use pin to host only when present in cluster policy

This removes the explicit pin to host check in scheduling.
The check is already present in cluster policy and will be used
when the policy unit is selected by the administrator.

Change-Id: If2c0496327c9f692b0dbe92e1cf481f900f4a747
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1007282
Signed-off-by: Martin Sivak <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/SchedulingManager.java
1 file changed, 6 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/84/19784/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/SchedulingManager.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/SchedulingManager.java
index 2f4190c..c18dd90 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/SchedulingManager.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/SchedulingManager.java
@@ -17,7 +17,6 @@
 import 
org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread;
 import org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerFactory;
 import org.ovirt.engine.core.common.businessentities.BusinessEntity;
-import org.ovirt.engine.core.common.businessentities.MigrationSupport;
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.businessentities.VDSGroup;
 import org.ovirt.engine.core.common.businessentities.VDSStatus;
@@ -219,22 +218,7 @@
             updateInitialHostList(vdsList, hostWhiteList, false);
             ClusterPolicy policy = policyMap.get(cluster.getClusterPolicyId());
             Map<String, String> parameters = 
createClusterPolicyParameters(cluster);
-            if (destHostId != null) {
-                if (checkDestinationHost(vm,
-                        vdsList,
-                        destHostId,
-                        messages,
-                        policy,
-                        parameters,
-                        memoryChecker)) {
-                    result.setVdsSelected(destHostId);
-                    return result;
-                } else if (vm.getMigrationSupport() == 
MigrationSupport.PINNED_TO_HOST) {
-                    result.setMessage("VM "+ vm.getId().toString()+" cannot be 
migrated because it is pinned to host");
-                    log.info(result.getMessage());
-                    return result;
-                }
-            }
+
             vdsList =
                     runFilters(policy.getFilters(),
                             vdsList,
@@ -246,6 +230,10 @@
                             correlationId, result);
 
             if (vdsList == null || vdsList.size() == 0) {
+                return result;
+            }
+            if (vdsList != null && vdsList.contains(destHostId)) {
+                result.setVdsSelected(destHostId);
                 return result;
             }
             if (policy.getFunctions() == null || 
policy.getFunctions().isEmpty()) {
@@ -280,19 +268,7 @@
         updateInitialHostList(vdsList, vdsWhiteList, false);
         ClusterPolicy policy = policyMap.get(cluster.getClusterPolicyId());
         Map<String, String> parameters = 
createClusterPolicyParameters(cluster);
-        if (destVdsId != null) {
-            if (checkDestinationHost(vm,
-                    vdsList,
-                    destVdsId,
-                    messages,
-                    policy,
-                    parameters,
-                    noWaitingMemoryChecker)) {
-                return true;
-            } else if (vm.getMigrationSupport() == 
MigrationSupport.PINNED_TO_HOST) {
-                return false;
-            }
-        }
+
         vdsList =
                 runFilters(policy.getFilters(),
                         vdsList,


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

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

Reply via email to