cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject git commit: updated refs/heads/4.5 to a1791cb
Date Sun, 18 Jan 2015 11:59:13 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.5 8676ff26e -> a1791cb4a


CLOUDSTACK-8088: VM scale up is failing in vmware with Unable to execute ScaleVmCommand due
to java.lang.NullPointerException

(cherry picked from commit 1df0453d27e8378065c15878067fc9d2dc961e30)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/4.5
Commit: a1791cb4a8fb2cfd455848ca47585d94d9a309e7
Parents: 8676ff2
Author: Saksham Srivastava <saksham.srivastava@citrix.com>
Authored: Thu Dec 18 14:26:33 2014 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Sun Jan 18 17:28:17 2015 +0530

----------------------------------------------------------------------
 api/src/com/cloud/hypervisor/HypervisorGuru.java            | 3 +++
 .../src/com/cloud/vm/VirtualMachineManagerImpl.java         | 7 +++++++
 .../src/com/cloud/baremetal/manager/BareMetalGuru.java      | 6 ++++++
 .../src/com/cloud/hypervisor/hyperv/guru/HypervGuru.java    | 7 +++++++
 .../ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java           | 8 ++++++++
 .../simulator/src/com/cloud/simulator/SimulatorGuru.java    | 8 ++++++++
 .../vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java    | 9 +++++++++
 .../xenserver/src/com/cloud/hypervisor/XenServerGuru.java   | 6 ++++++
 server/src/com/cloud/hypervisor/HypervisorGuruBase.java     | 6 ++++++
 server/src/com/cloud/hypervisor/KVMGuru.java                | 8 ++++++++
 server/src/com/cloud/hypervisor/LXCGuru.java                | 7 +++++++
 11 files changed, 75 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a1791cb4/api/src/com/cloud/hypervisor/HypervisorGuru.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/hypervisor/HypervisorGuru.java b/api/src/com/cloud/hypervisor/HypervisorGuru.java
index 583e082..6a09dd2 100644
--- a/api/src/com/cloud/hypervisor/HypervisorGuru.java
+++ b/api/src/com/cloud/hypervisor/HypervisorGuru.java
@@ -17,6 +17,7 @@
 package com.cloud.hypervisor;
 
 import java.util.List;
+import java.util.Map;
 
 import org.apache.cloudstack.framework.config.ConfigKey;
 
@@ -81,4 +82,6 @@ public interface HypervisorGuru extends Adapter {
     List<Command> finalizeExpungeNics(VirtualMachine vm, List<NicProfile> nics);
 
     List<Command> finalizeExpungeVolumes(VirtualMachine vm);
+
+    Map<String, String> getClusterSettings(long vmId);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a1791cb4/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index ab5f6a3..038c7af 100755
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -3487,6 +3487,13 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
                         newServiceOffering.getSpeed(), minMemory * 1024L * 1024L, newServiceOffering.getRamSize()
* 1024L * 1024L, newServiceOffering.getLimitCpuUse());
 
         Long dstHostId = vm.getHostId();
+        if(vm.getHypervisorType().equals(HypervisorType.VMware)) {
+            HypervisorGuru hvGuru = _hvGuruMgr.getGuru(vm.getHypervisorType());
+            Map<String, String> details = null;
+            details = hvGuru.getClusterSettings(vm.getId());
+            reconfigureCmd.getVirtualMachine().setDetails(details);
+        }
+
         ItWorkVO work = new ItWorkVO(UUID.randomUUID().toString(), _nodeId, State.Running,
vm.getType(), vm.getId());
         work.setStep(Step.Prepare);
         work.setResourceType(ItWorkVO.ResourceType.Host);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a1791cb4/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalGuru.java
b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalGuru.java
index 57d439b..8f439cd 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalGuru.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalGuru.java
@@ -84,4 +84,10 @@ public class BareMetalGuru extends HypervisorGuruBase implements HypervisorGuru
     public boolean trackVmHostChange() {
         return false;
     }
+
+    @Override
+    public Map<String, String> getClusterSettings(long vmId) {
+        return null;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a1791cb4/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/guru/HypervGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/guru/HypervGuru.java
b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/guru/HypervGuru.java
index 4e8d3d5..2a63142 100644
--- a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/guru/HypervGuru.java
+++ b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/guru/HypervGuru.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
+import java.util.Map;
 
 import javax.ejb.Local;
 import javax.inject.Inject;
@@ -194,4 +195,10 @@ public class HypervGuru extends HypervisorGuruBase implements HypervisorGuru
{
     public final boolean trackVmHostChange() {
         return false;
     }
+
+    @Override
+    public Map<String, String> getClusterSettings(long vmId) {
+        return null;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a1791cb4/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java
index 236078f..90e4b57 100755
--- a/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java
+++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java
@@ -16,6 +16,8 @@
 // under the License.
 package com.cloud.ovm.hypervisor;
 
+import java.util.Map;
+
 import javax.ejb.Local;
 import javax.inject.Inject;
 
@@ -58,4 +60,10 @@ public class OvmGuru extends HypervisorGuruBase implements HypervisorGuru
{
         return true;
     }
 
+    @Override
+    public Map<String, String> getClusterSettings(long vmId) {
+        return null;
+    }
+
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a1791cb4/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorGuru.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorGuru.java
index 5b9eab4..378134a 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorGuru.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorGuru.java
@@ -16,6 +16,8 @@
 // under the License.
 package com.cloud.simulator;
 
+import java.util.Map;
+
 import javax.ejb.Local;
 import javax.inject.Inject;
 
@@ -56,4 +58,10 @@ public class SimulatorGuru extends HypervisorGuruBase implements HypervisorGuru
     public boolean trackVmHostChange() {
         return false;
     }
+
+    @Override
+    public Map<String, String> getClusterSettings(long vmId) {
+        return null;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a1791cb4/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
index c0711f2..808cb5b 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
@@ -552,4 +552,13 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru,
Co
 
         return commands;
     }
+
+    @Override
+    public Map<String, String> getClusterSettings(long vmId) {
+        Map<String, String> details = new HashMap<String, String>();
+        long clusterId = getClusterId(vmId);
+        details.put(VmwareReserveCpu.key(), VmwareReserveCpu.valueIn(clusterId).toString());
+        details.put(VmwareReserveMemory.key(), VmwareReserveMemory.valueIn(clusterId).toString());
+        return details;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a1791cb4/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
index b17048b..f8aabff 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
@@ -18,6 +18,7 @@ package com.cloud.hypervisor;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 import javax.ejb.Local;
 import javax.inject.Inject;
@@ -129,6 +130,11 @@ public class XenServerGuru extends HypervisorGuruBase implements HypervisorGuru,
     }
 
     @Override
+    public Map<String, String> getClusterSettings(long vmId) {
+        return null;
+    }
+
+    @Override
     public List<Command> finalizeExpungeVolumes(VirtualMachine vm) {
         List<Command> commands = new ArrayList<Command>();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a1791cb4/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/HypervisorGuruBase.java b/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
index 8ffd6ea..308c327 100644
--- a/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
+++ b/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
@@ -190,4 +190,10 @@ public abstract class HypervisorGuruBase extends AdapterBase implements
Hypervis
     public List<Command> finalizeExpungeVolumes(VirtualMachine vm) {
         return null;
     }
+
+    @Override
+    public Map<String, String> getClusterSettings(long vmId) {
+        return null;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a1791cb4/server/src/com/cloud/hypervisor/KVMGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/KVMGuru.java b/server/src/com/cloud/hypervisor/KVMGuru.java
index b6a7651..a2534bd 100644
--- a/server/src/com/cloud/hypervisor/KVMGuru.java
+++ b/server/src/com/cloud/hypervisor/KVMGuru.java
@@ -16,6 +16,8 @@
 // under the License.
 package com.cloud.hypervisor;
 
+import java.util.Map;
+
 import javax.ejb.Local;
 import javax.inject.Inject;
 
@@ -86,4 +88,10 @@ public class KVMGuru extends HypervisorGuruBase implements HypervisorGuru
{
     public boolean trackVmHostChange() {
         return false;
     }
+
+    @Override
+    public Map<String, String> getClusterSettings(long vmId) {
+        return null;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a1791cb4/server/src/com/cloud/hypervisor/LXCGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/LXCGuru.java b/server/src/com/cloud/hypervisor/LXCGuru.java
index 025c498..2becdbd 100644
--- a/server/src/com/cloud/hypervisor/LXCGuru.java
+++ b/server/src/com/cloud/hypervisor/LXCGuru.java
@@ -16,6 +16,8 @@
 // under the License.
 package com.cloud.hypervisor;
 
+import java.util.Map;
+
 import javax.ejb.Local;
 import javax.inject.Inject;
 
@@ -73,4 +75,9 @@ public class LXCGuru extends HypervisorGuruBase implements HypervisorGuru
{
     public boolean trackVmHostChange() {
         return false;
     }
+
+    @Override
+    public Map<String, String> getClusterSettings(long vmId) {
+        return null;
+    }
 }


Mime
View raw message