AWS

An overview of different EC2 instance launch types on AWS

AWS EC2 can be divided into different types based on launch methods. Different launch types can be used to launch the EC2 instance based on workload. Most AWS Architects use on-demand instances, the costliest launch type of EC2 instances. Depending upon the usage, by choosing the correct launch type, the cost on EC2 instances can be reduced up to 90%. Following are the EC2 instance launch types provided by AWS.

  • On-demand instances
  • Reserved instances
    • Standard reserved instances
    • Convertible reserved instances
  • Spot instances
  • Dedicated instances
  • Dedicated hosts

This article describes the difference between all these launch types and which launch type to choose for which scenario while launching an EC2 instance.

On-demand instances

On-demand is the most used launch type to launch the EC2 instances. While launching the EC2 instance using the on-demand launch type, you only need to request the EC2 instance, and it is immediately available for you. You can terminate the instance at any time without any extra charges.

Using on-demand instances, you are charged for the compute capacity you provisioned per second. You do not have any long-term commitment with AWS for the resources. You can control the lifecycle of the EC2 instance and can stop or terminate whenever you want without bearing extra charges.

On-demand instances are the standard instances and are the most costly instances. The pricing for these instances varies from region to region and depends on the compute capacity provisioned. Visit the following official documentation for pricing of on-demand instances in all regions.

https://aws.amazon.com/ec2/pricing/on-demand/

Use cases

AWS recommends using the on-demand instances for the following use cases.

  • Short term applications
  • Testing purposes
  • Irregular workloads
  • Un-interrupted workloads

Reserved instances

As compared to on-demand instances, reserved instances can be used to reserve the instance for a specific time period. The reservation time for the reserved instances is between 1 and 3 years. You make a commitment with AWS that you will use a specific compute capacity for 1 or 3 years, and AWS offers up to 72% discount as compared to on-demand instances.

While using reserved instances, you can change the instance family, OS type, and tenancy while using reserved instances. You can reserve an instance capacity and can launch as many instances as you want within the capacity.

Following are the types of reserved instances provided by AWS.

  • Standard reserved instances
  • Convertible reserved instances

Standard reserved instances

Standard reserved instances can be launched to get a significant discount as compared to on-demand instances. You can change the instance’s networking type, availability zone, and instance size with the standard reserved instances. Following are the characteristics of standard reserved instances.

  • Upto 40% discount on on-demand instances when reserved for 1 year
  • Upto 60% discount on on-demand instances when reserved for 3 years
  • Networking type, availability zone, and instance size can be changed

Convertible reserved instances

As compared to Standard reserved instances, convertible reserved instances give you less discount. Convertible reserved instances give more flexibility than the standard reserved instances. You can change instance family, networking type, availability zone, instance size, operating system, tenancy, and payment option. Following are the characteristics of convertible reserved instances

  • Upto 31% discount on on-demand instances when reserved for 1 year
  • Upto 54% discount on on-demand instances when reserved for 3 years
  • Networking type, availability zone, and instance size can be changed
  • Instance family, operating system, tenancy, and payment options can also be changed

Spot instances

Spot instances are the spare EC2 capacity available on AWS EC2, which can be used at a very low price as compared to on-demand instances. Pricing of the spot instances is not fixed and varies depending upon the spare EC2 capacity available on AWS. But you can get a discount of upto 92% on on-demand instances while using the spot instances.

The price for spot instances is managed by AWS in every availability zone and can change while you are running the spot instance. When the EC2 spare capacity ends, the spot instance is terminated by AWS automatically.

Following are the characteristics of the spot instances.

  • Spot instances can be launched only if the spot request is active and EC2 spare compute capacity is available
  • If the spare compute capacity is unavailable, the spot instance request makes the launch request until EC2 spare capacity becomes available.
  • The pricing of the spot instances varies depending upon the spare capacity available
  • If the spare capacity is no longer available, AWS can terminate your running instance

Use cases

Spot instances are very cost-effective as compared to on-demand instances, but AWS manages the lifecycle of this instance. Following are some use cases of the spot instances.

  • Data analysis
  • Batch jobs
  • Background processing
  • Optional tasks

Dedicated instances

When you launch an on-demand, reserved, or spot instance, AWS creates your VM on the hardware that is shared with other customers’ VMs. To launch your EC2 instance on the hardware that is dedicated to a single customer, AWS provides a Dedicated instance launch type.

AWS dedicated instances may share hardware with other EC2 instances that are not dedicated instances from the same account. Dedicated instances can only be launched in AWS VPC, and you need to specify the instance tenancy as Dedicated while launching the dedicated instance.

Limitations

Following is the list of limitations using dedicated instances.

  • AWS VPC with tenancy set to dedicated does not support some services or features.
  • EBS volume does not run on single-tenant hardware when a dedicated instance backed by EBS is launched.
  • All the instance types can not be launched in a VPC with tenancy set to dedicated.

Dedicated hosts

Amazon EC2 dedicated hosts allow you to run your VMs on the physical server that is fully dedicated to you. You can bring software licenses from different vendors like Microsoft, Amazon EC2, or Oracle, and you can get cost-effectiveness and flexibility to use your own license.

You can also use AWS license manager, a service that helps you manage your software licenses, with the Amazon EC2 Dedicated hosts. Following are some benefits of using Dedicated hosts.

  • Meet corporate compliance requirements
  • Save money on license cost

Conclusion

There are different launch types that can be used to launch EC2 instances. These different launch types can be used to launch instances for different purposes. You can save upto 92% on on-demand instances by using the proper launch method for your EC2 instance. Also, you can run your instance on hardware that is dedicated to you. This article describes all the launch types of the EC2 instances provided by AWS in detail.

About the author

Zain Abideen

A DevOps Engineer with expertise in provisioning and managing servers on AWS and Software delivery lifecycle (SDLC) automation. I'm from Gujranwala, Pakistan and currently working as a DevOps engineer.