How Schedules Work in ProsperOps Scheduler

Configuring a Schedule

The behavior of ProsperOps Scheduler is controlled by cloud resource tags. To schedule state changes, you must have permission to write tags in your cloud environment.

Schedule Execution Behavior

While Scheduler will execute state changes at the specified times, there is no policy enforcement mechanism that maintains the desired state. If a resource is stopped by Scheduler, then started by an engineer, Scheduler will not take further action until the next scheduled event. This is useful, for example, when troubleshooting during a period when the resource would otherwise be stopped. Enforcing the schedule only on transition points is purposeful and allows for flexibility should the need arise. Managed Resources, the schedules assigned to them, and their corresponding state changes are visible in the ProsperOps Console.

About Schedules

ProsperOps Scheduler understands weekly schedules, and can execute state change events every 15 minutes. Start and stop actions are currently supported, with the option to hibernate instances instead of powering-off for stop actions. If an action fails, it is retried for up to 15 minutes; if the action cannot be executed successfully, a notification can be sent to an email recipient that is configurable at the resource level.

When ProsperOps Scheduler is enabled on an account, it will inventory resource tags in the account every 15 minutes. Schedule attribute additions, updates, and removals are logged in the Event Log view, with the most recent events appearing first. When state changes are made to ProsperOps Managed Resources, either by, or external to Scheduler, Event Log reflects them. Identifying information and current states of Managed Resources are reflected in the Resources view. Resources view also provides a visual depiction of the schedule assigned to each resource.

Manage Schedules

Schedules are defined by a series of cloud resource key/value pairs.

Schedule Syntax

A human-readable syntax is used to specify start and stop times, where each day/time combination is defined by a lower-case, three-letter, day abbreviation, plus a four-digit military time with no colon. Underscores are used to delimit events. Following a given day/time combination, an underscore followed only by a four-digit time will indicate another event in the day previously specified. 

  • Day abbreviations
    • mon
    • tue
    • wed
    • thu
    • fri
    • sat
    • sun
  • Examples
    • mon0900_tue0900_wed0900_thu0900_fri0900
      • “At 9:00am every Monday, Tuesday, Wednesday, Thursday, and Friday”
    • mon1215_tue1215_wed1215_thu1700_1900_fri1800_1900
      • “At 12:15pm on Monday, Tuesday, and Wednesday, 5:00pm and 7:00pm on Thursday, and 6:00pm and 7:00pm on Friday”

ProsperOps Schedule Tags

  • prosperops-schedule-start (key)
    • Days/times a resource should be started, or powered-on
    • Value
      • A schedule specified in Schedule Syntax above
  • prosperops-schedule-stop (key)
    • Days/times a resource should be stopped, or powered-off
    • Value
      • A schedule specified in Schedule Syntax above
  • prosperops-schedule-timezone (key)
    • Timezone of the start and stop schedules
      • Value
        • Taken from the “TZ Identifier” column of the grid here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones 
        • “/” replaced with “-” to conform to cloud provider tag value constraints
        • All characters lower-case
        • Examples
          • america-argentina-san_juan
            • San Juan (SJ)
          • america-new_york
            • Eastern (most areas)
  • prosperops-schedule-notify (key)
    • An email that should receive schedule update and state change failure notifications
    • Value
      • A valid email address
  • prosperops-schedule-stop-hibernate (key)
    • Hibernate a resource instead of power off, if true
    • Value
      • true or false
      • If tag is not included, assume false

A fully specified resource schedule appears as such:

"tags": {

    "prosperops-schedule-power-on": "mon0900_tue0900_wed0900_thu0900_fri0900",

    "prosperops-schedule-power-off": "mon1215_tue1215_wed1215_thu1700_fri1800",

    "prosperops-schedule-timezone": "america-new_york",

  "prosperops-schedule-notify": "prosper.bot@prosperops.com"

}

Tag Validation

For a resource to be scheduled, it must have valid prosperops-schedule-start and/or prosperops-schedule-stop, and prosperops-schedule-timezone tags, otherwise it is considered unscheduled and no further tags will be validated. 

Any schedule tag without a value should be treated like the schedule tag does not exist.

Validation Errors that Prevent Scheduling

Entries are added to Event Log when tag validation errors occur. The following validation errors prevent resources from being started/stopped.

  1. prosperops-schedule-start/prosperops-schedule-stop does not conform to Schedule Syntax defined above
    • If either the prosperops-schedule-stop or prosperops-schedule-start tags are invalid, no actions will be executed,
  2. prosperops-schedule-timezone is missing or invalid
  3. prosperops-schedule-start and prosperops-schedule-stop have the same time value
    • The following example is invalid because both on and off schedules reference Tuesday at 8:00 AM
      • prosperops-schedule-start : mon0800_tue0800_wed0800
      • prosperops-schedule-stop : mon2000_tue0800_wed2000
  4. prosperops-schedule-stop-hibernate is invalid value (not either true or false) and the resource supports hibernation

Validation Warnings

The following validation errors appear in Event Log, but do not prevent resources from being started/stopped.

  • prosperops-schedule-stop-hibernate is not a valid email address
    • Event log message: “prosperops-schedule-notify is an invalid email address: <value>”
  • prosperops-schedule-stop-hibernate is enabled for a resource that does not support hibernation
    • Event log message: “prosperops-schedule-power-off-hibernate is enabled but instance does not support hibernation”

View Schedules

Schedules are visible in the ProsperOps Scheduler Resources view after they have been inventoried. Notification emails appear in the data grid, and schedule definition can be viewed by selecting the calendar icon in the Resources data grid.