Runbook servers in different time zones

In this blog post I will try to show how Orchestrator works with schedules and different time zones. In my sandbox I have one runbook server (SCO12SP1-01) in the USA and one runbook server (SCO12SP1-02) in Sweden. I want to configure my runbook to only run between 22 and 23 Monday-Friday. To do this I first create a schedule, in Runbook Designer on my Swedish runbook server where I also have the Runbook Designer console installed.  Name of the schedule is “22-23 SWE” as I want the runbook to run between 22 and 23 and I created it on my Swedish machine.

 

20121220_TimeZone_01

 

Next I have create a small runbook that generates a platform event saying which runbook server it ran on and the local time of that runbook server. I have configured the runbook with the new schedule too.

20121220_TimeZone_02

20121220_TimeZone_03

If we run the following SQL query in the Orchestrator database we can take a look at all schedules

SELECT OBJECTS.Name, SCHEDULES.DaysOfWeek, SCHEDULES.DaysOfMonth, SCHEDULES.Monday, SCHEDULES.Tuesday, SCHEDULES.Wednesday,
SCHEDULES.Thursday, SCHEDULES.Friday, SCHEDULES.Saturday, SCHEDULES.Sunday, SCHEDULES.First, SCHEDULES.Second, SCHEDULES.Third,
SCHEDULES.Fourth, SCHEDULES.Last, SCHEDULES.Days, SCHEDULES.Hours, SCHEDULES.Exceptions
FROM SCHEDULES INNER JOIN
OBJECTS ON SCHEDULES.UniqueID = OBJECTS.UniqueID
WHERE (OBJECTS.Deleted = 0)

20121220_TimeZone_04

For the “22-23 SWE” schedule we can see in the database  the Hours column looks like “000000000040000040000040000040000040000000”. Hours are configured for any day that the schedule permit or deny. The Hours field contains in 7 parts, one for each day of a week. Each part contains of six characters, where the day is divided into 8 hours pieces, so 2 characters represent 8 hours of the day.

  • The week = 000000000040000040000040000040000040000000
  • Sunday and Saturday = 000000 = No hours permitted
  • Monday-Friday = 000040
  • 00 = hours 00-08 (no hours permitted)
  • 00 = hours  09-16 (no hours permitted)
  • 40 = hours 17-23
  • 40 is hex, equals to 01000000 binary = penultimate hour in that time frame is permitted (if it was 23-00 it would look like 10000000)

If I start my runbook 11.32 PM Swedish time it will only run on the Swedish runbook (SCO12SP1-02) server as on the runbook server in the USA local time right now is 1.32 PM.

20121220_TimeZone_05

 

If I change the schedule to allow only 1-2 PM it will only run on the runbook server in the US.

20121220_TimeZone_06

 

That means that if you build you schedule for 1-2 AM in Sweden and trigger it on a runbook server in the USA, 1-2 AM is still 1-2 AM local time, no translation between time zones. The evaluation of the schedule is done local on the runbook server. If a runbook server is not allowed to run a runbook due to the schedule the runbook server will still download the runbook and then check the schedule locally.

If a runbook is scheduled to start during an hour that is skipped, due to daylight saving, when the system clock is adjusted forward by one hour, that starting time is skipped, and the runbook starts at the next scheduled time. If a runbook is scheduled to start during an hour that occurs twice because the system clock is adjusted backwards by one hour, the runbook launches twice.

3 thoughts on “Runbook servers in different time zones

  1. Pingback: Schedule runbooks

Leave a Reply

Your email address will not be published. Required fields are marked *