Hybrid Cloud for Dummies: Free eBook!!

Hybrid Cloud for Dummies - FREE EBOOK

IT organizations need the right tools and technologies to make hybrid cloud strategies a flexible and efficient reality for their organizations.

Learn how to address inhibitors to cloud adoption, recognize data challenges in the cloud and seamlessly move data in the cloud with this FREE EBOOK!!.

GET YOUR FREE COPY TODAY!!

Sunday, 25 August 2013

Eucalyptus 3.3 Tutorials- Creating Alarms

Eucalyptus 3.3 Tutorials
Creating Alarms


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

CloudWatch alarms allow users to effectively monitor the health of running Eucalyptus Instances, Eucalyptus Load Balancers, EBS volumes as well as applications that are hosted on the Cloud. It also allows users to configure Alarms that can be used to trigger an Autoscaling Policy.

In this tutorial, we are going to create two alarms for few Autoscaling Policies. One alarm will trigger off a policy that will add an instance to the Autoscaling Group if a certain CPU threshold value is crossed for a specific period of time, whilst the other will remove an instance should the CPU threshold fall back below a set point.

You can create multiple such Alarms that can be used to trigger different scale in and out Policies. This is the flexibility that Eucalyptus provides in is Autoscaling feature.

Syntax:
euwatch-put-metric-alarm <ALARM_NAME>
             --metric-name {*METRIC_VALUE}

             --namespace {**NAMESPACE_VALUE}
             --statistic {***STATISTIC_VALUE}
             --period <VALUE>
             --threshold <VALUE>
             --comparison-operator {****COMP_OPERATOR}    

             --dimensions {*****DIMENSIONS_VALUE}     
             --evaluation-periods <VALUE>
             --alarm-actions <POLICY_ARN>


Values:
*METRIC_VALUE: CPUUtilization, DiskReadOps, DiskWriteOps, DiskReadBytes, DiskWriteBytes, NetworkIn, NetworkOut

**NAMESPACE_VALUE
: AWS/EBS, AWS/EC2, AWS/Autoscaling, AWS/ELB

***STATISTIC_VALUE:  Average, Maximum, Minimum, SampleCount, Sum

****COMP_OPERATOR: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold

*****DIMENSION_VALUES: AutoScalingGroupName, ImageId, InstanceId, InstanceType

For a complete list of Metrics and Dimension values for EBS and ELB visit the Eucalyptus 3.3 User Guide


The following code will create a CloudWatch Alarm that will enable the "Scale Out Policy" if the "Average" "CPU Utilization" metric of the Autoscaling Group "MyAutoScalingGroup" crosses a threshold value of "80" for a period of "120" seconds.

Code:

euwatch-put-metric-alarm AddCapacity \
         --metric-name CPUUtilization \
         --namespace "AWS/EC2" \
         --statistic Average \
         --period 120 \
         --threshold 80 \
         --comparison-operator GreaterThanOrEqualToThreshold \
         --dimensions "AutoScalingGroupName=MyAutoScalingGroup" \
         --evaluation-periods 2 \
         --alarm-actions [arn:aws:autoscaling: . . . .MyScaleOutPolicy ]


The following code will create a CloudWatch Alarm that will enable the "Scale In Policy" if the "Average" "CPU Utilization" metric of the Autoscaling Group "MyAutoScalingGroup" drops below the threshold value of "30" for a period of "120" seconds.

Code:

euwatch-put-metric-alarm RemoveCapacity \         
           --metric-name CPUUtilization \ 
         --namespace "AWS/EC2" \           
           --statistic Average \        
         --period 120 \         
         --threshold 30 \        
         --comparison-operator LessThanOrEqualToThreshold \       
         --dimensions "AutoScalingGroupName=MyAutoScalingGroup" \     
         --evaluation-periods 2 \         
         --alarm-actions
[arn:aws:autoscaling: . . . .MyScaleInPolicy ]
 

Few additional commands related to CloudWatch Alarms:

For describing CloudWatch Alarms
euwatch-describe-alarms

For listing all available Metrics
euwatch-list-metrics
 
For deleting CloudWatch Alarms 
euwatch-delete-alarms <ALARM_NAME>
 
 
 
 
 

No comments :

Post a Comment