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.
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:
My AMIs: DinoStoreWebServer
IAM Role: WebServerRole
Security Group: WebRDPGroup
Key Pair: (I’m using an existing key pair)
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
Receive traffic from ELB: DinoStoreLB
Health Check Type: ELB
Configure Scaling Properties:
Group remains at initial size
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.
Using the load balancer URL, the DinoStore web site can be displayed. Upon refreshing the site, the internal IPs change.
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.
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.
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.)
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.
In order to resolve this, I terminated any unnecessary instances.