CLOUDSTACK-5968 create vm.memballoon.disable agent parameter

This commit is contained in:
Marcus Sorensen 2014-01-28 15:32:37 -07:00
parent 77aeb2871b
commit e624632dfd
2 changed files with 9 additions and 1 deletions

View File

@ -374,6 +374,7 @@ ServerResource {
private boolean _can_bridge_firewall;
protected String _localStoragePath;
protected String _localStorageUUID;
protected boolean _noMemBalloon = false;
protected String _guestCpuMode;
protected String _guestCpuModel;
private final Map <String, String> _pifs = new HashMap<String, String>();
@ -749,6 +750,11 @@ ServerResource {
value = (String) params.get("cmds.timeout");
_cmdsTimeout = NumbersUtil.parseInt(value, 7200) * 1000;
value = (String) params.get("vm.memballoon.disable");
if (Boolean.parseBoolean(value)) {
_noMemBalloon = true;
}
value = (String) params.get("host.reserved.mem.mb");
_dom0MinMem = NumbersUtil.parseInt(value, 0) * 1024 * 1024;
@ -3489,7 +3495,7 @@ ServerResource {
GuestResourceDef grd = new GuestResourceDef();
if (vmTO.getMinRam() != vmTO.getMaxRam()){
if (vmTO.getMinRam() != vmTO.getMaxRam() && !_noMemBalloon) {
grd.setMemBalloning(true);
grd.setCurrentMem(vmTO.getMinRam()/1024);
grd.setMemorySize(vmTO.getMaxRam()/1024);

View File

@ -166,6 +166,8 @@ public class LibvirtVMDef {
}
if (_memBalloning){
resBuidler.append("<devices>\n" + "<memballoon model='virtio'/>\n" + "</devices>\n");
} else {
resBuidler.append("<devices>\n" + "<memballoon model='none'/>\n" + "</devices>\n");
}
if (_vcpu != -1) {
resBuidler.append("<vcpu>" + _vcpu + "</vcpu>\n");