Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions 19 server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import javax.inject.Inject;
import javax.naming.ConfigurationException;

import com.cloud.utils.fsm.StateMachine2;
import org.apache.log4j.Logger;

import org.apache.cloudstack.affinity.AffinityGroupProcessor;
Expand Down Expand Up @@ -121,6 +120,7 @@
import com.cloud.utils.db.TransactionStatus;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.fsm.StateListener;
import com.cloud.utils.fsm.StateMachine2;
import com.cloud.vm.DiskProfile;
import com.cloud.vm.VMInstanceVO;
import com.cloud.vm.VirtualMachine;
Expand Down Expand Up @@ -990,7 +990,10 @@ private boolean canAvoidCluster(Cluster clusterVO, ExcludeList avoids, ExcludeLi

// 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);
Expand Down Expand Up @@ -1024,7 +1027,7 @@ private boolean canAvoidCluster(Cluster clusterVO, ExcludeList avoids, ExcludeLi
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;
}
}
Expand All @@ -1038,11 +1041,19 @@ private boolean canAvoidCluster(Cluster clusterVO, ExcludeList avoids, ExcludeLi
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) {
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.