CLOUDSTACK-6465: vmware.reserve.mem is missing from cluster level settings Signed-off-by: Rajani Karuturi <rajanikarut...@gmail.com> (cherry picked from commit eae733817b3670b0151410c027325f78013392ad)
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9585aa0b Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9585aa0b Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9585aa0b Branch: refs/heads/useraccount-refactoring Commit: 9585aa0b51a571d5ea3c33c98bec13f5230ecf4a Parents: 93f8213 Author: Harikrishna Patnala <harikrishna.patn...@citrix.com> Authored: Mon Nov 10 14:30:42 2014 +0530 Committer: Rajani Karuturi <rajanikarut...@gmail.com> Committed: Tue Nov 25 15:55:54 2014 +0530 ---------------------------------------------------------------------- .../src/com/cloud/hypervisor/guru/VMwareGuru.java | 8 ++++---- .../vmware/manager/VmwareManagerImpl.java | 13 ------------- .../vmware/resource/VmwareResource.java | 18 ++++-------------- server/src/com/cloud/configuration/Config.java | 16 ---------------- 4 files changed, 8 insertions(+), 47 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9585aa0b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java index 7c23699..c0711f2 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java @@ -149,11 +149,11 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru, Co super(); } - static final ConfigKey<Boolean> VmwareReserveCpu = new ConfigKey<Boolean>(Boolean.class, "vmware.reserve.cpu", "Advanced", "false", + public static final ConfigKey<Boolean> VmwareReserveCpu = new ConfigKey<Boolean>(Boolean.class, "vmware.reserve.cpu", "Advanced", "false", "Specify whether or not to reserve CPU when not overprovisioning, In case of cpu overprovisioning we will always reserve cpu.", true, ConfigKey.Scope.Cluster, null); - static final ConfigKey<Boolean> VmwareReserveMemory = new ConfigKey<Boolean>(Boolean.class, "vmware.reserve.cpu", "Advanced", "false", + public static final ConfigKey<Boolean> VmwareReserveMemory = new ConfigKey<Boolean>(Boolean.class, "vmware.reserve.mem", "Advanced", "false", "Specify whether or not to reserve memory when not overprovisioning, In case of memory overprovisioning we will always reserve memory.", true, ConfigKey.Scope.Cluster, null); @@ -221,8 +221,8 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru, Co } long clusterId = getClusterId(vm.getId()); - details.put(Config.VmwareReserveCpu.key(), VmwareReserveCpu.valueIn(clusterId).toString()); - details.put(Config.VmwareReserveMem.key(), VmwareReserveMemory.valueIn(clusterId).toString()); + details.put(VmwareReserveCpu.key(), VmwareReserveCpu.valueIn(clusterId).toString()); + details.put(VmwareReserveMemory.key(), VmwareReserveMemory.valueIn(clusterId).toString()); to.setDetails(details); if (vmType.equals(VirtualMachine.Type.DomainRouter)) { http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9585aa0b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java index 4f24882..3b2c73f 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java @@ -183,10 +183,6 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw private int _routerExtraPublicNics = 2; private int _vCenterSessionTimeout = 1200000; // Timeout in milliseconds - private String _reserveCpu = "false"; - - private String _reserveMem = "false"; - private String _rootDiskController = DiskControllerType.ide.toString(); private final Map<String, String> _storageMounts = new HashMap<String, String>(); @@ -284,15 +280,6 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw _vCenterSessionTimeout = NumbersUtil.parseInt(_configDao.getValue(Config.VmwareVcenterSessionTimeout.key()), 1200) * 1000; s_logger.info("VmwareManagerImpl config - vmware.vcenter.session.timeout: " + _vCenterSessionTimeout); - _reserveCpu = _configDao.getValue(Config.VmwareReserveCpu.key()); - if (_reserveCpu == null || _reserveCpu.isEmpty()) { - _reserveCpu = "false"; - } - _reserveMem = _configDao.getValue(Config.VmwareReserveMem.key()); - if (_reserveMem == null || _reserveMem.isEmpty()) { - _reserveMem = "false"; - } - _recycleHungWorker = _configDao.getValue(Config.VmwareRecycleHungWorker.key()); if (_recycleHungWorker == null || _recycleHungWorker.isEmpty()) { _recycleHungWorker = "false"; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9585aa0b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java index 6596057..7e1b7cc 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java @@ -207,12 +207,12 @@ import com.cloud.agent.api.to.VirtualMachineTO; import com.cloud.agent.api.to.VolumeTO; import com.cloud.agent.resource.virtualnetwork.VirtualRouterDeployer; import com.cloud.agent.resource.virtualnetwork.VirtualRoutingResource; -import com.cloud.configuration.Config; import com.cloud.dc.DataCenter.NetworkType; import com.cloud.dc.Vlan; import com.cloud.exception.CloudException; import com.cloud.exception.InternalErrorException; import com.cloud.host.Host.Type; +import com.cloud.hypervisor.guru.VMwareGuru; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.vmware.manager.VmwareHostService; import com.cloud.hypervisor.vmware.manager.VmwareManager; @@ -304,8 +304,6 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa protected int _portsPerDvPortGroup; protected boolean _fullCloneFlag = false; protected boolean _instanceNameFlag = false; - protected boolean _reserveCpu; - protected boolean _reserveMem; protected boolean _recycleHungWorker = false; protected DiskControllerType _rootDiskController = DiskControllerType.ide; @@ -1759,14 +1757,14 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa } int getReservedMemoryMb(VirtualMachineTO vmSpec) { - if (vmSpec.getDetails().get(Config.VmwareReserveMem.key()).equalsIgnoreCase("true")) { + if (vmSpec.getDetails().get(VMwareGuru.VmwareReserveMemory.key()).equalsIgnoreCase("true")) { return (int) (vmSpec.getMinRam() / (1024 * 1024)); } return 0; } int getReservedCpuMHZ(VirtualMachineTO vmSpec) { - if (vmSpec.getDetails().get(Config.VmwareReserveCpu.key()).equalsIgnoreCase("true")) { + if (vmSpec.getDetails().get(VMwareGuru.VmwareReserveCpu.key()).equalsIgnoreCase("true")) { return vmSpec.getMinSpeed(); } return 0; @@ -4735,18 +4733,10 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa _privateNetworkVSwitchName = (String)params.get("private.network.vswitch.name"); } - String value = (String)params.get("vmware.reserve.cpu"); - if (value != null && value.equalsIgnoreCase("true")) - _reserveCpu = true; - - value = (String)params.get("vmware.recycle.hung.wokervm"); + String value = (String)params.get("vmware.recycle.hung.wokervm"); if (value != null && value.equalsIgnoreCase("true")) _recycleHungWorker = true; - value = (String)params.get("vmware.reserve.mem"); - if (value != null && value.equalsIgnoreCase("true")) - _reserveMem = true; - value = (String)params.get("vmware.root.disk.controller"); if (value != null && value.equalsIgnoreCase("scsi")) _rootDiskController = DiskControllerType.scsi; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9585aa0b/server/src/com/cloud/configuration/Config.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java index 435b0d8..0ef0e25 100644 --- a/server/src/com/cloud/configuration/Config.java +++ b/server/src/com/cloud/configuration/Config.java @@ -1190,22 +1190,6 @@ public enum Config { "Start port number of additional VNC port range", null), //VmwareGuestNicDeviceType("Advanced", ManagementServer.class, String.class, "vmware.guest.nic.device.type", "E1000", "Ethernet card type used in guest VM, valid values are E1000, PCNet32, Vmxnet2, Vmxnet3", null), - VmwareReserveCpu( - "Advanced", - ManagementServer.class, - Boolean.class, - "vmware.reserve.cpu", - "false", - "Specify whether or not to reserve CPU based on CPU overprovisioning factor", - null), - VmwareReserveMem( - "Advanced", - ManagementServer.class, - Boolean.class, - "vmware.reserve.mem", - "false", - "Specify whether or not to reserve memory based on memory overprovisioning factor", - null), VmwareRootDiskControllerType( "Advanced", ManagementServer.class,