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.
This commit is contained in:
Prachi Damle 2014-05-16 16:48:53 -07:00 committed by Daan Hoogland
parent 99dc7e009c
commit 0b99822262
2 changed files with 4 additions and 4 deletions

View File

@ -389,7 +389,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
vm.setDataCenterId(plan.getDataCenterId());
if (plan.getPodId() != null) {
vm.setPodId(plan.getPodId());
vm.setPodIdToDeployIn(plan.getPodId());
}
assert (plan.getClusterId() == null && plan.getPoolId() == null) : "We currently don't support cluster and pool preset yet";
final VMInstanceVO vmFinal = _vmDao.persist(vm);
@ -951,7 +951,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
}
long destHostId = dest.getHost().getId();
vm.setPodId(dest.getPod().getId());
vm.setPodIdToDeployIn(dest.getPod().getId());
Long cluster_id = dest.getCluster().getId();
ClusterDetailsVO cluster_detail_cpu = _clusterDetailsDao.findDetail(cluster_id, "cpuOvercommitRatio");
ClusterDetailsVO cluster_detail_ram = _clusterDetailsDao.findDetail(cluster_id, "memoryOvercommitRatio");
@ -1731,7 +1731,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
//when start the vm next time, don;'t look at last_host_id, only choose the host based on volume/storage pool
vm.setLastHostId(null);
vm.setPodId(destPool.getPodId());
vm.setPodIdToDeployIn(destPool.getPodId());
} else {
s_logger.debug("Storage migration failed");
}

View File

@ -417,7 +417,7 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
return podIdToDeployIn;
}
public void setPodId(Long podId) {
public void setPodIdToDeployIn(Long podId) {
this.podIdToDeployIn = podId;
}