Resource Scheduler Overview

Oracle Cloud Infrastructure Resource Scheduler is an Oracle Cloud Infrastructure (OCI) cost management service that you can use to reduce the costs of resources in your tenancy by automatically stopping them when they're not needed, and automatically restarting them when they are needed again.

Introduction

Oracle Resource Scheduler is an Oracle Cloud Infrastructure (OCI) service that can reduce the cost of your database and compute OCI cloud resources by stopping them when they are not needed, and restarting them when they are needed again. This service 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 use the Console, CLI, or API to create and manage schedules, that perform actions on a collection of onboarded resource types so that their lifecycle and operating times are managed to minimize their operating costs.

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 of the state of selected resources lets you effectively manage the state of resources such as those used for testing, development, and demonstration, and reduce costs when using the OCI cloud.

Benefits

Resource Scheduler helps you:

  • Save money. Creating a schedule to stop a resource when it is not needed pauses billing for Standard Compute shapes, Autonomous Database and Base Database. 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.

Examples:

  • Using Resource Scheduler, a tenancy admin can create a schedule to stop a set of local resources at 5 PM when employees go home and automatically restart them at 8 AM the next morning when the employees return to work. 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. The tenancy admin can also stop the resources during the weekend, so that the resources do not incur any costs during that time.
  • Tenancy admins can create a set of test resources and automatically schedule them to start at specific times, and then automatically stop them when they are no longer needed. Test and demonstration resources would fall into this category.

Operation

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.

How Schedules Work

Resource Scheduler uses a set of APIs to create work requests to complete specific tasks such as creating, updating, starting, stopping, enabling, disabling, and deleting schedules.

  • When you create 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. The schedule status during that time is Creating.
  • If Resource Schedulerr finds an error in a schedule settings and stops a schedule from being created, Resource Scheduler sets the status to Failed.
  • When a schedule is ready to run, but has not started yet, the status is Pending.
  • When a schedule starts and is running, the status is Enabled.
  • When a schedule completes its run and stops, the status is Ended. Note that the schedule is also Disabled. To enable the schedule, you must first update it and change the end date to a future time.
  • 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. The schedule status during that time is Updating. When the updates to a schedule are complete, the status depends on whether the schedule is waiting to start or is running.
  • When you disable a Pending or Enabled schedule, the status is Disabled. The schedule does not run, even if the start time has passed.
  • When you enable a Disabled schedule, the status is Enabled.

Examples

Here are some examples of how you can use Resource Scheduler. In these schedules, you would enter a schedule name, the schedule time, the action to take, the resource definition, and the name of the compartment, tenancy, or region,

  • Start a database at 8:00 AM on a specified date
  • Start a specific compute resource at 8:00 PM every weekday
  • Stop the same compute resource at 5:00 PM every weekday
  • Stop all demo compute instances on the last day of the month.
  • Stop all resources on a specific day in the future, for example stop resources on May 1.

More Information

This section provides details about how Resource Scheduler works, the concepts used in Resource Scheduler, ways to access Resource Scheduler, Resource Scheduler authentication and authorization and using the CLI and API.

How Resource Scheduler Works

Resource Scheduler uses user-created schedules to manage the operational state of the resources in user specified tenancies, realms, and compartments. This section explains the details of how it works.

Resource Management

Resource Scheduler uses three types of resource management:

Static Resource Management
With static resource (list-based) management, when you create a resource action schedule, the Resource Action Schedule is limited to a list of 0...n Resource OCIDs to act on. When a schedule is created or edited, you can search for resources and then select the specific resources that will be managed by the schedule.
Note

Searching for resources can be done only through the Console.

Specifically selecting a resource ensures that the resource is always managed by a schedule and prevents unintentionally stopping the resource.

Dynamic Resource Management

An alternative approach to selecting resources for a schedule is to follow up feature is to allow a 'Resource Filter' in the Resource Definition that will enable dynamic querying of resources based on resource type, tag values, and age since creation. When applying these filters, the list of potentially affected resources will be shown so the schedule creator can determine what the impact will be. By having both Static and Dynamic resource definition types, customers can ensure that a specific resource is always managed by a schedule and also enable large scale management of resources based on their attributes.

Managing Resources at Scale

Most large organizations own and operate a large number of tenancies, and need to effectively manage the resources they contain. You can use Dynamic Resource Management to handle less critical resources such as test environments, and Static Resource Management to manage critical resources. Using both Static and dynamic management allows you to manage resources at scale.

Resource Scheduler CLI and API

To use any of the Resource Scheduler API operations, 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 Getting Started with Policies

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

Windows:

  • Before using Windows, you must install Git Bash for Windows and run commands with that tool.
  • 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
  • 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.
  • When you upload the public key in the Console, the fingerprint is also automatically displayed there. It looks something like this: 12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef

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