cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject git commit: updated refs/heads/4.2 to 2b42a27
Date Mon, 29 Jul 2013 08:37:21 GMT
Updated Branches:
  refs/heads/4.2 460fe86eb -> 2b42a2717


CLOUDSTACK-3669:  Bringing down the dynamic scalable check (for VM whether it has xstools
or vmware tools in it) to the management layer.


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

Branch: refs/heads/4.2
Commit: 2b42a271771860add43705bb64c2296179091455
Parents: 460fe86
Author: Harikrishna Patnala <harikrishna.patnala@citrix.com>
Authored: Mon Jul 29 14:06:37 2013 +0530
Committer: Nitin Mehta <nitin.mehta@citrix.com>
Committed: Mon Jul 29 14:07:06 2013 +0530

----------------------------------------------------------------------
 core/src/com/cloud/agent/api/ScaleVmCommand.java          |  3 +--
 .../cloud/hypervisor/xen/resource/CitrixResourceBase.java |  4 ----
 server/src/com/cloud/vm/UserVmManagerImpl.java            |  4 ++++
 server/src/com/cloud/vm/VirtualMachineManagerImpl.java    | 10 +---------
 .../test/com/cloud/vm/VirtualMachineManagerImplTest.java  |  2 +-
 5 files changed, 7 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2b42a271/core/src/com/cloud/agent/api/ScaleVmCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/ScaleVmCommand.java b/core/src/com/cloud/agent/api/ScaleVmCommand.java
index 83cdcac..b361485 100644
--- a/core/src/com/cloud/agent/api/ScaleVmCommand.java
+++ b/core/src/com/cloud/agent/api/ScaleVmCommand.java
@@ -41,7 +41,7 @@ public class ScaleVmCommand extends Command {
 	}
 
 	public ScaleVmCommand(String vmName, int cpus,
-			Integer minSpeed, Integer maxSpeed, long minRam, long maxRam, boolean limitCpuUse, boolean
isDynamicallyScalable) {
+			Integer minSpeed, Integer maxSpeed, long minRam, long maxRam, boolean limitCpuUse) {
 		super();
 		this.vmName = vmName;
 		this.cpus = cpus;
@@ -50,7 +50,6 @@ public class ScaleVmCommand extends Command {
 		this.minRam = minRam;
 		this.maxRam = maxRam;
 		this.vm = new VirtualMachineTO(1L, vmName, null, cpus, minSpeed, maxSpeed, minRam, maxRam,
null, null, false, limitCpuUse, null);
-        vm.setEnableDynamicallyScaleVm(isDynamicallyScalable);
 		/*vm.setName(vmName);
 		vm.setCpus(cpus);
 		vm.setRam(minRam, maxRam);*/

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2b42a271/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 7f8bb3e..3dfe4de 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -688,10 +688,6 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
                 throw new CloudRuntimeException("Unable to scale the vm: " + vmName + " as
DMC - Dynamic memory control is not enabled for the XenServer:" + _host.uuid + " ,check your
license and hypervisor version.");
             }
 
-            if(!vmSpec.isEnableDynamicallyScaleVm()) {
-                throw new CloudRuntimeException("Unable to Scale the vm: " + vmName + "as
vm does not have xs tools to support dynamic scaling");
-            }
-
             // stop vm which is running on this host or is in halted state
             Iterator<VM> iter = vms.iterator();
             while ( iter.hasNext() ) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2b42a271/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 3831f88..36432f4 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -1194,6 +1194,10 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Use
             if(!enableDynamicallyScaleVm){
                throw new PermissionDeniedException("Dynamically scaling virtual machines
is disabled for this zone, please contact your admin");
             }
+            UserVmDetailVO vmDetailVO = _vmDetailsDao.findDetail(vmId, VirtualMachine.IsDynamicScalingEnabled);
+            if (vmDetailVO == null || !Boolean.parseBoolean(vmDetailVO.getValue())) {
+                throw new CloudRuntimeException("Unable to Scale the vm: " + vmInstance.getUuid()
+ " as vm does not have xs tools to support dynamic scaling");
+            }
 
             while (retry-- != 0) { // It's != so that it can match -1.
                 try{

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2b42a271/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 a3187ba..45aa50c 100755
--- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -3330,14 +3330,6 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
     @Override
     public VMInstanceVO reConfigureVm(VMInstanceVO vm , ServiceOffering oldServiceOffering,
boolean reconfiguringOnExistingHost) throws ResourceUnavailableException, ConcurrentOperationException
{
 
-        UserVmDetailVO vmDetailVO = _uservmDetailsDao.findDetail(vm.getId(), VirtualMachine.IsDynamicScalingEnabled);
-        Boolean isDynamicallyScalable;
-        if (vmDetailVO == null) {
-            isDynamicallyScalable = false;
-        } else {
-            isDynamicallyScalable = (vmDetailVO.getValue()).equals("true");
-        }
-
         long newServiceofferingId = vm.getServiceOfferingId();
         ServiceOffering newServiceOffering = _configMgr.getServiceOffering(newServiceofferingId);
         HostVO hostVo = _hostDao.findById(vm.getHostId());
@@ -3346,7 +3338,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 * 1024L * 1024L, newServiceOffering.getRamSize() * 1024L * 1024L, newServiceOffering.getLimitCpuUse(),
isDynamicallyScalable);
+                (int) (newServiceOffering.getSpeed()/cpuOvercommitRatio), newServiceOffering.getSpeed(),
minMemory * 1024L * 1024L, newServiceOffering.getRamSize() * 1024L * 1024L, newServiceOffering.getLimitCpuUse());
 
         Long dstHostId = vm.getHostId();
         ItWorkVO work = new ItWorkVO(UUID.randomUUID().toString(), _nodeId, State.Running,
vm.getType(), vm.getId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2b42a271/server/test/com/cloud/vm/VirtualMachineManagerImplTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vm/VirtualMachineManagerImplTest.java b/server/test/com/cloud/vm/VirtualMachineManagerImplTest.java
index 44e22e2..f67695d 100644
--- a/server/test/com/cloud/vm/VirtualMachineManagerImplTest.java
+++ b/server/test/com/cloud/vm/VirtualMachineManagerImplTest.java
@@ -251,7 +251,7 @@ public class VirtualMachineManagerImplTest {
         when(_configServer.getConfigValue(Config.MemOverprovisioningFactor.key(), Config.ConfigurationParameterScope.cluster.toString(),
1L)).thenReturn("1.0");
         when(_configServer.getConfigValue(Config.CPUOverprovisioningFactor.key(), Config.ConfigurationParameterScope.cluster.toString(),
1L)).thenReturn("1.0");
         ScaleVmCommand reconfigureCmd = new ScaleVmCommand("myVmName", newServiceOffering.getCpu(),
-                newServiceOffering.getSpeed(), newServiceOffering.getSpeed(), newServiceOffering.getRamSize(),
newServiceOffering.getRamSize(), newServiceOffering.getLimitCpuUse(), true);
+                newServiceOffering.getSpeed(), newServiceOffering.getSpeed(), newServiceOffering.getRamSize(),
newServiceOffering.getRamSize(), newServiceOffering.getLimitCpuUse());
         Answer answer = new ScaleVmAnswer(reconfigureCmd, true, "details");
         when(_agentMgr.send(2l, reconfigureCmd)).thenReturn(null);
         _vmMgr.reConfigureVm(_vmInstance, getSvcoffering(256), false);


Mime
View raw message