weizhouapache commented on code in PR #11573:
URL: https://github.com/apache/cloudstack/pull/11573#discussion_r2330493124


##########
server/src/main/java/org/apache/cloudstack/vm/schedule/VMSchedulerImpl.java:
##########
@@ -190,6 +196,11 @@ public boolean start() {
         final TimerTask schedulerPollTask = new ManagedContextTimerTask() {
             @Override
             protected void runInContext() {
+                ManagementServerHostVO msHost = 
managementServerHostDao.findOneInUpStateByLongestRuntime();
+                if (msHost == null || (msHost.getMsid() != 
ManagementServerNode.getManagementServerId())) {
+                    logger.debug("Skipping the vm scheduler poll task on this 
management server");
+                    return;
+                }

Review Comment:
   @DaanHoogland 
   the second management server will take it over, when it finds itself to be 
the management server in Up state with longest running time.
   
   the method `findOneInUpStateByLongestRuntime` has the condition
   ```
           sc.setParameters("state", ManagementServerHost.State.Up);
   ```
   which excludes the management servers not in Up state (e.g. the first server 
was decommissioned in your example)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to