Updated Branches:
  refs/heads/master f5bd253b2 -> b4662af0a

CLOUDSTACK-3551: scaling up VM to service offering with 2gbram
Fixed the type overflow of Ram value.
Signed off by : Nitin Mehta<[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b4662af0
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b4662af0
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b4662af0

Branch: refs/heads/master
Commit: b4662af0a93c68b5a94e044bf56fc7e2c15efd63
Parents: f5bd253
Author: Harikrishna Patnala <[email protected]>
Authored: Thu Jul 18 11:41:29 2013 +0530
Committer: Nitin Mehta <[email protected]>
Committed: Thu Jul 18 15:04:20 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/b4662af0/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/b4662af0/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 d54624d..05a47dd 100755
--- a/server/src/com/cloud/capacity/CapacityManagerImpl.java
+++ b/server/src/com/cloud/capacity/CapacityManagerImpl.java
@@ -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;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b4662af0/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 1535a82..9962f03 100755
--- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -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());

Reply via email to