mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	fix issue: failed to start vm from iso caused by ClassCastException and NPE
This commit is contained in:
		
							parent
							
								
									e37fdce125
								
							
						
					
					
						commit
						46e91bd794
					
				| @ -267,10 +267,17 @@ public class CloudOrchestrator implements OrchestrationService { | |||||||
| 		rootDiskOffering.first(diskOffering); | 		rootDiskOffering.first(diskOffering); | ||||||
| 		rootDiskOffering.second(size); | 		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); | 		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; | 			return null; | ||||||
| 		} | 		} | ||||||
|     	 |     	 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user