cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/4.4 to 5b62095
Date Wed, 19 Nov 2014 11:04:07 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 f18d6238b -> 5b620951a


CLOUDSTACK-7752: Fixed deployment planner stuck in infinite loop. If we create VM with shared
service offering and attach disk with local disk offering, and one of storage pool is full(cannot
be allocated) and other is not full then we are not putting the cluster in avoid list which
is causing this infinite loop.

Fixed by putting the cluster in avoid list even if one of the storage pool is full(cannot
be allocated)

Signed-off-by: Daan Hoogland <daan@onecht.net>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5b620951
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5b620951
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5b620951

Branch: refs/heads/4.4
Commit: 5b620951a399188bd956f1198cd35d96b4008862
Parents: f18d623
Author: Anshul Gangwar <anshul.gangwar@citrix.com>
Authored: Wed Nov 19 16:16:46 2014 +0530
Committer: Daan Hoogland <daan@onecht.net>
Committed: Wed Nov 19 12:03:30 2014 +0100

----------------------------------------------------------------------
 .../deploy/DeploymentPlanningManagerImpl.java   | 24 +++++++++++++++-----
 1 file changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b620951/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
index 0e02d1b..c8eb16e 100644
--- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -31,6 +31,8 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
+import org.apache.log4j.Logger;
+
 import org.apache.cloudstack.affinity.AffinityGroupProcessor;
 import org.apache.cloudstack.affinity.AffinityGroupService;
 import org.apache.cloudstack.affinity.AffinityGroupVMMapVO;
@@ -49,8 +51,7 @@ import org.apache.cloudstack.managed.context.ManagedContextTimerTask;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 import org.apache.cloudstack.utils.identity.ManagementServerNode;
-import org.apache.log4j.Logger;
-
+
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.Listener;
 import com.cloud.agent.api.AgentControlAnswer;
@@ -991,7 +992,10 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
 
         // if all hosts or all pools in the cluster are in avoid set after this
         // pass, then put the cluster in avoid set.
-        boolean avoidAllHosts = true, avoidAllPools = true;
+        boolean avoidAllHosts = true;
+        boolean avoidAllPools = true;
+        boolean avoidAllLocalPools = true;
+        boolean avoidAllSharedPools = true;
 
         List<HostVO> allhostsInCluster =
             _hostDao.listAllUpAndEnabledNonHAHosts(Host.Type.Routing, clusterVO.getId(),
clusterVO.getPodId(), clusterVO.getDataCenterId(), null);
@@ -1025,8 +1029,8 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
         for (StoragePoolVO pool : allPoolsInCluster) {
             if (!allocatorAvoidOutput.shouldAvoid(pool)) {
                 // there's some pool in the cluster that is not yet in avoid set
-                avoidAllPools = false;
-                    break;
+                        avoidAllSharedPools = false;
+                        break;
                 }
             }
             }
@@ -1039,11 +1043,19 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
                     if (!allocatorAvoidOutput.shouldAvoid(pool)) {
                         // there's some pool in the cluster that is not yet
                         // in avoid set
-                        avoidAllPools = false;
+                        avoidAllLocalPools = false;
                         break;
                     }
                 }
             }
+
+            if (vmRequiresSharedStorage && vmRequiresLocalStorege) {
+                avoidAllPools = (avoidAllLocalPools || avoidAllSharedPools) ? true : false;
+            } else if (vmRequiresSharedStorage) {
+                avoidAllPools = avoidAllSharedPools;
+            } else if (vmRequiresLocalStorege) {
+                avoidAllPools = avoidAllLocalPools;
+            }
         }
 
         if (avoidAllHosts || avoidAllPools) {


Mime
View raw message