Auto Scaling Groups and Launch Configurations

  1. What is auto scaling group?
    1. Auto scaling groups along with Launch Configurations enable you to create a logical group of EC2 instances that are always available.
    2. ASGs optionally work with ELBs but ELB is not needed for ASG to work.
  2. What is Launch Configuration?
    1. Used by auto scaling group to launch EC2 instances without user intervention.
    2. Is a recipe to create an EC2 instance. Steps involved are exactly same as creating an EC2 except at the end you will create the recipe as opposed to launching the actual instance.
  3. Create Launch Configuration
    1. Choose AMI
    2. Choose Instance Type
    3. Name the launch config
    4. Choose spot instances or not
    5. Choose if you need detailed monitoring on cloud watch
    6. Choose IAM roles if any
    7. Input the User data (bootstrapping code) if any
    8. Any ip address related parameters
    9. Add storage details
    10. Security Group details (default or your own)
    11. Input your key pair name
    12. Click save the launch configuration
  4. Create Auto Scaling Group. (This will launch the EC2 instances)
    1. Name of the auto scaling group
    2. Choose VPC
    3. Choose Group size (starting number of instances)
    4. Choose subnets (one or more. Its a multi select. Better to choose two or more AZs). The instances from above step will be distributed evenly among the chosen AZs
    5. Choose Launch Configuration
    6. Choose optional Load Balancer
    7. Choose which health check to use (ELB or EC2)
    8. Input health check grace period (300 sec default). This is the amount of time the ASG waits before it checks the health of a newly started instance. If you have major bootstrapping script, increase this parameter.
    9. Scaling Policies
      1. Scaling policies enable you to either keep the group size constant at th initial size or
      2. Scale between min and max instances (min and max are not equal to initial size)
      3. Increase Group Size Rule
        1. Execute policy when (Points to an Alarm. Alarm has following)
          1. Name of the alarm
          2. Whenever: Average/Min/Max of CPU/RAM >/</>=/<=   XXXX percent.
          3. At least: N number of consecutive periods of T sec/min
          4. Optional SNS notification
        2. Take the action:
          1. Add/Substract
          2. N instances
          3. Warm up time (300 sec)
      4. Similarly Create Decrease Group Size Rule
      5. Provide optional email to be sent when launching/termination/fail to launch/fail to terminate instances
    10. Finally click to “Create ASG”. This will immediately launch the EC2 instances as per the rules of the ASG
    11. Remember: Security Group is input for the launch configuration whereas VPC/subnets/AZs are parameters of the auto scaling group.
<<< Elastic Load Balancer (ELB)Elastic File System (EFS) >>>
Copyright 2005-2016 KnowledgeHills. Privacy Policy. Contact .