CloudNatix logo

User Guide

VM Optimization - Scheduling Start and Stop

Overview

This document describes the CloudNatix feature that allows users to schedule start, stop, and resize of EC2 instances.

Set up

The following permissions are needed to an IAM role given to CloudNatix: start/stop/resize of EC2 instances:

  • ec2:StartInstances
  • ec2:StopInstances
  • ec2:ModifyInstanceAttribute

How to Manage Schedules

From GUI

Start/stop schedules can be created from the "Workloads" page.

Step 1. Click the "Compute instances" tab.

img

Step 2. Click the "Schedules" icon of the target instance.

img

Step 3. Create a start-stop schedule by specifying the time with the cron job format.

img

From CLI

The commands under cnatix infrastructure compute instances schedule are used to manage schedules.

$ cnatix infrastructure compute instances schedule

Commands for managing schedule of compute instances

Usage:
  cnatix infrastructure compute instances schedule [command]

Available Commands:
  create      Create a new instance schedule
  delete      Delete an instance schedule
  get         Get an instance schedule
  list        List instance schedules

Here is an example command for creating a new schedule:

cnatix infrastructure compute instances schedule create \
  --cluster-name my-cluster \
  --name shutdown-test \
  --start-schedule "0 21 * * *" \
  --stop-schedule "0 9 * * *" \
  --targets "Name=DEV-INST"

This creates a schedule that stops instances at 9:00 AM UTC and starts the instances at 21:00 PM UTC. The target instances are specified via the EC2 instance tag (Name=DEV-INST for this case).

The created schedule can be confirmed via cnatix infrastructure compute instances schedule list command:

$ cnatix infrastructure compute instances schedule list \
  --cluster-name my-cluster

+---------------+----------------+---------------+------------------+
|     NAME      | START SCHEDULE | STOP SCHEDULE |    TARGETS       |
+---------------+----------------+---------------+------------------+
| shutdown-test | 0 21 * * *     | 0 9 * * *     | Name=DEV-INST    |
+---------------+----------------+---------------+------------------+

Please see the CLI reference for the details of each command.

Previous
Audit Log Guide
Next
CLUI & Keyboard Shortcuts