cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
egonzalez
By
Flexera Alumni

Using the Policy Engine, you can schedule server resources to start and stop at specific times. Maybe a workload only needs to be running during business hours (M-F, 8-4). With the Scheduled Instance Policy, you can run a single policy that manages multiple schedules. Below, I will describe in detail how to get started and how to create the schedule tag.

 

How to apply the policy:

 

1. Go to https://governance.rightscale.com from the left hand-side select Catalog

Screen Shot 2019-04-02 at 12.06.50 AM.png

2. Find the Policy named Schedule Instances and click ApplyScreen Shot 2019-04-02 at 12.07.50 AM.png

The Policy will now run in the background every 15 minutes (default), searching instances with the instance:schedule tag.

Once the policy detects the instance:schedule tag, it will generate additional tags for next_start and next_stop times. The policy will continue to update tags as needed to schedule the start and stop of a resource.

3. Policy Settings

Policy Name: Choose a name for the policy (Operations - Instance Scheduler )

Policy Schedule: How often to search for new schedules and action item (15 min default)

Select Accounts: Policies are scoped to accounts. Each account will have a running policy.

Click Apply.

 

Screen Shot 2019-04-02 at 12.16.38 AM.png

 

4. Tag the servers you would like to be actioned (started/stopped) by the policy

Find servers that need a schedule and add the instance:schedule=<your schedule goes here> tag to the server

Screen Shot 2019-04-02 at 12.19.13 AM.png

5. Email Report

Once the policy has been applied it will run based on the Policy Schedule selected. The policy will add additional tags to the server and will send a report on its findings.

Additional tags after processing

instance:next_start=2019-04-01T13:00:00-04:00
instance:next_stop=2019-04-01T14:00:00-04:00

Example Report

Screen Shot 2019-04-02 at 12.46.34 AM.png

 

Tag Requirements:

 The policy relies on a RightScale tag instance:schedule to stop and start instances based on a schedule. The tag value defines the schedule with a start hour, stop hour and days of the week.

 

Schedule Formatting:

The tag value defines the schedule with a start hour, stop hour and days of the week. The start and stop hours are in 24-hour format (no minute-based formatting is supported) and the days of the week are two character abbreviations.

instance:schedule=STARTHOUR-STOPHOUR;DAYS_OF_THE_WEEK;TIMEZONE

Example tag with schedule

instance:schedule=8-17;MO,TU,WE,TH,FR;America/New_York

Starts instance at 8am, Stops instances at 5pm Monday - Friday, Eastern Time.

 

Actions:

The following policy actions are taken on any resources found to be out of compliance.

  • Stop and Start the instances with the schedule tag
  • Send an email report

Permissions:

This policy requires permissions to access RightScale resources (clouds, instances and tags). Before applying this policy, add the following roles to the user applying the policy. The roles should be applied to all Accounts where the policy will run or the Organization. For more information on modifying roles visit the Governance Docs

  • Cloud Management - Actor
  • Cloud Management - Observer

 

Click here to learn more about all our built-in policies