mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 02:22:52 +01:00
CLOUDSTACK-3551: scaling up VM to service offering with 2gbram
Fixed the type overflow of Ram value. Signed off by : Nitin Mehta<nitin.mehta@citrix.com>
This commit is contained in:
parent
f5bd253b2b
commit
b4662af0a9
@ -109,7 +109,7 @@ public class BareMetalPlanner extends AdapterBase implements DeploymentPlanner {
|
||||
if (target == null) {
|
||||
s_logger.warn("Cannot find host with tag " + hostTag + " use capacity from service offering");
|
||||
cpu_requested = offering.getCpu() * offering.getSpeed();
|
||||
ram_requested = offering.getRamSize() * 1024 * 1024;
|
||||
ram_requested = offering.getRamSize() * 1024L * 1024L;
|
||||
} else {
|
||||
cpu_requested = target.getCpus() * target.getSpeed().intValue();
|
||||
ram_requested = target.getTotalMemory();
|
||||
|
||||
@ -485,7 +485,7 @@ public class CapacityManagerImpl extends ManagerBase implements CapacityManager,
|
||||
if(_vmSnapshotDao.listByParent(vmSnapshotVO.getId()).size() == 0)
|
||||
pathCount++;
|
||||
if(vmSnapshotVO.getType() == VMSnapshot.Type.DiskAndMemory)
|
||||
memorySnapshotSize += (offering.getRamSize() * 1024 * 1024);
|
||||
memorySnapshotSize += (offering.getRamSize() * 1024L * 1024L);
|
||||
}
|
||||
if(pathCount <= 1)
|
||||
totalSize = totalSize + memorySnapshotSize;
|
||||
|
||||
@ -3363,7 +3363,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
||||
Float cpuOvercommitRatio = Float.parseFloat(_configServer.getConfigValue(Config.CPUOverprovisioningFactor.key(), Config.ConfigurationParameterScope.cluster.toString(), hostVo.getClusterId()));
|
||||
long minMemory = (long) (newServiceOffering.getRamSize()/memoryOvercommitRatio);
|
||||
ScaleVmCommand reconfigureCmd = new ScaleVmCommand(vm.getInstanceName(), newServiceOffering.getCpu(),
|
||||
(int) (newServiceOffering.getSpeed()/cpuOvercommitRatio), newServiceOffering.getSpeed(), minMemory * 1024 * 1024, newServiceOffering.getRamSize() * 1024 * 1024, newServiceOffering.getLimitCpuUse(), isDynamicallyScalable);
|
||||
(int) (newServiceOffering.getSpeed()/cpuOvercommitRatio), newServiceOffering.getSpeed(), minMemory * 1024L * 1024L, newServiceOffering.getRamSize() * 1024L * 1024L, newServiceOffering.getLimitCpuUse(), isDynamicallyScalable);
|
||||
|
||||
Long dstHostId = vm.getHostId();
|
||||
ItWorkVO work = new ItWorkVO(UUID.randomUUID().toString(), _nodeId, State.Running, vm.getType(), vm.getId());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user