Elastic Cloud Gate

AWS Blog

EC2 Scheduler Demystifying

In this article we explain how to use and navigate through Elastic Cloud Gate EC2 Schedulers.

I. Schedulers

Below, we have listed different schedulers available under EC2 section.
The red numbers correspond to the numbers described in the “Configuration” section further in this article.

EC2 Scheduler

EC2 Scheduler

Snapshot Scheduler

Snapshot Scheduler

AMI Scheduler

AMI Scheduler

Volume Size Scheduler

Volume Size Scheduler

Always On Scheduler

AlwaysOn Scheduler

Change Instance Type Scheduler

Change Instance Type Scheduler

II. Configurations

1. Action

Allows to select an action to be executed by the scheduler.

2. Executing Time

In the “Execution Time” section, you can specify when a scheduled action should occur.
Each action can be executed based on the Hourly, Daily or Monthly schedule.

To start scheduling, first from the “Occur” drop down list select what bases should the action be executed on.

After selecting occurrence, the form will adjust automatically, to enter values appropriate to the selected schedule.

“Hourly” schedule:

a. “Occurs Every” – this is the number of hours between occurrences. This field is required.
b. “Starting At” – the time of the first occurrence. This field is not required. If not provided, the first schedule will be executed at 12AM and after that every # of hours specified in “Occurs Every.”
c. “Ending At” – the time of last occurrence. This field is not required. If not provided, the actions will be executed until 11:59PM.

Examples:
• Schedule execution every 2h starting from 5AM to 8PM
• Schedule execution every 5h around the clock

“Daily” schedule:

a. “Days” – this allows you to check what days of the week the action should be executed. This field is required.
b. “Time” – the time when action should be executed. This field is required.

Examples:
• Schedule execution every weekday at 5AM
• Schedule execution on weekend at 8PM

“Monthly” schedule:

a. “Occurs Every” – this is the day of the month when the action should be executed. This field is required
b. “Time” – the time when action should be executed. This field is required.

Example:
• Schedule execution on the 1st day of every month at 3AM

Note:
All time values have to be entered in 24h format. For example 8:00 PM has to be enter as 20:00
All dates and times are considered the local time of the AWS region when the given action is executed.

3. Assigning Elastic IP Address

This option is available only for “Start Instance” action.
There are two conditions that have to be met in order to have access to this feature:
a. The schedule instance cannot be inside VPC
b. There has to be at least one EIP created

In case any of the above conditions are not met, “Assign Elastic IP Address” section will not be visible on the scheduler.

To force the schedule to assign EIP to the given instance after start, check the box “Assign IP after Instance Start” and from the list select IP address you want to assign to the Instance.

4. Stop Condition*

This section applies only to “Stop Instance” action.
“Stop Condition” can be used to prevent stop instance when certain level of activities, such as CPU or Network Usage (which might indicate that some users are currently connected to the server) are above provided threshold.

To schedule stop condition, first the given instance has to have “Details Monitoring” turned on. This is required in order to get the current condition. If “Details Monitoring” is not turned on, you can do this directly from our scheduler by clicking “Enabled Details Monitoring” or from the Amazon Management Console. If the “Details Monitoring” is turned on, the option to “Enable Details Monitoring” will not be visible on the scheduler.

When “Network In” or “CPU Utilization” is provided, before Stop Instance, scheduler will check current metric of the instance, and if above the threshold, action will not be executed until the level of activity drops below the threshold.

EC2 Stop Condition

To get an idea of what the idle level of activity is, you can click “Chart,” to see the metric chart for given EC2 Instance.

EC2 Metrics

To go back to scheduler, click “Back to Scheduler.”

5. Extend Operation Hours*

In some situations, you might be required to temporarily change the schedule in order to stop or start instance in later or earlier time. Instead of changing the main schedule, you can use “Extend Operation Hours” to temporarily change the execution time.

To do this, first from the drop down list select if you are planning to change the action time for the scheduler that is planned to be execute today or tomorrow.
Next, select if the time change should be applied to “Start” or “Stop” action.
Lastly, set the new time by adding or subtracting hours from the original schedule time.
“-1”, “-4” – execute action 1 or 4 hours earlier
“+1”,”+4” – postpone action for 1 or 4 hours
By clicking “+” or “-“buttons multiple times, you can adjust time to appropriate values.
For instance, to postpone execution for 3 hours, click 3 times on “+1” button.

EC2 Extended Hours

You will see all changes made to the scheduler on the right hand side.
For the same instance, you can make multiple scheduler changes at the same time.
For example, you can extend # of hours to stop instance later in the day and start instance earlier the next day.

EC2 Extended Hours

6. Snapshot Description

This section allows to provide name and description of the new snapshot created by scheduler.
If above information is provided, the scheduler will create a new snapshot with default name and description.
“Name” – name of the snapshot
“Description” – description of the snapshot
“Add Timestamp to Snapshot Name” – when checked, the snapshot time will be added to the name and description (time will be in UTC format).
“Add Volume ID to Snapshot Name” – when checked, the EBS Volume Id will be added to the name and description.

7. AMI Description

This section allows to provide description for the new AMI created by scheduler. If skipped, the scheduler will create AMI with default description.
“Name” – name of the AMI
“Add Timestamp to AMI Description” – when checked, the AMI time will be added to the description (time will be in UTC format).
“Add Instance ID to AMI Description” – when checked, the EC2 Instance Id will be added to the description.

8. Maintenance

Maintenance section applies to Snapshot and AMI backup. This feature allows to delete the old objects (Snapshots or AMIs) and leave only those, which meet specified criteria.

The maintenance scheduler has 3 fields allowing to provide criteria determining which objects should be kept.
When maintenance is executed, all object that did not meet the criteria will be deleted. For security reason, the object created last will never be deleted.

The first field (drop down list) allows to specify which objects should be kept:
“Keep All From Last” – this option will keep all snapshots created within the last x periods.
For example – “Keep All From Last 5 Months” – will keep all snapshots created within the last 5 months. All other snapshots will be deleted.

“Keep One Per Period For Last” – this option will keep one snapshot per selected period within x periods. Kept snapshot(s) will be the last snapshot(s) generated in each period.
For example “Keep One Per Period For Last 5 Months” – will keep the last snapshot generated in each month within the last 5 months. All other snapshots will be deleted.

The other two fields allow you to enter the period length

EC2 Maintenance

Include Cross-Region Maintenance – when checked, the maintenance will apply to AMIs or Snapshots copied to another region.

You can create multiple maintenance schedulers for a single object.
For example, you can schedule maintenance to keep snapshots from the last 5 days, and another one to keep one snapshot per month from the last 5 months.

EC2 Maintenance

9. Copy to Another AWS Region

This option applies to Snapshots and AMIs and allows to transfer created object (Snapshot or AMI) to another AWS Region. The object can be transferred to single or multiple AWS regions.

To transfer newly created object (Snapshot or AMI) to another region, from the drop down list select the destination region(s).

“Copy Snapshot to Different Region” – check this to transfer snapshot to destination region
“Copy AMI to Different Region” – check this to transfer AMI to destination region

10. Change Volume Size

“Grow By” – this option allows to specify how much should the volume be extended by. This value can be given in GB or in %.
When provided in GB – the new volume will be extended by provided size. For example, if existing size of volume is 100GB and provided value is 10GB, the new size of volume will be 110GB (100+10GB).
When provided in % – the new volume will be extended by the percentage of the existing one. For example, if existing size of the volume is 120GB and provided value is 20%, the new size of the volume will be 144GB (120 + (120 * 20%)GB).

“Volume Type” – this option allows to specify what should be the type of the newly extended volume.
“Stop instance before change volume size” – when checked, the EC2 instance will be stopped before the change of volume size. For the root volume, this option will be checked automatically without an option to uncheck it.

11. Save Scheduler

To save scheduler, click “Save” button located at the bottom of the scheduler window.

EC2 Scheduler

After saving, all schedules to the given AWS object (EC2 Instance or EBS Volume) will appear in the table.

EC2 Scheduler

12. Save Maintenance

To save Maintenance click “Save.”

EC2 Maintenance

After saving, all maintenance applied to the given AWS object (Snapshot or AMI) will appear in the table.

EC2 Maintenance

13. Manage Existing Scheduler

Each object (EC2 Instance, EBS Volume, etc.) can have more than one scheduler.
For example, for the same instance you can create scheduler to start instance at 5AM and stop it at 6PM.
Each schedule will be visible in the table at the bottom of the scheduler window.

EC2 Scheduler

In addition to basic information that are relevant to a given scheduler, there will be three additional options: Edit, Delete, and Suspend/Resume.

To edit given scheduler, click “Edit”, modify data and click “Save.”
To delete schedule, click “Delete.”

EC2 Scheduler

If for any reason you need to suspend the execution of a given schedule, click “Suspend.” The text will change to “Resume.”
To resume suspended scheduler, click “Resume,” the text will change back to “Suspend.”

EC2 Scheduler

“Suspend” – indicates that the action will be executed as scheduled.
“Resume” – indicates that the schedule is suspended and the action will not be executed.

14. Manage Existing Maintenance

Each object (AMI or EBS Volume) can have more than one maintenance plan scheduled.

Every scheduled maintenance will be visible in the table at the bottom of the scheduler window.

To edit given maintenance, click “Edit”, modify data and click “Save.”
To delete scheduled maintenance, click “Delete.”

EC2 Maintenance

Download PDF version of this article

, , ,

Leave a Reply