mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	bug 11148: VMs that got stopped during Host Maintenance have host_id associated with them
status 11148: resolved fixed enabled vm stop, if the host is last valid host in cluster
This commit is contained in:
		
							parent
							
								
									e4162e5be6
								
							
						
					
					
						commit
						b87c5ba331
					
				| @ -1634,10 +1634,10 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager { | |||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             List<HostVO> hosts = _hostDao.listBy(host.getClusterId(), host.getPodId(), host.getDataCenterId()); |             List<HostVO> hosts = _hostDao.listBy(host.getClusterId(), host.getPodId(), host.getDataCenterId()); | ||||||
| 
 |             List<Long> upHosts = _hostDao.listBy( host.getDataCenterId(), host.getPodId(), host.getClusterId(), Host.Type.Routing, Status.Up); | ||||||
|             for (final VMInstanceVO vm : vms) { |             for (final VMInstanceVO vm : vms) { | ||||||
|                 if (hosts == null || hosts.size() <= 1 || !answer.getMigrate()) { |                 if (hosts == null || hosts.size() <= 1 || !answer.getMigrate() || upHosts == null || upHosts.size() == 0) { | ||||||
|                     // for the last host in this cluster, stop all the VMs |                     // for the last valid host in this cluster, stop all the VMs | ||||||
|                     _haMgr.scheduleStop(vm, hostId, WorkType.ForceStop); |                     _haMgr.scheduleStop(vm, hostId, WorkType.ForceStop); | ||||||
|                 } else { |                 } else { | ||||||
|                     _haMgr.scheduleMigration(vm); |                     _haMgr.scheduleMigration(vm); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user