mirror of https://github.com/apache/cloudstack.git
allow multiple clusters for baremetal planner
This commit is contained in:
parent
6534620208
commit
b4fffc9b30
|
|
@ -87,22 +87,20 @@ public class BareMetalPlanner implements DeploymentPlanner {
|
|||
}
|
||||
}
|
||||
|
||||
List<ClusterVO> clusters = _clusterDao.listByDcHyType(vm.getDataCenterIdToDeployIn(), HypervisorType.BareMetal.toString());
|
||||
if (clusters.size() != 1) {
|
||||
throw new CloudRuntimeException("Invaild baremetal cluster number " + clusters.size());
|
||||
}
|
||||
Cluster cluster = clusters.get(0);
|
||||
|
||||
List<ClusterVO> clusters = _clusterDao.listByDcHyType(vm.getDataCenterIdToDeployIn(), HypervisorType.BareMetal.toString());
|
||||
int cpu_requested;
|
||||
long ram_requested;
|
||||
HostVO target = null;
|
||||
List<HostVO> hosts = _hostDao.listByCluster(cluster.getId());
|
||||
if (hostTag != null) {
|
||||
for (HostVO h : hosts) {
|
||||
_hostDao.loadDetails(h);
|
||||
if (h.getDetail("hostTag") != null && h.getDetail("hostTag").equalsIgnoreCase(hostTag)) {
|
||||
target = h;
|
||||
break;
|
||||
for (ClusterVO cluster : clusters) {
|
||||
List<HostVO> hosts = _hostDao.listByCluster(cluster.getId());
|
||||
if (hostTag != null) {
|
||||
for (HostVO h : hosts) {
|
||||
_hostDao.loadDetails(h);
|
||||
if (h.getDetail("hostTag") != null
|
||||
&& h.getDetail("hostTag").equalsIgnoreCase(hostTag)) {
|
||||
target = h;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue