Auto Scaling Groups in AWS help scale compute capacity based on pre-set scaling criteria. Creating Auto Scaling Groups using Insisive Cloud is a two step process. Firstly, you have to create a Launch Template within Insisive Cloud. Once you create a Launch Template, you can easily create as many Auto Scaling Groups ( ASGs) as needed with a few clicks.


The first step in creating Auto scaling Group is to create or use an existing Launch Template. 


Launch Templates

alt text



Navigate to Launch Templates using 'Auto Scaling Group' -> 'Launch Templates'.Initially it will be empty.


Selecting Region(s)

The region defaults to 'US East(N. Virginia)'. This can be changed using the Filter icon next to the region name. You can choose a specific region or hit 'Clear' to clear region. Once cleared, it will display launch templates for all regions. Initially, there will be no Launch Templates. Create a Launch Template using 'Create Config Template' button. There is a refresh button to fetch the list of latest Launch Templates. You can also toggle the view between Grid View and List View.

Intended Use

You can use Launch Templates to create pre set configurations e.g. Dev , Test, API server etc. You can then create an Auto Scaling group using the templates quickly with a few clicks.


Create Launch Template





alt text

  1. Enter a name for the Launch Template
  2. Select AWS Region using the drop down. Once the region is selected, wait for corresponding details to be loaded
  3. Select Key Name from the drop down. This is used for the users to ssh into the instance.
  4. Select Instance Type(s) from the drop down. Selecting multiple instance types increases odds of higher spot instance availability.
  5. Select Availability Zones corresponding to the region selected
  6. Select VPC from the drop down. The drop down will display the VPCs for that particular region. Based on the VPC selected, Security groups/ subnets/Alarm Topics/AMIs will be populated.  
  7. Select Security Groups that should be applicable for the ASG
  8. Select Sub net corresponding to the region and Availability zone.
  9. Select Image Id from drop down. The drop down will only list private AMIs. For public AMIs, directly input the AMI ID in the edit box as input.
  10. Please Note that the VPC and AZ need to be selected before selecting subnet. Else, the subnet drop down will not be populated 
  11. Select Notification Type for ASG scaling actions. This is an optional action. If you select a notification type, then you need to select the Alarm Topic mandatorily. 
  12. 11.Select IAM Role to be used while launching EC2 Instance. This is an optional action. Selecting IAM Role is considered a best practice from security perspective 
  13. Select the volume attributes based on the ImageID selected.
    1. Especially note the size of root volume and Device ID . These are based on AMI size and if AMI is HVM / PV. The Device ID for some AMIs is /dev/xvda and some AMIs it is /dev/sd1. Choose the appropriate device ID name based on the AMI .
    2. It is considered a best practice to keep the root volume of small size and add additional EBS volumes with larger size. This will also help in creating AMIs quickly in the event of spot termination 
  14. Add Additional EBS volumes as per requirement 
  15. Enter UserData or drag and drop the file containing the commands if applicable 
  16. Add Tags applicable for the ASG. These tags will be applied to all the instances launched in the ASG automatically.
    1. The tags will be applied to all the ASGs that use the template 
  17. Save the template.
  18. If the template is created for the same region that is selected in the Launch Template Overview page, it will appear on the page. Else, you can change the region ( or clear the region ) to view the Launch Templates from all regions.


Create Auto Scaling Group using Launch Template

In the Grid View mode, you can launch an Auto Scaling group directly using the Launch Template using the 'Create Auto Scaling Group' menu option of the menu group - '...' for the launch template


Create Auto Scaling Group. 

Navigate to Auto Scaling Group - > Overview 

alt text



Create a new Auto Scaling Group 'Create Auto Scaling Cluster' option at the top right hand. 


alt text



A new Cluster can be created using 'Create Auto Scaling Group' button. You can select the region for the Auto Scaling Group. The 'Application Context' plays an important part in choosing the price and availability characteristics of the Auto Scaling Group

Application Context

Application Context provides indication about the criticality of the cluster and whether it should be optimized for availability for Cost / Availability. Currently it supports the following options

  1. Minimum Price : Choose this option for non critical or short duration clusters. This indicates that the cluster can be prioritized for using the lowest price among the selected instance type(s) and there is no minimum number of instances provisioned using On-Demand Instances. The instance life cycle management applies to this so as to monitor and replace instances if there are any interruptions. e.g. Dev or Test clusters that do not have critical data written at a frequency of greater than once every few seconds. ASG for Staging to verify or reproduce issues with production settings for a short duration and spin it down once the work is completed.

  2. Optimum Price - Uptime : Choose this option for applications that need optimal mix of cost and up time. This is the default option. This provisions a minimum number of instances in OnDemand at all times and the rest as spot/on-demand based on availability. The algorithm prefers higher available instance type(s) over price until a certain percentage. The instance life cycle management applies to this so as it monitor and replace instances if there are any interruptions. e.g. Long running Dev/Test/Staging Clusters for all types of workloads. Choosing this for Production clusters is suitable for stateless workloads. It is not suitable for production clusters if the stateless requests typically take 120 seconds or more.

  3. Maximum Availability : Choose this option if you want to prioritize availability and reduce frequency of interruptions even if cost savings are less than optimal. This provisions a higher number of on-demand instances( ** but not all instances are OnDemand Instances**) and prefers instance types with higher availability even if they are more expensive. This is suitable for all production workloads that are stateless / content driven. Not suitable for workloads which have high frequency disk persisted storage or workloads that take stateless actions that go beyond 120 seconds.

Scaling Policies

The scaling policies help scale the ASG in response to increased load. The default values are populated as per best practice. These can be customized as per application specific requirements. Advanced scaling policies can be added as JSON in the Cloudformation compliant Scaling Policies. This is optional. Please note that the application hosted should support automatic scaling to use it correctly. If the application does not support auto scaling, do not select this option. 

Secondary Details

The Secondary details page captures additional details on which launch template and other information

Load Balancer Type

Choose the application Load Balancer or Target Group that is routing the requests to this ASG(s).

Note : Choosing Optimum Price - Availability or Maximum Availability will create two or more ASGs. For this, you would need a load balancer or a Target group to serve the requests to multiple ASGs.


Take Snapshot

 This will take a snapshot of the existing instance before terminating it and use the snapshot for the newly launched spot instance. Choose this option if you want the persisted data on the instance to be preserved. In-memory data or data in system cache not yet persisted to disk will not be available


Private IP Address Backup

  This will preserve the private IP address of the machine and use it for the newly launched spot instance. 

Health Check Interval

Default time for health check of an instance within an Auto Scaling Group.

Collect Metrics

This will enable collecting CloudWatch metrics at 1-minute intervals instead of the default 5 minute interval. Note: There will be an additional charge from AWS for enhanced CloudWatch metrics collection. So enable it only if you need to gather metrics at 1-minute intervals

Instance Protection

This will disable termination of instances programatically. This will prevent scale-in for autoscaling groups.

Tags

Add any optional tags for better tracking. A few tags are added by default. This includes the Application name, Organisation ID, User Name. This will help to categorize costs per user / Org ID/ Application Name for better cost visibility ( once we enable the tags in Cost Allocation Tags).

Preview

Hitting 'Show Preview' navigates to Preview page that shows the preview of information that will be used to provision the autoscaling group with the main elements. Hit 'Create Now' to create the Auto Scaling Group. Based on the application context and instance types selected, please wait for the clusters to be created and all the instances to be provisioned.

Note : Based on the options selected, you may notice that there are more than one Auto Scaling Groups created in AWS Console - all starting with the same application as given for the given ASG. This is by design. Having more than one ASG is necessary and a best practice when multiple instance types are provided or when a minimum compute capacity is to be available as part of compute pool for the ASG. All the ASGs with the same application name will work in consort and managed by Insisive Cloud seamlessly.