Updated Branches: refs/heads/4.2 c443115a4 -> f1a6de5ee
CLOUDSTACK-3551: scaling up VM to service offering with 2gbram Fixed the type overflow of Ram value. Signed off by : Nitin Mehta<nitin.me...@citrix.com> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f1a6de5e Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f1a6de5e Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f1a6de5e Branch: refs/heads/4.2 Commit: f1a6de5eed0dd2d40f4d98a5c8b0e949f0018c20 Parents: c443115 Author: Harikrishna Patnala <harikrishna.patn...@citrix.com> Authored: Thu Jul 18 11:41:29 2013 +0530 Committer: Nitin Mehta <nitin.me...@citrix.com> Committed: Thu Jul 18 11:42:03 2013 +0530 ---------------------------------------------------------------------- .../src/com/cloud/baremetal/manager/BareMetalPlanner.java | 2 +- server/src/com/cloud/capacity/CapacityManagerImpl.java | 2 +- server/src/com/cloud/vm/VirtualMachineManagerImpl.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f1a6de5e/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalPlanner.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalPlanner.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalPlanner.java index 97b2840..e6ddcbe 100755 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalPlanner.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalPlanner.java @@ -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(); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f1a6de5e/server/src/com/cloud/capacity/CapacityManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/capacity/CapacityManagerImpl.java b/server/src/com/cloud/capacity/CapacityManagerImpl.java index 8d2855c..2d6657a 100755 --- a/server/src/com/cloud/capacity/CapacityManagerImpl.java +++ b/server/src/com/cloud/capacity/CapacityManagerImpl.java @@ -483,7 +483,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; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f1a6de5e/server/src/com/cloud/vm/VirtualMachineManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java index 096daa7..9365e1b 100755 --- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -3334,7 +3334,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());