Skip to content

Commit 1530c16

Browse files
author
Marcus Sorensen
committed
CLOUDSTACK-5968 create vm.memballoon.disable agent parameter
1 parent 29e2238 commit 1530c16

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

agent/conf/agent.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,7 @@ domr.scripts.dir=scripts/network/domr/kvm
114114
# for examples:"Conroe" "Penryn", "Nehalem", "Westmere", "pentiumpro" and so
115115
# on,run virsh capabilities for more details.
116116
# guest.cpu.model=
117+
#
118+
# vm.memballoon.disable=true
119+
# Disable memory ballooning on vm guests for overcommit, by default overcommit
120+
# feature enables balloon and sets currentMemory to a minimum value.

plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ protected String getDefaultScriptsDir() {
424424
private boolean _canBridgeFirewall;
425425
protected String _localStoragePath;
426426
protected String _localStorageUUID;
427+
protected boolean _noMemBalloon = false;
427428
protected String _guestCpuMode;
428429
protected String _guestCpuModel;
429430
private final Map<String, String> _pifs = new HashMap<String, String>();
@@ -771,6 +772,11 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
771772
value = (String)params.get("cmds.timeout");
772773
_cmdsTimeout = NumbersUtil.parseInt(value, 7200) * 1000;
773774

775+
value = (String) params.get("vm.memballoon.disable");
776+
if (Boolean.parseBoolean(value)) {
777+
_noMemBalloon = true;
778+
}
779+
774780
value = (String)params.get("host.reserved.mem.mb");
775781
_dom0MinMem = NumbersUtil.parseInt(value, 0) * 1024 * 1024;
776782

@@ -3426,7 +3432,7 @@ protected LibvirtVMDef createVMFromSpec(VirtualMachineTO vmTO) {
34263432

34273433
GuestResourceDef grd = new GuestResourceDef();
34283434

3429-
if (vmTO.getMinRam() != vmTO.getMaxRam()) {
3435+
if (vmTO.getMinRam() != vmTO.getMaxRam() && !_noMemBalloon) {
34303436
grd.setMemBalloning(true);
34313437
grd.setCurrentMem(vmTO.getMinRam() / 1024);
34323438
grd.setMemorySize(vmTO.getMaxRam() / 1024);

0 commit comments

Comments
 (0)