CLOUDSTACK-9683: system.vm.default.hypervisor will pin the hypervisor for VR too with this fix

This commit is contained in:
Abhinandan Prateek 2016-12-19 13:06:02 +05:30
parent de7a06efec
commit ca8a00442c
3 changed files with 3 additions and 3 deletions

View File

@ -977,6 +977,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
_uservmDetailsDao.addDetail(vm.getId(), "cpuOvercommitRatio", cluster_detail_cpu.getValue(), true);
_uservmDetailsDao.addDetail(vm.getId(), "memoryOvercommitRatio", cluster_detail_ram.getValue(), true);
}
vmProfile.setCpuOvercommitRatio(Float.parseFloat(cluster_detail_cpu.getValue()));
vmProfile.setMemoryOvercommitRatio(Float.parseFloat(cluster_detail_ram.getValue()));
StartAnswer startAnswer = null;
@ -993,7 +994,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
if (s_logger.isDebugEnabled()) {
s_logger.debug("VM is being created in podId: " + vm.getPodIdToDeployIn());
}
_networkMgr.prepare(vmProfile, dest, ctx);
_networkMgr.prepare(vmProfile, new DeployDestination(dest.getDataCenter(), dest.getPod(), null, null), ctx);
if (vm.getHypervisorType() != HypervisorType.BareMetal) {
volumeMgr.prepare(vmProfile, dest);
}

View File

@ -136,7 +136,7 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
assert nic.getTrafficType() == TrafficType.Control;
// we have to get management/private ip for the control nic for vmware/hyperv due ssh issues.
HypervisorType hType = dest.getHost().getHypervisorType();
HypervisorType hType = vm.getHypervisorType();
if (((hType == HypervisorType.VMware) || (hType == HypervisorType.Hyperv)) && isRouterVm(vm)) {
if (dest.getDataCenter().getNetworkType() != NetworkType.Basic) {
super.reserve(nic, config, vm, dest, context);

View File

@ -544,7 +544,6 @@ public class NetworkHelperImpl implements NetworkHelper {
protected List<HypervisorType> getHypervisors(final RouterDeploymentDefinition routerDeploymentDefinition) throws InsufficientServerCapacityException {
final DeployDestination dest = routerDeploymentDefinition.getDest();
List<HypervisorType> hypervisors = new ArrayList<HypervisorType>();
if (dest.getCluster() != null) {
if (dest.getCluster().getHypervisorType() == HypervisorType.Ovm) {
hypervisors.add(getClusterToStartDomainRouterForOvm(dest.getCluster().getPodId()));