bug 13873: memory overhead can now be overridden for each version, increasing the overhead for SP2 by 1.5%

This commit is contained in:
Abhi 2012-03-29 17:35:18 +05:30
parent 8852668b48
commit dde4effd79
2 changed files with 9 additions and 4 deletions

View File

@ -274,6 +274,10 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
// Guest and Host Performance Statistics
protected String _consolidationFunction = "AVERAGE";
protected int _pollingIntervalInSeconds = 60;
//Hypervisor specific params with generic value, may need to be overridden for specific versions
long _xs_memory_used = 128 * 1024 * 1024L; // xen hypervisor used 128 M
double _xs_virtualization_factor = 63.0/64.0; // 1 - virtualization overhead
protected boolean _canBridgeFirewall = false;
protected boolean _isOvs = false;
@ -4858,9 +4862,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
break;
}
}
// assume the memory Virtualization overhead is 1/64
// xen hypervisor used 128 M
ram = (ram - dom0Ram - (128 * 1024 * 1024)) * 63/64;
ram = (long) ((ram - dom0Ram - _xs_memory_used) * _xs_virtualization_factor);
cmd.setMemory(ram);
cmd.setDom0MinMemory(dom0Ram);

View File

@ -32,9 +32,11 @@ import com.cloud.utils.script.Script;
@Local(value=ServerResource.class)
public class XenServer56SP2Resource extends XenServer56FP1Resource {
private static final Logger s_logger = Logger.getLogger(XenServer56SP2Resource.class);
public XenServer56SP2Resource() {
super();
_xs_memory_used = 128 * 1024 * 1024L;
_xs_virtualization_factor = 62.0/64.0;
}
@Override