mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Revert "Merge branch 'CLOUDSTACK-7703' of https://github.com/anshul1886/cloudstack-1"
This reverts commit d5b6fc4f04450bb2ff733f2eaf1ae800578be567, reversing changes made to 91ffaaa5a2163b2b62868097dea587bd712061d8.
This commit is contained in:
parent
d5b6fc4f04
commit
3a4d70e696
@ -31,6 +31,7 @@ import javax.ejb.Local;
|
||||
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;
|
||||
@ -120,7 +121,6 @@ import com.cloud.utils.db.TransactionCallback;
|
||||
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;
|
||||
@ -990,10 +990,7 @@ StateListener<State, VirtualMachine.Event, VirtualMachine> {
|
||||
|
||||
// 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;
|
||||
boolean avoidAllPools = true;
|
||||
boolean avoidAllLocalPools = true;
|
||||
boolean avoidAllSharedPools = true;
|
||||
boolean avoidAllHosts = true, avoidAllPools = true;
|
||||
|
||||
List<HostVO> allhostsInCluster =
|
||||
_hostDao.listAllUpAndEnabledNonHAHosts(Host.Type.Routing, clusterVO.getId(), clusterVO.getPodId(), clusterVO.getDataCenterId(), null);
|
||||
@ -1027,7 +1024,7 @@ StateListener<State, VirtualMachine.Event, VirtualMachine> {
|
||||
for (StoragePoolVO pool : allPoolsInCluster) {
|
||||
if (!allocatorAvoidOutput.shouldAvoid(pool)) {
|
||||
// there's some pool in the cluster that is not yet in avoid set
|
||||
avoidAllSharedPools = false;
|
||||
avoidAllPools = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1041,19 +1038,11 @@ StateListener<State, VirtualMachine.Event, VirtualMachine> {
|
||||
if (!allocatorAvoidOutput.shouldAvoid(pool)) {
|
||||
// there's some pool in the cluster that is not yet
|
||||
// in avoid set
|
||||
avoidAllLocalPools = false;
|
||||
avoidAllPools = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (vmRequiresSharedStorage && vmRequiresLocalStorege) {
|
||||
avoidAllPools = (avoidAllLocalPools || avoidAllSharedPools) ? true : false;
|
||||
} else if (vmRequiresSharedStorage) {
|
||||
avoidAllPools = avoidAllSharedPools;
|
||||
} else if (vmRequiresLocalStorege) {
|
||||
avoidAllPools = avoidAllLocalPools;
|
||||
}
|
||||
}
|
||||
|
||||
if (avoidAllHosts || avoidAllPools) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user