Elastic Cloud Gate

AWS Blog

How to Schedule Start, Stop or Reboot AWS EC2 Instance

To schedule Start, Stop or Reboot EC2 Instance using Elastic Cloud Gate:

  1. To open scheduler wizard go to EC2 and from the Menu select “Schedule”
    EC2 Scheduler
  2. In the action column select the schedule type (i.e. Start, Stop or Reboot)
  3. The next step is to setup, when the action should occur:Occurrence:
    1. Hourly – The action will be executed every given number of hours. In addition you can specify start and end time. For instance, if you want to reboot instance every 2 hours between 8AM and 7PM the setup would look like this:

      EC2 Hourly Scheduler

      If you skip the start and end time, the instance will be rebooted every given number of hours around the clock.
    2. Daily – The action will be executed every selected day and given time. For instance, to start Instance every weekday at 8AM the setup would look like this:

      EC2 Daily Scheduler
    3. Monthly – The action will be executed every given day of the month at any given time. For example, to reboot instance every 3rd day of the month at 8AM the setup would look like this:

      EC2 Monthly Scheduler

    You can setup multiple schedulers for the same EC2 instance using different actions. For example, to start instance every weekday at 8AM and stop it at 6PM the schedule would look like this:

    EC2 Hourly Scheduler

  4. Stop Condition

    Sometimes there will be a situation when you want to prevent stop instance when activity on the EC2 still takes place. In this case, you could use the “Stop Condition” by specific rules of when the stop action shouldn’t be executed. The rules can be set based on the CPU or Network usage. For example, you could prevent stop instance when the CPU usage is above a certain threshold.

    When the stop condition is specified, our system will check given EC2 CloudWatch metric before stop instance takes place. If the value is greater than provided in threshold, the action will not be executed.

    In order to use the stop condition, EC2 has to have detail monitoring turned on. If the detail monitoring is not enabled, the CloudWatch might return information that are 15 minutes delayed and because of that not reflecting the current usage condition. That’s why we require to have detail monitoring turned on.

    You can turn on detail monitoring directly from the AWS Management Console or by clicking the “Enable Detail Monitoring” link. If you don’t see the link on your screen, it means that the detail monitoring is already turned on for the given EC2 instance.

    EC2 Scheduler - Turn On Detail Monitoring

  5. Extend Operation Hours

    Sometimes you might need to temporarily change the schedule (e.g. stop the instance two hours later). Instead of changing the whole schedule, you can extend the operation of the EC2 Instance by adding or subtracting hours.You can select if the new hours should be applied to today’s or tomorrow’s schedule and whether they should be applied the start or stop action. For example, to extend operation of the EC2 instance in current day for another 2 hours you should select “Today” “Stop” and then click twice the “+1h” button. After that you should see “Today: stop +2” under “Extended hours”

    EC2 Scheduler - extend operation hours

  6. Suspend/Resume Schedule

    At any given time you can suspend or resume previously suspended schedule. To do this from the list of schedules, click “Suspend” or “Resume”. When you click “Suspend” the scheduled action will be suspended until you resume it. Please remember that if you suspend scheduled action for 6PM execution and you resume it at 7PM the same day, it will not resume until next day at 7PM.

    EC2 Scheduler - Turn On Detail Monitoring

  7. Notification

    Notification allows you to select how you want to be notify about task execution. To read more about notification options, please visit our Help site

    EC2 Scheduler - Notification

, ,

Leave a Reply