Merge pull request #834 from maneesha-p/CLOUDSTACK-8866

CLOUDSTACK-8866 : restart.retry.interval is being used instead of migrate.retry.interval during host maintenanceThe frequency at which Cloudstack tries to migrate the VMs is currently controlled by the global parameter "restart.retry.interval" which has a default value of 600 seconds or 10 minutes.This has to be changed to use "migrate.retry.interval" which by default is 120 seconds or 2 minutes . Cloudstack uses restart.retry.interval for all operations-migrate,restart,stop,destroy.

* pr/834:
  CLOUDSTACK-8866 : restart.retry.interval is being used instead of migrate.retry.interval during host maintenance

Signed-off-by: Daan Hoogland <daan@onecht.net>
This commit is contained in:
Daan Hoogland 2015-11-30 07:45:55 +01:00
commit 20dcc25884

View File

@ -761,9 +761,25 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai
work.setDateTaken(null);
}
private long getRescheduleTime(WorkType workType) {
switch (workType) {
case Migration:
return ((System.currentTimeMillis() >> 10) + _migrateRetryInterval);
case HA:
return ((System.currentTimeMillis() >> 10) + _restartRetryInterval);
case Stop:
case CheckStop:
case ForceStop:
return ((System.currentTimeMillis() >> 10) + _stopRetryInterval);
case Destroy:
return ((System.currentTimeMillis() >> 10) + _restartRetryInterval);
}
return 0;
}
private void processWork(final HaWorkVO work) {
final WorkType wt = work.getWorkType();
try {
final WorkType wt = work.getWorkType();
Long nextTime = null;
if (wt == WorkType.Migration) {
nextTime = migrate(work);
@ -787,7 +803,7 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai
} catch (Exception e) {
s_logger.warn("Encountered unhandled exception during HA process, reschedule work", e);
long nextTime = (System.currentTimeMillis() >> 10) + _restartRetryInterval;
long nextTime = getRescheduleTime(wt);
rescheduleWork(work, nextTime);
// if restart failed in the middle due to exception, VM state may has been changed