mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +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) {
|
if (target == null) {
|
||||||
s_logger.warn("Cannot find host with tag " + hostTag + " use capacity from service offering");
|
s_logger.warn("Cannot find host with tag " + hostTag + " use capacity from service offering");
|
||||||
cpu_requested = offering.getCpu() * offering.getSpeed();
|
cpu_requested = offering.getCpu() * offering.getSpeed();
|
||||||
ram_requested = offering.getRamSize() * 1024 * 1024;
|
ram_requested = offering.getRamSize() * 1024L * 1024L;
|
||||||
} else {
|
} else {
|
||||||
cpu_requested = target.getCpus() * target.getSpeed().intValue();
|
cpu_requested = target.getCpus() * target.getSpeed().intValue();
|
||||||
ram_requested = target.getTotalMemory();
|
ram_requested = target.getTotalMemory();
|
||||||
|
|||||||
@ -485,7 +485,7 @@ public class CapacityManagerImpl extends ManagerBase implements CapacityManager,
|
|||||||
if(_vmSnapshotDao.listByParent(vmSnapshotVO.getId()).size() == 0)
|
if(_vmSnapshotDao.listByParent(vmSnapshotVO.getId()).size() == 0)
|
||||||
pathCount++;
|
pathCount++;
|
||||||
if(vmSnapshotVO.getType() == VMSnapshot.Type.DiskAndMemory)
|
if(vmSnapshotVO.getType() == VMSnapshot.Type.DiskAndMemory)
|
||||||
memorySnapshotSize += (offering.getRamSize() * 1024 * 1024);
|
memorySnapshotSize += (offering.getRamSize() * 1024L * 1024L);
|
||||||
}
|
}
|
||||||
if(pathCount <= 1)
|
if(pathCount <= 1)
|
||||||
totalSize = totalSize + memorySnapshotSize;
|
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()));
|
Float cpuOvercommitRatio = Float.parseFloat(_configServer.getConfigValue(Config.CPUOverprovisioningFactor.key(), Config.ConfigurationParameterScope.cluster.toString(), hostVo.getClusterId()));
|
||||||
long minMemory = (long) (newServiceOffering.getRamSize()/memoryOvercommitRatio);
|
long minMemory = (long) (newServiceOffering.getRamSize()/memoryOvercommitRatio);
|
||||||
ScaleVmCommand reconfigureCmd = new ScaleVmCommand(vm.getInstanceName(), newServiceOffering.getCpu(),
|
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();
|
Long dstHostId = vm.getHostId();
|
||||||
ItWorkVO work = new ItWorkVO(UUID.randomUUID().toString(), _nodeId, State.Running, vm.getType(), vm.getId());
|
ItWorkVO work = new ItWorkVO(UUID.randomUUID().toString(), _nodeId, State.Running, vm.getType(), vm.getId());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user