bug 10628: if private network and storage network use the same nic, MS will start HA very quickly within 20 seconds, it breaks heartbeat check, which require 60 seconds interval. add 60s sleep before trying to HA on VMs

status 10628: resolved fixed
This commit is contained in:
anthony 2011-07-07 12:36:39 -07:00
parent 9b640085ab
commit b885915f1e

View File

@ -185,6 +185,19 @@ public class HighAvailabilityManagerImpl implements HighAvailabilityManager, Clu
if (host.getType() != Host.Type.Routing) {
return;
}
// need to wait 60 seconds to make sure storage heartbeat check correct
long begin = System.currentTimeMillis();
while ( true ) {
try {
Thread.sleep(60*1000);
} catch (InterruptedException e) {
}
long now = System.currentTimeMillis();
if( (now - begin) > 60*1000) {
break;
}
}
s_logger.warn("Scheduling restart for VMs on host " + host.getId());
final List<VMInstanceVO> vms = _instanceDao.listByHostId(host.getId());