1

Is it possible to run Azure Batch cluster only in specific hours? What variables should I use for it? Eg. from 6 am to 6pm. Will cluster be available to run in other hours if any tasks will be forced on it?

Jack n J
  • 206
  • 3
  • 14

1 Answers1

2

You can use Batch autoscaling formulas to accomplish this via time(). Please see this link for an example.

fpark
  • 2,304
  • 2
  • 14
  • 21
  • Thank you. I have added this code for scaling: $curTime = time(); $workHours = $curTime.hour >= 8 && $curTime.hour < 18; $isWeekday = $curTime.weekday >= 1 && $curTime.weekday <= 5; $isWorkingWeekdayHour = $workHours && $isWeekday; $TargetDedicatedNodes = $isWorkingWeekdayHour ? 20:10; $NodeDeallocationOption = taskcompletion; – Jack n J Aug 04 '20 at 08:35