Auto Scaling Groups Flashcards

1
Q

Launch configuration can’t be modified after creation and needs to be created new if any modification required: True/False

A

True

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

How would you add detailed monitoring on EC2 under ASG?

A

Basic or Detailed monitoring for the instances in the Auto Scaling group can be enabled when a launch configuration is created.

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

Default monitoring types:

  1. From AWS Console
  2. Via CLI or API
A

By default, basic monitoring is enabled when you create the launch configuration using the AWS Management Console and detailed monitoring is enabled when you create the launch configuration using the AWS CLI or an API

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

Desired capacity Vs Minimum Capacity

A

o To determine the number of instances the ASG must maintain at all times. If missing, it equals to the minimum size.
o Desired capacity is different from minimum capacity.
o An Auto Scaling group’s desired capacity is the default number of instances that should be running. A group’s minimum capacity is the fewest number of instances the group can have running

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

Auto Scaling groups span multiple regions: True/False?

A

False

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

What happens old instances launched via old LC, when LC config changes?

A

When the launch configuration for the Auto Scaling group is changed, any new instances launched use the new configuration parameters, but the existing instances are not affected.

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

Minimum Vs Desired Vs Maximum Capacity

A

MIN: This will be the minimum number of instances that can run in your auto scale group. If your scale down CloudWatch alarm is triggered, your auto scale group will never terminate instances below this number

DESIRED: If you trip a CloudWatch alarm for a scale up event, then it will notify the auto scaler to change it’s desired to a specified higher amount and the auto scaler will start an instance/s to meet that number. If you trip a CloudWatch alarm to scale down, then it will change the auto scaler desired to a specified lower number and the auto scaler will terminate instance/s to get to that number.

MAX: This will be the maximum number of instances that you can run in your auto scale group. If your scale up CloudWatch alarm stays triggered, your auto scale group will never create instances more than the maximum amount specified.

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

How does ALB determine the health state of each instance?

A
  • Auto Scaling group determines the health state of each instance by periodically checking the results of EC2 instance status checks
  • Auto Scaling group can be associated with a load balancer enabled to use the Elastic Load Balancing health check, Auto Scaling determines the health status of the instances by checking the results of both EC2 instance status and Elastic Load Balancing instance health.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Can we mark unhealthy instance back to healthy?

A

• For an unhealthy instance, the instance’s health check can be changed back to healthy manually but you will get an error if the instance is already terminating. Because the interval between marking an instance unhealthy and its actual termination is so small, attempting to set an instance’s health status back to healthy is probably useful only for a suspended group

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

Actions you need to take to perform Manual Scaling?

A

Manual scaling can be performed by:

  1. Changing the desired capacity limit of the Auto Scaling group
  2. Attaching/Detaching instances to the Auto Scaling group
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Pre-requisite to attach or detach the instance in ASG?

A
  1. Instance is in the running state.
  2. AMI used to launch the instance must still exist.
  3. Instance is not a member of another Auto Scaling group.
  4. Instance is in the same Availability Zone as the Auto Scaling group.
  5. If the Auto Scaling group is associated with a load balancer, the instance and the load balancer must both be in the same VPC.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is effect of attaching/detaching instance on desired capacity value?

A
  • Auto Scaling increases the desired capacity of the group by the number of instances being attached. But if the number of instances being attached plus the desired capacity exceeds the maximum size of the group, the request fails.
  • When Detaching instances, you have the option of decrementing the desired capacity for the Auto Scaling group by the number of instances being detached. If you choose not to decrement the capacity, Auto Scaling launches new instances to replace the ones that you detached
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

V.IMP*

Does Scheduled scaling support multiple Scheduled actions?

A

Multiple Scheduled Actions can be specified but should have unique time value and they cannot have overlapping time scheduled which will lead to its rejection.
Note: This is different to having multiple policies in Dynamic Scheduling

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

V.IMP*

What is role of Scheduled Actions in Scheduled Scaling?

A

Scheduled scaling requires configuration of Scheduled actions, which tells Auto Scaling to perform a scaling action at certain time in future, with the start time at which the scaling action should take effect, and the new minimum, maximum, and desired size the group should have

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

V.IMP*

2 important components of Dynamic Scaling

A

Auto Scaling group uses a combination of alarms & policies to determine when the conditions for scaling are met.

  1. An alarm is an object that watches over a single metric over a specified time period. When the value of the metric breaches the defined threshold, for the number of specified time periods the alarm performs one or more actions (such as sending messages to Auto Scaling).
  2. A policy is a set of instructions that tells Auto Scaling how to respond to alarm messages.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

V.IMP*

Dynamic scaling process works as below

A
  1. Amazon CloudWatch monitors the specified metrics for all the instances in the Auto Scaling group
  2. Changes are reflected in the metrics as the demand grows or shrinks
  3. When the change in the metrics breaches the threshold of the CloudWatch alarm, the CloudWatch alarm performs an action. Depending on the breach, the action is a message sent to either the scale-in policy or the scale-out policy
  4. After the Auto Scaling policy receives the message, Auto Scaling performs the scaling activity for the Auto Scaling group.
  5. This process continues until you delete either the scaling policies or the Auto Scaling group
17
Q

Can ASG have multiple policies attached?

A

Yes
Each Auto Scaling group would have at least two policies: one to scale the architecture out and another to scale the architecture in.

18
Q

V.IMP*
When there are multiple policies in force at the same time, there’s a chance that each policy could instruct the Auto Scaling group to scale out (or in) at the same time. How does ASG prioritises this?

A

When these situations occur, Amazon EC2 Auto Scaling chooses the policy that provides the largest
capacity for both scale out and scale in (even when
the policies use different criteria for scaling out. )

Eg.if one policy terminates three instances,
another policy decreases capacity by 25 percent, and the group currently has eight instances, Amazon
EC2 Auto Scaling gives precedence to the policy that provides the largest number of instances at that
time. This results in the Auto Scaling group terminating two instances (25% of 8 = 2)

19
Q

Is AS Cool Down possible during Manual Scaling?

A

When manually scaling the Auto Scaling group, the default is not to wait for the cooldown period, but you can override the default and honor the cooldown period.

20
Q

If an instance becomes unhealthy, will AS honour Cool Down time?

A

If an instance becomes unhealthy, Auto Scaling does not wait for the cooldown period to complete before replacing the unhealthy instance.

21
Q

What is Default Termination policy?

A

Default termination policy is designed to help ensure that the network architecture spans Availability Zones evenly

22
Q

V.IMP*

How does Default Termination policy select AZ for instance termination? (Criteria)

A
  • selects the AZ, in multiple AZs environment, with the most instances and at least one instance that is not protected from scale in.
  • selects the AZ with instances that use the oldest launch configuration, if there are more than one AZ with same number of instances
23
Q

V.IMP*

How does Default Termination policy select instance in AZ termination? (Criteria)

A
  • terminates the unprotected instance using the oldest launch configuration, if one exists.
  • terminates unprotected instances closest to the next billing hour, If multiple instances with oldest launch configuration. This helps in maximizing the use of the EC2 instances while minimizing the number of hours billed for EC2 usage.
  • terminates instances at random, if more than one unprotected instance closest to the next billing hour
24
Q

How does Customised Termination Policy selects AZ?

A
  1. Auto Scaling first assesses the AZs for any imbalance. If an AZ has more instances than the other AZs that are used by the group, then it applies the specified termination policy on the instances from the imbalanced AZ
  2. If the Availability Zones used by the group are balanced, then Auto Scaling applies the termination policy across all of the Availability Zones for the group.
25
Q

What does ‘OldestInstance’ termination policy mean?

A

Terminates the oldest instance in the group and can be useful to upgrade to new instance types

26
Q

What does ‘NewestInstance’ termination policy mean?

A

Terminates the newest instance in the group and can be useful when testing a new launch configuration

27
Q

What does ‘OldestLaunchConfiguration’ termination policy mean?

A

Terminates instances that have the oldest launch configuration

28
Q

What does ‘ClosestToNextInstanceHour’ termination policy mean?

A

Terminates instances that are closest to the next billing hour and helps to maximize the use of your instances and manage costs.

29
Q

What is Instance Protection?

A

Instance protection controls whether Auto Scaling can terminate a particular instance or not.

30
Q

What are different ways to enable Instance Protection?

A

Instance protection can be enabled on a Auto Scaling group or an individual instance as well, at any time

31
Q

What happens when scale-in activity occurs on ASG where all instances are protected from termination?

A

If all instances in an ASG are protected from termination during scale in and a scale-in event occurs, it can’t terminate any instance and will decrement the desired capacity.

32
Q

V.IMP*

Cases where Instance Protection will not work?

A
  1. Manual termination through the EC2 console, the terminate-instances command, or the TerminateInstances API.
  2. Termination if it fails health checks and must be replaced
  3. Spot instances in an Auto Scaling group from interruption
33
Q

You want to update troubleshoot an instance or patch it without removing it from the ASG. How can you do it?

A

Auto Scaling allows you to put the InService instance in the Standby state during which the instance is still a part of the ASG but does not serve any requests. This can be used to either troubleshoot an instance or update an instance and return the instance back to service

34
Q

V.IMP*
Sysadmin has put an instance into standby mode and is expecting ASG to replace it with an a new instance. But it did not happen. What could have gone wrong?

A

Auto Scaling, by default, decrements the desired capacity for the group and prevents it from launching a new instance. If no decrement is selected, it would launch a new instance.

35
Q

Auto Scaling groups that have been trying to launch instances for over 24 hours but have not succeeded in launching any instances. What will happen?

A

Auto Scaling also performs Administrative Suspension where it would suspend processes for ASGs

36
Q

What is Auto Scaling Suspension?

A

Auto Scaling processes can be suspended and then resumed. This can be very useful to investigate a configuration problem or debug an issue with the application, without triggering the Auto Scaling process

37
Q

List the Auto Scaling Processes

A
  1. Launch – Adds a new EC2 instance to the group, increasing its capacity.
  2. Terminate – Removes an EC2 instance from the group, decreasing its capacity.
  3. HealthCheck -Checks the health of the instances.
  4. ReplaceUnhealthy – Terminates instances that are marked as unhealthy and subsequently creates new instances to replace them.
  5. AlarmNotification – Accepts notifications from CloudWatch alarms that are associated with the group. If suspended, Auto Scaling does not automatically execute policies that would be triggered by an alarm
  6. ScheduledActions – Performs scheduled actions that you create.
  7. AddToLoadBalancer – Adds instances to the load balancer when they are launched.
  8. AZRebalance -Balances the number of EC2 instances in the group across the Availability Zones in the region.
38
Q

V.IMP*

By default, where does Auto scaling get instance Health check data?

A

The default health checks for an Auto Scaling group are EC2 status checks only

39
Q

How can you perform health check if you have ASG along with ELB?

A

By default health checks for an Auto Scaling group are EC2 status checks only. You can configure the Auto Scaling group to use Elastic Load Balancing health checks.
If you configure the Auto Scaling group to use Elastic Load Balancing health checks, it considers the
instance unhealthy if it fails either the EC2 status checks or the load balancer health checks. If you attach
multiple load balancers to an Auto Scaling group, all of them must report that the instance is healthy in If you configure the Auto Scaling group to use Elastic Load Balancing health checks, it considers the
instance unhealthy if it fails either the EC2 status checks or the load balancer health checks. If you attach
multiple load balancers to an Auto Scaling group, all of them must report that the instance is healthy in