CLOUDSTACK-7030. After the restart of MS in a clustered MS pool, not all hung worker VMs are recycled.

Recycle worker VMs that originally belonged to other management servers too because in case of MS restart, the owner MS might change.
This commit is contained in:
Likitha Shetty 2014-07-07 12:01:38 +05:30
parent a413536f90
commit 4f969057b2
3 changed files with 12 additions and 1 deletions

View File

@ -60,6 +60,8 @@ public interface ClusterManager extends Manager {
long getCurrentRunId();
public long getManagementRunId(long msId);
public interface Dispatcher {
String getName();

View File

@ -1072,6 +1072,15 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C
return _runId;
}
@Override
public long getManagementRunId(long msId) {
ManagementServerHostVO mshost = _mshostDao.findByMsid(msId);
if (mshost != null) {
return mshost.getRunid();
}
return -1;
}
public boolean isManagementNodeAlive(long msid) {
ManagementServerHostVO mshost = _mshostDao.findByMsid(msid);
if (mshost != null) {

View File

@ -531,7 +531,7 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw
return true;
}
if (msid == _clusterMgr.getManagementNodeId() && runid != _clusterMgr.getCurrentRunId()) {
if (runid != _clusterMgr.getManagementRunId(msid)) {
if (s_logger.isInfoEnabled())
s_logger.info("Worker VM's owner management server has changed runid, recycle it");
return true;