Updated Branches: refs/heads/master e37fdce12 -> 46e91bd79
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/46e91bd7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/46e91bd7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/46e91bd7 Branch: refs/heads/master Commit: 46e91bd79401fecebe44da4c8fb899f23489c308 Parents: e37fdce Author: Mice Xia <[email protected]> Authored: Tue Feb 26 16:24:32 2013 +0800 Committer: Mice Xia <[email protected]> Committed: Tue Feb 26 17:01:26 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/46e91bd7/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 ea9a30b..60ea9f5 100755 --- a/engine/orchestration/src/org/apache/cloudstack/platform/orchestration/CloudOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/platform/orchestration/CloudOrchestrator.java @@ -267,10 +267,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; }
