mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	Bug 14646 - Enabling Host into maintenance mode is stopping the VMs instead of live migrating them to other hosts in the cluster.
Changes: - While listing UP hosts in the cluster of the host, the query has changed and now also considers the Host 'resourceState' field and picks only those hosts that have value 'enabled'. This query result does not include the host being put in maintainance; unlike the earlier query that used to include it. - But the logic to find out if this is the last host in the Cluster is not updated and has a bug when it compares the list size. - Fixed this.
This commit is contained in:
		
							parent
							
								
									38e54d35e0
								
							
						
					
					
						commit
						4f116fb24f
					
				| @ -1095,7 +1095,7 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma | |||||||
| 
 | 
 | ||||||
|             List<HostVO> hosts = listAllUpAndEnabledHosts(Host.Type.Routing, host.getClusterId(), host.getPodId(), host.getDataCenterId()); |             List<HostVO> hosts = listAllUpAndEnabledHosts(Host.Type.Routing, host.getClusterId(), host.getPodId(), host.getDataCenterId()); | ||||||
|             for (final VMInstanceVO vm : vms) { |             for (final VMInstanceVO vm : vms) { | ||||||
|                 if (hosts == null || hosts.size() <= 1 || !answer.getMigrate()) { |                 if (hosts == null || hosts.isEmpty() || !answer.getMigrate()) { | ||||||
|                     // for the last host in this cluster, stop all the VMs |                     // for the last host in this cluster, stop all the VMs | ||||||
|                     _haMgr.scheduleStop(vm, hostId, WorkType.ForceStop); |                     _haMgr.scheduleStop(vm, hostId, WorkType.ForceStop); | ||||||
|                 } else { |                 } else { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user