Thursday, 8 August 2013

Eucalyptus 3.3 Tutorials- Creating Autoscaling Group

Eucalyptus 3.3 Tutorials
Creating Autoscaling Groups


In this set of tutorials, we are going have a look at the steps required to configure an Autoscaling Group

Autoscaling Groups

This contains the information about the instances that will be actually be used for scaling operations.
The Auto Scaling group defines the minimum, desired (optional), and maximum number of instances that you will use to scale your application in times of varying workloads.

NOTE: Few scenarios may require a "desired" number on instances to be running in an autoscaling group, irrespective of the minimum and maximum instances defined. If in case you do not mention the desired count, then the default value is considered to be same as the minimum instance count.



To get started, we first need to create our Autoscaling Group. For that, we use the "euscale-create-auto-scaling-group" command as shown below:

NOTE: Before you begin configuring an autoscaling group, you need to have configured a Launch Configuration as described in the earlier tutorial.

Syntax:

euscale-create-auto-scaling-group <AUTOSCALEGROUP> 
                                    --launch-configuration <LAUNCHCONFIG>
                                    --availability-zone <AVAIL_ZONE>
                                    --min-size <VALUE>

                                    --max-size <VALUE>
                                    --desired-capacity <VALUE>

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


Code:

euscale-create-auto-scaling-group MyAutoScalingGroup \
                                    --launch-configuration MyLaunchConfig \
                                    --availability-zones CLUSTER01 \
                                    --
min-size 1 \  
                                    --max-size 5 \
                                    --desired-capacity 2 

NOTE: In this code, we have set our desired capacity to 2. This statement will immediately launch 2 instances in the availability zone that you have specified irrespective of the min-size parameter. If you do not specify the desired capacity, then a single instance (since value of --min-size 1) will be launched in the specified availability zone.


Once done, you will be provided with an output similar to the image shown above. With this, your Autoscaling Group is now ready.

Few additional commands related to Autoscaling Groups:

For describing Autoscaling Group
euscale-describe-auto-scaling-group <AutoScalingGroupName>

For deleting Autoscaling Group
euscale-delete-auto-scaling-group <AutoscalingGroupName>

For updating Autoscaling Group:
euscale-update-auto-scaling-group <AutoScalingGroupName> 
                                            --min-size <VALUE>            
                                            --max-size <VALUE> 
                                            --desired-capacity <VALUE>

NOTE: You cannot delete an Autoscaling Group while you have instances associated with it in the running state. To delet the instances, you can update your autoscaling Group and set both the minimum and maximum instance size as zero. Once done, the running instances will be terminated and then you can delete the Gruop.
Alternatively, you can also use the "--force-delete" parameter with your euscale-delete-auto-scaling-group command. This will deleted the Autoscaling Group along with all instances associated with it, without waiting for the instances to be terminated.




>> Step 3: Creating Scaling Policies







No comments :

Post a Comment