private void updateMaxMemoryIfUnspecified(InstanceType instanceType, VM vm) { if (!(instanceType.isSetMemoryPolicy() && instanceType.getMemoryPolicy().isSetMax()) && instanceType.isSetMemory()) { vm.setMaxMemorySizeMb(VmCommonUtils.getMaxMemorySizeDefault(vm.getMemSizeMb())); } }
/** * Return total maximum possible memory size for the given VM, including hotplugged memory. * * <p>Note: backend only</p> * * @param osId id of operating system * @param compatibilityVersion version of config value to query * @return the total possible memory size with hotplug */ public static int maxMemorySizeWithHotplugInMb(int osId, Version compatibilityVersion) { final ConfigValues configValue = getMaxMemConfigValueByOsId(osId); return Config.<Integer>getValue( configValue, compatibilityVersion != null ? compatibilityVersion.getValue() : Version.getLast().getValue() ); }
/** * Note: backend only * * @see #maxMemorySizeWithHotplugInMb(int, Version) */ public static int maxMemorySizeWithHotplugInMb(VM vm) { return maxMemorySizeWithHotplugInMb(vm.getOs(), vm.getCompatibilityVersion()); }
@Override public void onSuccess(QueryReturnValue returnValue) { List<String> changedFields = returnValue.getReturnValue(); final boolean cpuHotPluggable = VmCommonUtils.isCpusToBeHotpluggedOrUnplugged(selectedItem, getcurrentVm()); final boolean isHeadlessModeChanged = isHeadlessModeChanged(editedVm, getUpdateVmParameters(false)); final boolean memoryHotPluggable = VmCommonUtils.isMemoryToBeHotplugged(selectedItem, getcurrentVm()); final boolean minAllocatedMemoryChanged = selectedItem.getMinAllocatedMem() != getcurrentVm().getMinAllocatedMem(); final boolean vmLeaseUpdated = VmCommonUtils.isVmLeaseToBeHotPluggedOrUnplugged(selectedItem, getcurrentVm()); if (isHeadlessModeChanged) { changedFields.add(constants.headlessMode());
public void updateMaxMemory() { final Integer memoryMb = getModel().getMemSize().getEntity(); if (memoryMb != null) { getModel().getMaxMemorySize().setEntity( VmCommonUtils.getMaxMemorySizeDefault(memoryMb)); } }
private void updateMaxMemoryIfUnspecified(Vm vm, VmStatic vmStatic) { if (!(vm.isSetMemoryPolicy() && vm.getMemoryPolicy().isSetMax()) && vm.isSetMemory()) { vmStatic.setMaxMemorySizeMb(VmCommonUtils.getMaxMemorySizeDefault(vmStatic.getMemSizeMb())); } }
public void initialize() { super.initialize(); getMemSize().setEntity(256); getMinAllocatedMemory().setEntity(256); getMaxMemorySize().setEntity(VmCommonUtils.getMaxMemorySizeDefault(getMemSize().getEntity())); getIsStateless().setEntity(false); getIsRunAndPause().setEntity(false); getIsHeadlessModeEnabled().setEntity(false); getIsSmartcardEnabled().setEntity(false); isConsoleDeviceEnabled.setEntity(false); getIsHighlyAvailable().setEntity(false); getIsAutoAssign().setEntity(true); getIsTemplatePublic().setEntity(true); getBehavior().enableSinglePCI(false); isRngEnabled.setEntity(false); rngSourceUrandom.setEntity(true); getHostCpu().setEntity(false); getMigrationMode().setIsChangeable(true); getCdImage().setIsChangeable(false); initGraphicsAndDisplayListeners(); initFirstBootDevice(); initNumOfMonitors(); initAllowConsoleReconnect(); initMigrationMode(); initVncKeyboardLayout(); initConsoleDisconnectAction(); updateResumeBehavior(); updateLabelList(); behavior.initialize(); }