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>
This commit is contained in:
Anshul Gangwar 2014-11-19 09:38:18 +05:30 committed by Daan Hoogland
parent e6d00bcc66
commit 14e048dada
1 changed files with 14 additions and 3 deletions

View File

@ -950,7 +950,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);
@ -985,7 +988,7 @@ 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;
avoidAllSharedPools = false;
break;
}
}
@ -999,11 +1002,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) {