Skip to content

Commit 0b99822

Browse files
Prachi DamleDaanHoogland
authored andcommitted
CLOUDSTACK-6476: Basic Zone with Multiple Pods Setup: DHCP server doesnt get deployed in the pod where the VM gets deployed
Changes: PodId in which the router should get started was not being saved to the DB due to the VO's setter method not following the setXXX format. So when planner loaded the router from DB, it always got podId as null and that would allow planner to deploy the router in any pod. If the router happens to start in a different pod than the user VM, the Vm fails to start since the Dhcp service check fails. Fixed the VO's setPodId method, that was causing the DB save operation fail.
1 parent 99dc7e0 commit 0b99822

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ public void allocate(String vmInstanceName, final VirtualMachineTemplate templat
389389

390390
vm.setDataCenterId(plan.getDataCenterId());
391391
if (plan.getPodId() != null) {
392-
vm.setPodId(plan.getPodId());
392+
vm.setPodIdToDeployIn(plan.getPodId());
393393
}
394394
assert (plan.getClusterId() == null && plan.getPoolId() == null) : "We currently don't support cluster and pool preset yet";
395395
final VMInstanceVO vmFinal = _vmDao.persist(vm);
@@ -951,7 +951,7 @@ public void orchestrateStart(String vmUuid, Map<VirtualMachineProfile.Param, Obj
951951
}
952952

953953
long destHostId = dest.getHost().getId();
954-
vm.setPodId(dest.getPod().getId());
954+
vm.setPodIdToDeployIn(dest.getPod().getId());
955955
Long cluster_id = dest.getCluster().getId();
956956
ClusterDetailsVO cluster_detail_cpu = _clusterDetailsDao.findDetail(cluster_id, "cpuOvercommitRatio");
957957
ClusterDetailsVO cluster_detail_ram = _clusterDetailsDao.findDetail(cluster_id, "memoryOvercommitRatio");
@@ -1731,7 +1731,7 @@ private void orchestrateStorageMigration(String vmUuid, StoragePool destPool) {
17311731

17321732
//when start the vm next time, don;'t look at last_host_id, only choose the host based on volume/storage pool
17331733
vm.setLastHostId(null);
1734-
vm.setPodId(destPool.getPodId());
1734+
vm.setPodIdToDeployIn(destPool.getPodId());
17351735
} else {
17361736
s_logger.debug("Storage migration failed");
17371737
}

‎engine/schema/src/com/cloud/vm/VMInstanceVO.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ public Long getPodIdToDeployIn() {
417417
return podIdToDeployIn;
418418
}
419419

420-
public void setPodId(Long podId) {
420+
public void setPodIdToDeployIn(Long podId) {
421421
this.podIdToDeployIn = podId;
422422
}
423423

0 commit comments

Comments
 (0)