About Resource Scheduler
Learn about Resource Scheduler and how you can use it to reduce the costs of resources in your Oracle Cloud Infrastructure tenancy by automatically starting and stopping to meet your particular business needs.
Oracle Resource Scheduler reduces the cost of your database and Compute resources by stopping them when they're not needed, and restarting them when they're needed. Resource Scheduler creates a fully automated Auto-Stop/Start scheduling function that acts on the resources across an entire tenancy with any schedules that you create.
You can manage schedules that perform actions on a collection of on-boarded resource types so that their lifecycle and operating times are managed to minimize their operating costs. You can create a schedule in a tenancy or a compartment to manage resources in the tenancy or any compartment in it if you create the correct policy. See Resource Scheduler IAM Policies for details.
The Resource Scheduler service is integrated with Oracle Cloud Infrastructure Identity and Access Management (IAM) service, providing easy authentication with native Oracle Cloud Infrastructure identity functionality.
When implemented, the automated management sets the state of resources as needed to effectively manage resources such as those used for testing, development, and demonstration, and reduce costs when using the OCI cloud.
Resource Scheduler supports the following resource types:
- Compute instances
- Compute instance pools
- Autonomous Databases
- Function resources
To get the complete list of supported resources, see the ListResourceTypes API.
Benefits
Resource Scheduler provides the following benefits:
- Save money: Creating a schedule to stop a resource when it's not needed pauses billing for standard Compute shapes and autonomous databases. This reduces the cost of your resources.
- Efficiently manage your resources: The fully automatic Start-Stop functions provide best practices to manage your resources and use them only when needed. Resource Scheduler effectively manages usage of short term resources such as those used for testing and development, and reduces costs when using the OCI cloud.
Using Resource Scheduler, you can create a schedule to stop a set of local resources at 5:00 p.m. when employees go home, and have them automatically restart at 8:00 a.m. at the beginning of the work day. This reduces consumption by 16 hours per day and cuts operating costs by almost 67% per day over letting the resources run 24 hours a day. you can also stop the resources during the weekend when they're not needed.
Using test and demonstration resources, you can create a set of test resources and automatically schedule them to start at specific times, and then automatically stop them when they're no longer needed to optimize their utilization.
How Resource Scheduler Works
Resource Scheduler uses a set of APIs to create work requests that complete specific tasks such as creating, updating, starting, stopping, enabling, disabling, and deleting schedules. During each operation, Resource Scheduler displays the status of the schedule. When Resource Scheduler is enabled, it continuously reads the schedules that you have created. It takes the actions specified in the schedules at the times you have set, on the resources that you have selected. You can create any number of schedules that affect the state of the resources in the tenancies that you specify.
Using Resource Scheduler, you can manage the state of your resources with the Console, REST API, and CLI. Using these tools, you can create, change, start and stop the schedules to best match your needs and tailor the use and costs of your resources.
The following table lists and describes the different operational statuses of Resource Scheduler schedules:
Status | Operation |
---|---|
Creating | The schedule status while you creates a schedule. Resource Scheduler creates a work request with the information you have entered. It takes a minute or more for the system to process the information and create a schedule. |
Failed | The schedule status if Resource Scheduler finds an error in a schedule setting and stops a schedule from being created. Errors can include "Resource not found," "Incorrect time or date format," and blank entries. |
Pending | The schedule status when a schedule is ready to run, but has not started yet, |
Enabled | The schedule status when a schedule has started and is running. |
Ended | The schedule status when a schedule completes its run and stops, the status is Ended. When a schedule ends, it is also disabled. To enable the schedule, you must first update it and change the end date to a future time. |
Updating | The schedule status while Resource Scheduler updates a schedule. If you change a schedule, Resource Scheduler creates a work request with the information you have entered. It takes a minute or more for the system to process the information and update the schedule. When the updates to a schedule are complete, the status depends on whether the schedule is waiting to start or is running. |
Disabled | The schedule status after you disable a pending or enabled schedule, The schedule does not run, even if the start time has passed. |
Enabled | The schedule status after you enable a disabled schedule. |
Prerequisites
This section lists prerequisites for using Resource Scheduler:
Authentication
To use any of the Resource Scheduler API functions, you must be authorized in an IAM policy. If you're not authorized, contact the administrator. If you're an administrator who needs to write policies to give users access, see Managing Identity Domains.
For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI
Using the API and CLI with Different Operating Systems
Note the following requirements for using Resource Scheduler with different operating systems.
Windows
Before using Resource Scheduler on a Windows computer, you must install Git Bash for Windows and run commands with that tool.
To get the key's fingerprint, run the following OpenSSL command at the prompt:
openssl rsa -pubout -outform DER -in \.oci\oci_api_key.pem | openssl md5 -c
When you upload the public key in the Console, the fingerprint is also automatically displayed there. It looks something similar to this: 12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef
In Windows, to pass complex input to the CLI as a JSON string, you must enclose the entire block in double quotes. Inside the block, each double quote for the key and value strings must be escaped with a backslash (\) character.
Linux and Mac OS X
To get the key's fingerprint, use the following OpenSSL command:
openssl rsa -pubout -outform DER -in ~/.oci/oci_api_key.pem | openssl md5 -c
Example Schedules
You can create several types of schedules as shown in the following table.
Display Name | Status | Resource Criteria | Schedule | Action | Last Run Date UTC time | Last Run Status | Next run date ⁝ (see actions menu) |
---|---|---|---|---|---|---|---|
Schedule1 | Enabled | Select Resources | Every week at 10:00 on Monday | Start | Wed, Feb 21, 2024, 20:00:00 UTC | Success | Thu, Feb 22, 2024, 20:00:00 UTC ⁝ |
Compute1 | Enabled | Compartment, Type | Every 2 weeks at 8:00 on Wednesday | Stop | Mon, Mar 4, 2024, 20:00:00 UTC | Success | Wed, Mar 6, 2024, 16:00:00 UTC ⁝ |
Instance3 | Pending | Type, Tag | At 0800 on April 1, 2024 | Start | - | - | Mon, April 1, 2024, 15:00:00 UTC ⁝ |
Autonomous Database 1 | Disabled | Type | Every hour at 00 | Start | Fri, Mar 15, 2024, 20:00:00 UTC | Success | Mon, Apr 1, 2024, 20:00:00 UTC ⁝ |
Autonomous Database 2 | Disabled | Compartment, Type | Every hour at 30 | Stop | Mon, Mar 18, 2024, 20:00:00 UTC | Error | Mon, Apr 1, 2024, 20:00:00 UTC |
Showing 5 items <1 of 1> |
Component | Description | ||
---|---|---|---|
(Schedule) Status |
Select Creating to display the list of statuses. Highlight and select the status of the schedules that you want to see.
|
||
Action Type |
Start: (default) Select the displayed action to change it from start to stop. Stop: Select the displayed action to change it from stop to start. |
||
Filter | Select Filter to display the list with the selected filter. | ||
Reset | Select Reset to display the default filter (Creating). | ||
Name | The name of the schedule. 1 to 1024 char, all letters (upper and lowercase) numbers, all special characters except line feed, carriage return and NULL. | ||
Resource Criteria
Select Select resources. |
Type |
|
Databases
|
|
OCID rx.… | ||
Tag | Namespace A-Key1:Value1 | ||
View resources | Select View resources to see the resources listed by the resource criteria listed above. | ||
Action | The last action that ran on this schedule
|
||
Schedule | The selected time interval date and time when the action is set to run, including the hour, minute, and time zone, in UTC time format. | ||
Last run date | The latest date and time that the schedule ran, in UTC time format. | ||
Last run | The status of the last schedule action.
|
||
Next run date | The next date and time that the Action is scheduled to run, in UTC time format. | ||
⁝ (Actions menu) Select to display the list of actions. |
Select an action to open the relevant window and make needed changes. |