incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject git commit: refs/heads/4.1 - fix issue: failed to start vm from iso caused by ClassCastException and NPE
Date Tue, 26 Feb 2013 09:00:50 GMT
Updated Branches:
  refs/heads/4.1 49402d566 -> 9d57d59e6


fix issue: failed to start vm from iso caused by ClassCastException and NPE


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

Branch: refs/heads/4.1
Commit: 9d57d59e61a462c38dece249f41de12f85c1f353
Parents: 49402d5
Author: Mice Xia <mice_xia@tcloudcomputing.com>
Authored: Tue Feb 26 16:24:32 2013 +0800
Committer: Mice Xia <mice_xia@tcloudcomputing.com>
Committed: Tue Feb 26 17:00:05 2013 +0800

----------------------------------------------------------------------
 .../platform/orchestration/CloudOrchestrator.java  |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/9d57d59e/engine/orchestration/src/org/apache/cloudstack/platform/orchestration/CloudOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/platform/orchestration/CloudOrchestrator.java
b/engine/orchestration/src/org/apache/cloudstack/platform/orchestration/CloudOrchestrator.java
index e28c6f1..41214dc 100755
--- a/engine/orchestration/src/org/apache/cloudstack/platform/orchestration/CloudOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/platform/orchestration/CloudOrchestrator.java
@@ -266,10 +266,17 @@ public class CloudOrchestrator implements OrchestrationService {
 		rootDiskOffering.first(diskOffering);
 		rootDiskOffering.second(size);
 		
+        List<Pair<NetworkVO, NicProfile>> networkIpMap = new ArrayList<Pair<NetworkVO,
NicProfile>>();
+        for (String uuid : networkNicMap.keySet()) {
+            NetworkVO network = _networkDao.findByUuid(uuid);
+            if(network != null){
+                networkIpMap.add(new Pair<NetworkVO, NicProfile>(network, networkNicMap.get(uuid)));
+            }
+        }
 		
 		HypervisorType hypervisorType = HypervisorType.valueOf(hypervisor);
 		
-    	if (_itMgr.allocate(vm, _templateDao.findById(new Long(isoId)), offering, rootDiskOffering,
dataDiskOfferings, null, null,	plan, hypervisorType, null) == null) {
+    	if (_itMgr.allocate(_userVmDao.findById(vm.getId(), true), _templateDao.findById(new
Long(isoId)), offering, rootDiskOffering, dataDiskOfferings, networkIpMap, null,	plan, hypervisorType,
_accountDao.findById(new Long(owner))) == null) {
 			return null;
 		}
     	


Mime
View raw message