for the last host

This commit is contained in:
anthony 2011-02-07 20:07:14 -08:00
parent bc4357f7dd
commit 213ea43f63

View File

@ -2081,7 +2081,7 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory,
List<HostVO> hosts = _hostDao.listBy(host.getClusterId(), host.getPodId(), host.getDataCenterId());
for (final VMInstanceVO vm : vms) {
if( hosts == null || hosts.isEmpty()) {
if( hosts == null || hosts.size() <= 1) {
// for the last host in this cluster, stop all the VMs
_haMgr.scheduleStop(vm, hostId, WorkType.ForceStop);
} else {