mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
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:
parent
a413536f90
commit
4f969057b2
@ -60,6 +60,8 @@ public interface ClusterManager extends Manager {
|
||||
|
||||
long getCurrentRunId();
|
||||
|
||||
public long getManagementRunId(long msId);
|
||||
|
||||
public interface Dispatcher {
|
||||
String getName();
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user