Gilad Chaplik has uploaded a new change for review.

Change subject: core: support pin-to-any
......................................................................

core: support pin-to-any

Fixing a regression that forces to specify a host
for non-migratable VMs.

Change-Id: I10d60bb9db2506a63a19f5e75446ddac32b8dc3e
Bug-Url: https://bugzilla.redhat.com/1021574
Signed-off-by: Gilad Chaplik <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/PinToHostPolicyUnit.java
1 file changed, 11 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/24/21324/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/PinToHostPolicyUnit.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/PinToHostPolicyUnit.java
index acc3a07..aadf0fe 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/PinToHostPolicyUnit.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/PinToHostPolicyUnit.java
@@ -21,9 +21,17 @@
     @Override
     public List<VDS> filter(List<VDS> hosts, VM vm, Map<String, String> 
parameters, List<String> messages) {
         if (vm.getMigrationSupport() == MigrationSupport.PINNED_TO_HOST) {
-            for (VDS host : hosts) {
-                if (host.getId().equals(vm.getDedicatedVmForVds())) {
-                    return Arrays.asList(host);
+            // host has been specified for pin to host.
+            if(vm.getDedicatedVmForVds() != null) {
+                for (VDS host : hosts) {
+                    if (host.getId().equals(vm.getDedicatedVmForVds())) {
+                        return Arrays.asList(host);
+                    }
+                }
+            } else {
+                // check pin to any (the VM should be down/ no migration 
allowed).
+                if (vm.getRunOnVds() == null) {
+                    return hosts;
                 }
             }
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I10d60bb9db2506a63a19f5e75446ddac32b8dc3e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Gilad Chaplik <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to