Amazon EC2 Auto Scaling | General Flashcards

1
Q

What is Amazon EC2 Auto Scaling?

General

Amazon EC2 Auto Scaling | Compute

A

Amazon EC2 Auto Scaling is a fully managed service designed to launch or terminate Amazon EC2 instances automatically to help ensure you have the correct number of Amazon EC2 instances available to handle the load for your application. Amazon EC2 Auto Scaling helps you maintain application availability through fleet management for EC2 instances, which detects and replaces unhealthy instances, and by scaling your Amazon EC2 capacity up or down automatically according to conditions you define. You can use Amazon EC2 Auto Scaling to automatically increase the number of Amazon EC2 instances during demand spikes to maintain performance and decrease capacity during lulls to reduce costs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When should I use Amazon EC2 Auto Scaling vs. AWS Auto Scaling?

General

Amazon EC2 Auto Scaling | Compute

A

You should use AWS Auto Scaling if you want more guidance on defining your application scaling plan, or if you want to scale multiple resources beyond EC2, such as Amazon DynamoDB tables and indexes, or Amazon ECS tasks. At this time, to use AWS Auto Scaling, you must create your applications via AWS CloudFormation or AWS Elastic Beanstalk. AWS Auto Scaling helps you manage all your scaling policies in one place for your applications making tuning easy and intuitive.

You should use Amazon EC2 Auto Scaling if you only need to scale Amazon EC2 Auto Scaling Groups, or just want to maintain the health of your EC2 fleet.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the benefits of using Amazon EC2 Auto Scaling?

General

Amazon EC2 Auto Scaling | Compute

A

Amazon EC2 Auto Scaling helps to maintain your Amazon EC2 instance availability. Whether you are running one Amazon EC2 instance or thousands, you can use Amazon EC2 Auto Scaling to detect impaired Amazon EC2 instances, and replace the instances without intervention. This ensures that your application has the compute capacity that you expect. You can use Amazon EC2 Auto Scaling to automatically scale your Amazon EC2 fleet by following the demand curve for your applications, reducing the need to manually provision Amazon EC2 capacity in advance. For example, you can set a condition to add new Amazon EC2 instances in increments to the Auto Scaling group when the average utilization of your Amazon EC2 fleet is high; and similarly, you can set a condition to remove instances in increments when CPU utilization is low. You can also use Amazon CloudWatch to send alarms to trigger scaling activities and Elastic Load Balancing (ELB) to distribute traffic to your instances within Amazon EC2 Auto Scaling groups. If you have predictable load changes, you can set a schedule through Amazon EC2 Auto Scaling to plan your scaling activities. Amazon EC2 Auto Scaling enables you to run your Amazon EC2 fleet at optimal utilization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is fleet management and how is it different from dynamic scaling?

General

Amazon EC2 Auto Scaling | Compute

A

If your application runs on Amazon EC2 instances, then you have what’s referred to as a ‘fleet’. Fleet management refers to the functionality that automatically replaces unhealthy instances and maintains your fleet at the desired capacity. Amazon EC2 Auto Scaling fleet management ensures that your application is able to receive traffic and that the instances themselves are working properly. When Auto Scaling detects a failed health check, it can replace the instance automatically.

The dynamic scaling capabilities of Amazon EC2 Auto Scaling refers to the functionality that automatically increases or decreases capacity based on load or other metrics. For example, if your CPU spikes above 80% (and you have an alarm setup) Amazon EC2 Auto Scaling can add a new instance dynamically.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is target tracking?

General

Amazon EC2 Auto Scaling | Compute

A

Target tracking is a new type of scaling policy that you can use to set up dynamic scaling for your application in just a few simple steps. With target tracking, you select a load metric for your application, such as CPU utilization or request count, set the target value, and Amazon EC2 Auto Scaling adjusts the number of EC2 instances in your EC2 Auto Scaling group as needed to maintain that target. It acts like a home thermostat, automatically adjusting the system to keep the environment at your desired temperature. For example, you can configure target tracking to keep CPU utilization for your fleet of web servers at 50%. From there, Amazon EC2 Auto Scaling launches or terminates EC2 instances as required to keep the average CPU utilization at 50%.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is an EC2 Auto Scaling group?

General

Amazon EC2 Auto Scaling | Compute

A

An Amazon EC2 Auto Scaling group contains a collection of EC2 instances that share similar characteristics and are treated as a logical grouping for the purposes of fleet management and dynamic scaling. For example, if a single application operates across multiple instances, you might want to increase the number of instances in that group to improve the performance of the application, or decrease the number of instances to reduce costs when demand is low. Amazon EC2 Auto Scaling will automaticallly adjust the number of instances in the group to maintain a fixed number of instances even if a instance becomes unhealthy, or based on criteria that you specify. You can find more information about Amazon EC2 Auto Scaling groups in the Amazon EC2 Auto Scaling User Guide.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What happens to my Amazon EC2 instances if I delete my EC2 Auto Scaling Group?

General

Amazon EC2 Auto Scaling | Compute

A

If you have an EC2 Auto Scaling group with running instances and you choose to delete the Amazon EC2 Auto Scaling group, the instances will be terminated and the EC2 Auto Scaling group will be deleted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do I know when EC2 Auto Scaling is launching or terminating the EC2 instances in an EC2 Auto Scaling group?

General

Amazon EC2 Auto Scaling | Compute

A

When you use Amazon EC2 Auto Scaling to scale your applications automatically, it is useful to know when EC2 Auto Scaling is launching or terminating the EC2 instances in your EC2 Auto Scaling group. Amazon SNS coordinates and manages the delivery or sending of notifications to subscribing clients or endpoints. You can configure EC2 Auto Scaling to send an SNS notification whenever your EC2 Auto Scaling group scales. Amazon SNS can deliver notifications as HTTP or HTTPS POST, email (SMTP, either plain-text or in JSON format), or as a message posted to an Amazon SQS queue. For example, if you configure your EC2 Auto Scaling group to use the autoscaling: EC2_INSTANCE_TERMINATE notification type, and your EC2 Auto Scaling group terminates an instance, it sends an email notification. This email contains the details of the terminated instance, such as the instance ID and the reason that the instance was terminated.

For more information read Getting SNS Notifications when your EC2 Auto Scaling Group Scales.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a launch configuration?

General

Amazon EC2 Auto Scaling | Compute

A

A launch configuration is a template that an EC2 Auto Scaling group uses to launch EC2 instances. When you create a launch configuration, you specify information for the instances such as the ID of the Amazon Machine Image (AMI), the instance type, a key pair, one or more security groups, and a block device mapping. If you’ve launched an EC2 instance before, you specified the same information in order to launch the instance. When you create an EC2 Auto Scaling group, you must specify a launch configuration. You can specify your launch configuration with multiple EC2 Auto Scaling groups. However, you can only specify one launch configuration for an EC2 Auto Scaling group at a time, and you can’t modify a launch configuration after you’ve created it. Therefore, if you want to change the launch configuration for your EC2 Auto Scaling group, you must create a launch configuration and then update your EC2 Auto Scaling group with the new launch configuration. When you change the launch configuration for your EC2 Auto Scaling group, any new instances are launched using the new configuration parameters, but existing instances are not affected. You can see the launch configurations section of the EC2 Auto Scaling User Guide for more details.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How many instances can an EC2 Auto Scaling group have?

General

Amazon EC2 Auto Scaling | Compute

A

You can have as many instances in your EC2 Auto Scaling group as your EC2 quota allows.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What happens if a scaling activity causes me to reach my Amazon EC2 limit of instances?

General

Amazon EC2 Auto Scaling | Compute

A

Amazon EC2 Auto Scaling cannot scale past the Amazon EC2 limit of instances that you can run. If you need more Amazon EC2 instances, complete the Amazon EC2 instance request form.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Can EC2 Auto Scaling groups span multiple AWS regions?

General

Amazon EC2 Auto Scaling | Compute

A

EC2 Auto Scaling groups are regional constructs. They can span Availability Zones, but not AWS regions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Can I launch different types of EC2 instances in same EC2 Auto Scaling group?

General

Amazon EC2 Auto Scaling | Compute

A

EC2 Auto Scaling groups optimize for the case when all your instance types are the same. You can use the AttachInstances API to attach instances of different types to an Auto Scaling group, and you can also update your launch configuration so that any new instances in the group will be launched with a different instance type. However, this will not affect any of the existing instances.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How can I implement changes across multiple instances in an EC2 Auto Scaling group?

General

Amazon EC2 Auto Scaling | Compute

A

You can use AWS CodeDeploy or CloudFormation to orchestrate code changes to multiple instances in your EC2 Auto Scaling group.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

If I have data installed in an EC2 Auto Scaling group, and a new instance is dynamically created later, is the data copied over to the new instances?

General

Amazon EC2 Auto Scaling | Compute

A

Data is not automatically copied from existing instances to new instances. You can use lifecycle hooks to copy the data, or an Amazon RDS database including replicas.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

When I create an EC2 Auto Scaling group from an existing instance, does it create a new AMI (Amazon Machine Image)?

General

Amazon EC2 Auto Scaling | Compute

A

When you create an Auto Scaling group from an existing instance, it does not create a new AMI. For more information see Creating an Auto Scaling Group Using an EC2 Instance.

17
Q

How does Amazon EC2 Auto Scaling balance capacity?

General

Amazon EC2 Auto Scaling | Compute

A

Balancing resources across Availability Zones is a best practice for well-architected applications, as this greatly increases aggregate system availability. Amazon EC2 Auto Scaling automatically balances EC2 instances across zones when you configure multiple zones in your EC2 Auto Scaling group settings. Amazon EC2 Auto Scaling always launches new instances such that they are balanced between zones as evenly as possible across the entire fleet. What’s more, Amazon EC2 Auto Scaling only launches into Availability Zones in which there is available capacity for the requested instance type.

18
Q

What are lifecycle hooks?

General

Amazon EC2 Auto Scaling | Compute

A

Lifecycle hooks let you take action before an instance goes into service or before it gets terminated. This can be especially useful if you are not baking your software environment into an Amazon Machine Image (AMI). For example, launch hooks can perform software configuration on an instance to ensure that it’s fully prepared to handle traffic before Amazon EC2 Auto Scaling proceeds to connect it to your load balancer. One way to do this is by connecting the launch hook to an AWS Lambda function that invokes RunCommand on the instance. Terminate hooks can be useful for collecting important data from an instance before it goes away. For example, you could use a terminate hook to preserve your fleet’s log files by copying them to an Amazon S3 bucket when instances go out of service.

Visit lifecycle hooks in our Amazon EC2 Auto Scaling User Guide for more information.

19
Q

What are the characteristics of an “unhealthy” instance?

General

Amazon EC2 Auto Scaling | Compute

A

An unhealthy instance is one where the hardware has become impaired for some reason (bad disk, etc.), or it is not passing a user-configured ELB health check. Amazon EC2 Auto Scaling performs health checks on each individual EC2 instance at regular intervals, and if the instance is connected to an Elastic Load Balancing load balancer, it can also perform ELB health checks.

20
Q

Can I customize a health check?

General

Amazon EC2 Auto Scaling | Compute

A

Yes, there is an API called SetInstanceHealth that allows you to change an instance’s state to UNHEALTHY, which will then result in a termination and replacement.

21
Q

Can I suspend health checks (for example, to evaluate unhealthy instances)?

General

Amazon EC2 Auto Scaling | Compute

A

Yes, you can temporarily suspend Amazon EC2 Auto Scaling health checks by using the SuspendProcesses API. You can use the ResumeProcesses API to resume automatic health checks.

22
Q

Which health check type should I select?

General

Amazon EC2 Auto Scaling | Compute

A

If you are using Elastic Load Balancing (ELB) with your group, you should select an ELB health check. If you’re not using ELB with your group, you should select the EC2 health check.

23
Q

Can I use Amazon EC2 Auto Scaling for health checks and to replace unhealthy instances if I’m not using Elastic Load Balancing (ELB)?

General

Amazon EC2 Auto Scaling | Compute

A

You don’t have to use ELB to use Auto Scaling. You can use the EC2 health check to identify and replace unhealthy instances.

24
Q

Do the Elastic Load Balancing (ELB) health checks work with Application Load Balancers and Network Load Balancers? Will an instance be marked as unhealthy if any target group associated with it becomes unhealthy?

General

Amazon EC2 Auto Scaling | Compute

A

Yes, Amazon EC2 Auto Scaling works with Application Load Balancers and Network Load Balancers including their health check feature.

25
Q

Is there any way to use Amazon EC2 Auto Scaling to only add a volume without adding an instance?

General

Amazon EC2 Auto Scaling | Compute

A

A volume is attached to a new instance when it is added. Amazon EC2 Auto Scaling doesn’t automatically add a volume when the existing one is approaching capacity. You can use the EC2 API to add a volume to an existing instance.

26
Q

What does the term “stateful instances” refer to?

General

Amazon EC2 Auto Scaling | Compute

A

When we refer to a stateful instance, we mean an instance that has data on it, which exists only on that instance. In general, terminating a stateful instance means that the data (or state information) on the instance is lost. You may want to consider using lifecycle hooks to copy the data off of a stateful instance before it’s terminated, or enable instance protection to prevent Amazon EC2 Auto Scaling from terminating it.