Friday, 16 August 2013

Eucalyptus 3.3 Tutorials- Creating Triggers

Eucalyptus 3.3 Tutorials
Creating Triggers


In this set of tutorials, we are going have a look at the steps required to configure Autoscaling Triggers also known as Scaling Policies

Scaling Policies

Scaling Policies define how to perform scaling actions. Scaling policies can execute automatically in response to CloudWatch alarms, or you can execute them manually as well.

Scaling policies can either be triggered to "Scale Out" your instances (grow in number) or even "Scale In" (shrink in number).

You can set multiple Scaling Policies for each of your Autoscaling Groups, thus defining multiple points of scale in and out for your application, depending on varying workloads.

There are two types of scaling policies/ triggers: 
  1. On-Demand: These are triggered dynamically based on your application's workloads. Such Policies are generally used when the application workload is unknown, i.e. variable in nature.
  2. Scheduled: These are triggered based on a schedule, or a particular point in time. Such Policies are handy when the application workload is predictable and known in advance. 

In this set of tutorials, we will be focusing on the Rule-based Scaling policies, however scheduled-based policies do not differ much in syntax either.

Syntax:

euscale-put-scaling-policy <POLICYNAME> 
                                    --auto-scaling-group <AUTOSCALEGROUPNAME>
                                    --adjustment <VALUE>

                                    --type {ChangeInCapacity,ExactCapacity,PercentChangeInCapacity}


This is the basic syntax that will get you Scaling Policy up and running. You can optionally provide additional parameters as you see fit.



You need to create a minimum of two scaling policies for each Auto-Scaling group. One policy that will help your Group scale in and the other will help in scaling out your instances. Each scaling policy will provide you with an Amazon Resource Name (ARN). You need to note down this ARN for use in further steps when we configure the CloudWatch Alarms

Code:

euscale-put-scaling-policy MyScaleoutPolicy \
                      --auto-scaling-group MyAutoScalingGroup \
                      --adjustment=1 
                      --type ChangeInCapacity
The following command will scale out your auto-scaling group by 1 instance when it is triggered. Note the ARN supplied by the output.



Code:

euscale-put-scaling-policy MyScaleinPolicy \
                      --auto-scaling-group MyAutoScalingGroup \
                      --adjustment=-1 
                      --type ChangeInCapacity
The following command will scale in your auto-scaling group by 1 instance when it is triggered. Note the ARN supplied by the output.


Few additional commands related to Scaling Policies:

For describing Autoscaling Group
euscale-describe-policies

For deleting Autoscaling Group
euscale-delete-policy -g <AUTOSCALEGROUPNAME> POLICYNAME





No comments :

Post a Comment