Gilad Chaplik has uploaded a new change for review.

Change subject: core: scheduling: remove migration filter
......................................................................

core: scheduling: remove migration filter

it seems that without migration filter (filters out the
'migration from' host), the scheduler can select the same source host.
solution: remove the migration filter, and in migrate
vm add the source host to the scheduler host black list.

Change-Id: Ibd1007bbc5be01043203cd4eff1aa52c6fb03a13
Bug-Url: https://bugzilla.redhat.com/1008153
Signed-off-by: Gilad Chaplik <gchap...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/PolicyUnitImpl.java
A packaging/dbscripts/upgrade/03_03_0910_remove_migration_filter.sql
3 files changed, 12 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/53/19653/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
index a400e6c..aff7f7c 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
@@ -91,7 +91,7 @@
         Guid vdsToRunOn =
                 SchedulingManager.getInstance().schedule(getVdsGroup(),
                         getVm(),
-                        getRunVdssList(),
+                        getVdsBlackList(),
                         getParameters().getInitialHosts(),
                         destVds == null ? null : destVds.getId(),
                         new ArrayList<String>(),
@@ -299,7 +299,7 @@
                 && validate(new 
DiskImagesValidator(ImagesHandler.getPluggedImagesForVm(vm.getId())).diskImagesNotLocked())
                 && SchedulingManager.getInstance().canSchedule(getVdsGroup(),
                         getVm(),
-                        getRunVdssList(),
+                        getVdsBlackList(),
                         getParameters().getInitialHosts(),
                         getVdsDestinationId(),
                         getReturnValue().getCanDoActionMessages());
@@ -380,4 +380,13 @@
         builder.append(String.format("$VmName %1$s", getVmName()));
         return builder.toString();
     }
+
+    // hosts that cannot be selected for scheduling (failed hosts + VM source 
host)
+    private List<Guid> getVdsBlackList() {
+        List<Guid> blackList = new ArrayList<Guid>(getRunVdssList());
+        if (getVdsId() != null) {
+            blackList.add(getVdsId());
+        }
+        return blackList;
+    }
 }
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/PolicyUnitImpl.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/PolicyUnitImpl.java
index db6ae79..d11adf2 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/PolicyUnitImpl.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/PolicyUnitImpl.java
@@ -9,7 +9,6 @@
 import 
org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionBalancePolicyUnit;
 import 
org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionWeightPolicyUnit;
 import org.ovirt.engine.core.bll.scheduling.policyunits.MemoryPolicyUnit;
-import org.ovirt.engine.core.bll.scheduling.policyunits.MigrationPolicyUnit;
 import org.ovirt.engine.core.bll.scheduling.policyunits.NetworkPolicyUnit;
 import org.ovirt.engine.core.bll.scheduling.policyunits.NoneBalancePolicyUnit;
 import org.ovirt.engine.core.bll.scheduling.policyunits.NoneWeightPolicyUnit;
@@ -33,8 +32,6 @@
 
     public static PolicyUnitImpl getPolicyUnitImpl(PolicyUnit policyUnit) {
         switch (policyUnit.getName()) {
-        case "Migration":
-            return new MigrationPolicyUnit(policyUnit);
         case "PinToHost":
             return new PinToHostPolicyUnit(policyUnit);
         case "CPU":
diff --git a/packaging/dbscripts/upgrade/03_03_0910_remove_migration_filter.sql 
b/packaging/dbscripts/upgrade/03_03_0910_remove_migration_filter.sql
new file mode 100644
index 0000000..50ee717
--- /dev/null
+++ b/packaging/dbscripts/upgrade/03_03_0910_remove_migration_filter.sql
@@ -0,0 +1 @@
+DELETE FROM policy_units WHERE id = '84e6ddee-ab0d-42dd-82f0-c297779db5e5';


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibd1007bbc5be01043203cd4eff1aa52c6fb03a13
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to