diff --git a/server/src/com/cloud/cluster/ClusterManager.java b/server/src/com/cloud/cluster/ClusterManager.java index aa3315909f5..5833c755d95 100644 --- a/server/src/com/cloud/cluster/ClusterManager.java +++ b/server/src/com/cloud/cluster/ClusterManager.java @@ -42,7 +42,8 @@ public interface ClusterManager extends Manager { public Boolean propagateAgentEvent(long agentId, Event event) throws AgentUnavailableException; public int getHeartbeatThreshold(); - public long getId(); + public long getId(); + public long getCurrentRunId(); public String getSelfPeerName(); public String getSelfNodeIP(); public String getPeerName(long agentHostId); diff --git a/server/src/com/cloud/cluster/ClusterManagerImpl.java b/server/src/com/cloud/cluster/ClusterManagerImpl.java index 37770ab60bd..d637c882f6f 100644 --- a/server/src/com/cloud/cluster/ClusterManagerImpl.java +++ b/server/src/com/cloud/cluster/ClusterManagerImpl.java @@ -23,8 +23,8 @@ import javax.naming.ConfigurationException; import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; -import com.cloud.agent.AgentManager.OnError; import com.cloud.agent.Listener; +import com.cloud.agent.AgentManager.OnError; import com.cloud.agent.api.Answer; import com.cloud.agent.api.ChangeAgentCommand; import com.cloud.agent.api.Command; @@ -81,6 +81,7 @@ public class ClusterManagerImpl implements ClusterManager { private HostDao _hostDao; protected long _id = MacAddress.getMacAddress().toLong(); + protected long _runId = System.currentTimeMillis(); private Long _mshostId = null; @@ -775,6 +776,11 @@ public class ClusterManagerImpl implements ClusterManager { return _id; } + @Override + public long getCurrentRunId() { + return _runId; + } + @Override public int getHeartbeatThreshold() { return this.heartbeatThreshold; diff --git a/server/src/com/cloud/cluster/DummyClusterManagerImpl.java b/server/src/com/cloud/cluster/DummyClusterManagerImpl.java index 931126a1de7..734085d1f97 100644 --- a/server/src/com/cloud/cluster/DummyClusterManagerImpl.java +++ b/server/src/com/cloud/cluster/DummyClusterManagerImpl.java @@ -38,7 +38,9 @@ import com.cloud.utils.net.MacAddress; public class DummyClusterManagerImpl implements ClusterManager { private static final Logger s_logger = Logger.getLogger(DummyClusterManagerImpl.class); - protected long _id = MacAddress.getMacAddress().toLong(); + protected long _id = MacAddress.getMacAddress().toLong(); + protected long _runId = System.currentTimeMillis(); + private String _name; private final String _clusterNodeIP = "127.0.0.1"; @@ -81,7 +83,11 @@ public class DummyClusterManagerImpl implements ClusterManager { public long getId() { return _id; - } + } + + public long getCurrentRunId() { + return _runId; + } @Override public ManagementServerHostVO getPeer(String str) {