Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon EC2 ebs vs gp2 ami

Tags:

It's probably a silly question, but I can't understand the difference between these 2 amazon linux 2 amis:

  • ami-7105540e amzn2-ami-hvm-2.0.20180622.1-x86_64-ebs
  • ami-b70554c8 amzn2-ami-hvm-2.0.20180622.1-x86_64-gp2

Judging by this article, isn't gp2 just another ebs instance type?

like image 552
Vic Avatar asked Jul 08 '18 12:07

Vic


People also ask

What is the difference between AMI and EC2?

The EC2 is used for creating the virtual server instance. The AMI is the EC2 virtual machines image. ECS provides container services such as docker and the AWS lambda is used to run the code without a server.

What is EBS gp2?

gp2. gp2 is the default EBS volume type for Amazon EC2 instances. These volumes are backed by solid-state drives (SSDs) and are suitable for a broad range of transactional workloads, including dev/test environments, low-latency interactive applications, and boot volumes.

Does AWS AMI include EBS?

An AMI includes the following: One or more Amazon Elastic Block Store (Amazon EBS) snapshots, or, for instance-store-backed AMIs, a template for the root volume of the instance (for example, an operating system, an application server, and applications).

What is EBS backed AMI?

Amazon EBS-backed AMI – The root device for an instance launched from the AMI is an Amazon Elastic Block Store (Amazon EBS) volume created from an Amazon EBS snapshot.


2 Answers

The took the AMI in two types of Volumes.

amzn2-ami-hvm-2.0.20180622.1-x86_64-ebs - ami-7105540e. This has Magnetic Volume type for its root volume.

ami-b70554c8 amzn2-ami-hvm-2.0.20180622.1-x86_64-gp2. This has SSD Volume type for its root volume.

How can we identify this?

  • Go to EC2.
  • Launch Instance
  • Select the mentioned AMI
  • Select any instance Type.
  • Choose the VPC, subnet and etc.
  • Next it'll show the Boot Disk size, there you can see its in SSD or Magnetic.

To learn about Volume tyes: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html

like image 82
TheDataGuy Avatar answered Sep 21 '22 05:09

TheDataGuy


The question isn't silly at all. In fact AWS's lack of documentation explaining the actual difference between the two is a bit surprising

TLDR;

If you're planning on switching to a faster SSD root volume at some point in the future but want to use Magnetic for now it would be better to use the gp2 version of the AMI and then change the root volume to SSD sometime later

Some more Explanation

  • ami-b70554c8 amzn2-ami-hvm-2.0.20180622.1-x86_64-gp2 - The recommended root volume type is General Purpose SSD (gp2)
  • ami-7105540e amzn2-ami-hvm-2.0.20180622.1-x86_64-ebs - The recommended root volume type is Magnetic

However this isn't set in stone so you can still interchange between them (I've used the gp2 version with a Magnetic storage in the past without any issues)

I couldn't find any official documentation as to the actual difference between the two AMI versions but the gp2 version most likely has SSD related optimizations added already to the OS

So if you envision switching to SSD at some point in future but want to start with a Magnetic volume it might be better to just use the gp2 optimized AMI right from the start. It probably has some optimizations not relevant to Magnetic volumes but it might be more future proof in case you want to have a faster root volume later

like image 28
FearlessHyena Avatar answered Sep 21 '22 05:09

FearlessHyena