Skip to content

Commit 617ef5c

Browse files
committed
Bug 8208 - bare metal provisioning
set pod to external dhcp server when adding external dhcp server
1 parent d5abb20 commit 617ef5c

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎server/src/com/cloud/dc/HostPodVO.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ public boolean getExternalDhcp() {
141141
return externalDhcp;
142142
}
143143

144+
public void setExternalDhcp(boolean use) {
145+
externalDhcp = use;
146+
}
147+
144148
@Override
145149
public boolean equals(Object obj) {
146150
if (obj instanceof HostPodVO) {

‎server/src/com/cloud/dc/dao/ClusterDaoImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected ClusterDaoImpl() {
5858

5959
ZoneHyTypeSearch = createSearchBuilder();
6060
ZoneHyTypeSearch.and("hypervisorType", ZoneHyTypeSearch.entity().getHypervisorType(), SearchCriteria.Op.EQ);
61-
ZoneHyTypeSearch.and("dataCenterId", ZoneHyTypeSearch.entity().getPodId(), SearchCriteria.Op.EQ);
61+
ZoneHyTypeSearch.and("dataCenterId", ZoneHyTypeSearch.entity().getDataCenterId(), SearchCriteria.Op.EQ);
6262
ZoneHyTypeSearch.done();
6363

6464
PodSearch = createSearchBuilder();

‎server/src/com/cloud/deploy/BareMetalPlanner.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public DeployDestination plan(VirtualMachineProfile vmProfile, DeploymentPlan pl
5252
}
5353
}
5454

55-
List<ClusterVO> clusters = _clusterDao.listByHyTypeWithoutGuid(HypervisorType.BareMetal.name());
55+
List<ClusterVO> clusters = _clusterDao.listByDcHyType(vm.getDataCenterId(), HypervisorType.BareMetal.toString());
5656
if (clusters.size() != 1) {
5757
throw new CloudRuntimeException("Invaild baremetal cluster number " + clusters.size());
5858
}

0 commit comments

Comments
 (0)