Skip to content

Commit b4662af

Browse files
Harikrishna Patnalanitinmeh
authored andcommitted
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>
1 parent f5bd253 commit b4662af

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalPlanner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public DeployDestination plan(VirtualMachineProfile<? extends VirtualMachine> vm
109109
if (target == null) {
110110
s_logger.warn("Cannot find host with tag " + hostTag + " use capacity from service offering");
111111
cpu_requested = offering.getCpu() * offering.getSpeed();
112-
ram_requested = offering.getRamSize() * 1024 * 1024;
112+
ram_requested = offering.getRamSize() * 1024L * 1024L;
113113
} else {
114114
cpu_requested = target.getCpus() * target.getSpeed().intValue();
115115
ram_requested = target.getTotalMemory();

server/src/com/cloud/capacity/CapacityManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ private long getVMSnapshotAllocatedCapacity(StoragePoolVO pool){
485485
if(_vmSnapshotDao.listByParent(vmSnapshotVO.getId()).size() == 0)
486486
pathCount++;
487487
if(vmSnapshotVO.getType() == VMSnapshot.Type.DiskAndMemory)
488-
memorySnapshotSize += (offering.getRamSize() * 1024 * 1024);
488+
memorySnapshotSize += (offering.getRamSize() * 1024L * 1024L);
489489
}
490490
if(pathCount <= 1)
491491
totalSize = totalSize + memorySnapshotSize;

server/src/com/cloud/vm/VirtualMachineManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3363,7 +3363,7 @@ public VMInstanceVO reConfigureVm(VMInstanceVO vm , ServiceOffering oldServiceOf
33633363
Float cpuOvercommitRatio = Float.parseFloat(_configServer.getConfigValue(Config.CPUOverprovisioningFactor.key(), Config.ConfigurationParameterScope.cluster.toString(), hostVo.getClusterId()));
33643364
long minMemory = (long) (newServiceOffering.getRamSize()/memoryOvercommitRatio);
33653365
ScaleVmCommand reconfigureCmd = new ScaleVmCommand(vm.getInstanceName(), newServiceOffering.getCpu(),
3366-
(int) (newServiceOffering.getSpeed()/cpuOvercommitRatio), newServiceOffering.getSpeed(), minMemory * 1024 * 1024, newServiceOffering.getRamSize() * 1024 * 1024, newServiceOffering.getLimitCpuUse(), isDynamicallyScalable);
3366+
(int) (newServiceOffering.getSpeed()/cpuOvercommitRatio), newServiceOffering.getSpeed(), minMemory * 1024L * 1024L, newServiceOffering.getRamSize() * 1024L * 1024L, newServiceOffering.getLimitCpuUse(), isDynamicallyScalable);
33673367

33683368
Long dstHostId = vm.getHostId();
33693369
ItWorkVO work = new ItWorkVO(UUID.randomUUID().toString(), _nodeId, State.Running, vm.getType(), vm.getId());

0 commit comments

Comments
 (0)