mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-6465: vmware.reserve.mem is missing from cluster level settings
Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com> (cherry picked from commit eae733817b3670b0151410c027325f78013392ad)
This commit is contained in:
parent
93f8213412
commit
9585aa0b51
@ -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)) {
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user