mirror of https://github.com/apache/cloudstack.git
parent
b4fffc9b30
commit
cc6bf73760
|
|
@ -114,13 +114,19 @@ public class BareMetalPlanner implements DeploymentPlanner {
|
|||
ram_requested = target.getTotalMemory();
|
||||
}
|
||||
|
||||
for (HostVO h : hosts) {
|
||||
if (h.getStatus() == Status.Up) {
|
||||
if(_capacityMgr.checkIfHostHasCapacity(h.getId(), cpu_requested, ram_requested, false, cpuOverprovisioningFactor)){
|
||||
s_logger.debug("Find host " + h.getId() + " has enough capacity");
|
||||
DataCenter dc = _dcDao.findById(h.getDataCenterId());
|
||||
Pod pod = _podDao.findById(h.getPodId());
|
||||
return new DeployDestination(dc, pod, cluster, h);
|
||||
for (ClusterVO cluster : clusters) {
|
||||
List<HostVO> hosts = _hostDao.listByCluster(cluster.getId());
|
||||
for (HostVO h : hosts) {
|
||||
if (h.getStatus() == Status.Up) {
|
||||
if (_capacityMgr.checkIfHostHasCapacity(h.getId(),
|
||||
cpu_requested, ram_requested, false,
|
||||
cpuOverprovisioningFactor)) {
|
||||
s_logger.debug("Find host " + h.getId()
|
||||
+ " has enough capacity");
|
||||
DataCenter dc = _dcDao.findById(h.getDataCenterId());
|
||||
Pod pod = _podDao.findById(h.getPodId());
|
||||
return new DeployDestination(dc, pod, cluster, h);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue