Lab 9: Enabling Auto Scale to Handle Spikes and Troughs

The lab script contains an excerpt from the AWS documentation in regards to auto scaling: “Auto Scaling is a web service designed to launch or terminate Amazon EC2 instances automatically based on user-defined policies, schedules, and health checks.”

Auto Scaling is found under the EC2 service.
001 Launch Configurations

The ‘Launch Configurations’ option needs to be selected, then clicking on ‘Create Auto Scaling Group’ followed by ‘Create Launch Configuration’.
The configuration needs to have the following specifications:

002 Choosing Web Server from my AMIs

My AMIs: DinoStoreWebServer
Instance: t2.micro
Name: scale-web
IAM Role:  WebServerRole
Security Group: WebRDPGroup
Key Pair: (I’m using an existing key pair)

003 Review Launch 1 of 2004 Review Launch 2 of 2
In ‘Create Auto Scaling Group’ a group needs to be created with the following specifications:

Group Name: scale-web-asg
Group Size: starting with two instances
Network: Default VPC
Subnet: Default subnets for each Availability Zone

005 Create Auto-Scaling Group

Advanced Details:
Receive traffic from ELB: DinoStoreLB
Health Check Type: ELB
006 Advanced details 9_1_c_v
Configure Scaling Properties:
Group remains at initial size
007 Auto-Scaling Policies
Tags-Name:ASG-WebServer, Tag instances

 

In the EC2 dashboard, the auto scaling information shows the instances launch, as does the instance screen.
The lab script makes mention that the manually created servers would usually be deleted before or after the set up of the auto scaling group. This would be because of their inability to scale.
The load balancer screen also shows the status of the instances in service.
012 AS w Two Instances

Using the load balancer URL, the DinoStore web site can be displayed. Upon refreshing the site, the internal IPs change.

This slideshow requires JavaScript.

For this all of my instances attached to the load balancer were utilized.

Then in the EC2 instance window, the web server and its image (the non auto-scaling instances) need to be terminated, before testing the DinoStore site refresh to check the number of IPs available.

This slideshow requires JavaScript.

The number of different IPs available dropped down to match the number of auto scale IP instances within the load balancer.

In order to test the auto scaling, one of the autoscale instances needs to be terminated, and then the EC2 instance window and the auto scaling groups window need to be checked for a new instance being automatically created.
020 AS Instances Starting with Available Space
After the new instance is in service, the DinoStore page again needs refreshing to check the number of IP addresses. (This has more than one new instance in progress as I was playing around with the settings and set the desired number of instances to five.)

 

Challenges
The challenge I faced with this lab was due to my lack of knowledge that I can only have ten EC2 instances available at any one time. The auto scaling group ended up failing because of this limitation, which I had reached with the rest of my instances.
010 Auto-Scaling -Activity History w One Instance
In order to resolve this, I terminated any unnecessary instances.