amazon aws ec2 ebs

Ultimate Amazon EC2 (Elastic Compute Cloud) & EBS (Elastic Block Store) Guide

AWS Elastic Compute Cloud (EC2) is designed to replicate your datacenter/server rooms as closely as possible.

Traditional datacenters need racks, power supplies, cabling, switches, firewalls, and cooling. AWS Elastic Compute Cloud (EC2) is designed to replicate your datacenter/server rooms as closely as possible. In this article I will talk about everything you need to know about to fully leverage the EC2 ecosystem, including the following list of things:

  • Setting up Ec2 instances
  • Building a secure and effective network environment
  • Choosing the best EC2 pricing models for your needs
  • Help understanding how to manage the EC2 instance lifecycle
  • Choosing the right storage drive type for your needs

Amazon EC2 Instances

An amazon EC2 instance while only a virtualized subset of a physical server, it behaves just like the real thing. It’ll have access to storage, memory, and a network interface, and its primary drive will have a fresh operating system installed on it. The type of hardware resources you want, the operating system you need and the software stack to run it on and how much your willing to pay will all be deciding factors in how you configure your EC2 instances.

Types of Amazon EC2 Machine Images

An Amazon Machine Image (AMI) is a template that contains information telling EC2 what OS and application software to include on the root data volume. These are the four kinds of AMIs:

  • Amazon Quick Start AMIs – These are popular choices and will appear at the top of the list. They include various releases of Linux or Windows Server OSs. These AMIs are up-to-date and officially supported.
  • AWS Marketplace AMIs – These are official production ready images provided by industry vendors like SAP and Cisco.
  • Community AMIs – These are images created and maintained by independent vendors built for specific needs.
  • Private AMIs – These are images created from your own instance deployments as private AMIs. These will help you scale up the number of instances you have running to meet demand.

Amazon EC2 Instance Types

Determining the type of workload you are planning will aid in the instance type that you choose. You want to try and balance cost against your need for compute. If you ever need to adjust or change your instance, this can all be done by stopping the instance, editing its instance type, and starting it back up again. There are dozens of instance types organized into five different categories:

  • General Purpose AWS Instance Type – These Amazon EC2 instances provide a great balance of compute, memory, and network resources. This instance family is free tier eligible also.
  • Compute Optimized EC2 Instances – Great for more demanding web servers and high-end workloads
  • Memory Optimized Instance Types – These instances work well for intensive database, data analysis, and caching operations
  • Accelerated Computing EC2 Instances – Great for higher-performance general-purpose graphics processing unit (GPGPU). These are recommended for demanding workloads such as 3d visualizations and rendering, financial analysis, and computational fluid dynamics. If you don’t know what these are then you probably don’t need these types.
  • Storage Optimized Instance Types – These instances work well with distributed file systems

The specific details of each of these types will change over time as AWS continues to grow and support its customers. You can review a more in depth list of the groups here.

Configuring an a Virtual Private Cloud for your Instances

Choosing where your EC2 instances will live is very important. Lets discuss three primary details to get right such as geographic region, virtual private cloud (VPC), and tenancy model.

AWS Regions

AWS servers are housed in data centers around the world and organized by geographical regions. It is best to launch instances in regions that are physically closest to the majority of your customers. Cost and functionality of services and features might vary by locations. EC2 instances can only be managed in the region its sitting in. All of the current regions can be viewed here.

Virtual Private Clouds (VPC)

Virtual Private Clouds are great ways to organize your AWS networks. Isolating your instances from one vpc to the other helps organize projects and networks better. Adding a VPC that does not have a nat gateway will not cost you anything.

Tenancy

when building an EC2 instance you have the option of choosing a tenancy model depending on your level of security you need. When choosing the default shared tenancy, your instance will run as a virtual machine on a physical server that’s hosting other instances. Special regulatory requirements might need an extra layer of isolation on its own dedicated physical server.

Resource Tags

The more you start to deploy resources into your environment it can get hard to keep track of things. The best way to keep an eye on everything is by coming up with a convienent naming convention and applying it to tags. AWS resource tags can be used to label everything you come across in your AWS account. Tags are applied in the form of a key value pair. EC2 instances could for example be a part of the “Production-Server” Key and the value could be “server1” value. Applied properly, tags can improve visibility of your resources making it easier to control cost, and avoid costly errors.

VPC Service Limits

By default, each AWS account has limits to the number of instances of a particular service you are able to launch. These limits apply to a single region within an account. If necessary you can request AWS to raise the amount for these. For a VPC your allowed only 5 per region and 5000 key pairs across your account. These restrictions are imposed to prevent any one account from using all of the resources across AWS

Amazon Aws EC2 Storage Volumes

Storage drives are for the most part just virtualized spaces carved out of larger physical drives. The OS that is running will see these drives as if they were normal physical drives. There is more than one kind of AWS volumes, and its important to understand how each type works according to your project or workload you are working on.

AWS Elastic Block Store Volumes

You can attach as many Elastic Block Store (EBS) volumes to your instance as you would like. As with physical drives, the type of EBS volume you choose will have an impact on both performance and cost.

The AWS SLA guarantees the reliability of the data you store on and EBS for at least 99.999 percent availability so you don’t have to worry about failure. There are currently four EBS volume types, two using solid-state drive (SSD) and the other two using the older spinning hard drives (HDDs)

EBS-Provisioned IOPS SSD

If you applications require intense rates of I/O, then you should considered using provisioned IOPS. These volume types provide a maxiumum IOPS/volume of 32,000 and a maximum throughput/volum of 500 MB/s.

EBS General-Purpose SSD

For most regular server workloads that deliver low-latency performance, general-purpose SSDs will work well. General-Purpose SSDs will work well. You get a maximum of 10,000 IOPS/volume. These low cost drives provide great low cost which can be reviewed in more detail on the AWS site.

Throughput-Optimized HDD

These volumes can provide reduced cost with acceptable performance when looking for throughput-intensive workloads including log processing and big data operations. These volumes can deliver 500 IOPS/volume but with a 500 MB/s maximum throughput/volume and will only cost only $0.045/GB/month.

Cold HDD

When working with larger volumes of data that require only infrequent access, at 250 IOPS/volume, this type might meet your needs for only $0.025/GB/Month

EBS Volume Features

EBS volumes can be copied by creating a snapshot. Existing snapshots can be used to generate other volumes that can be shared or attached to other instances or converted to images from which AMIs can be made. EBS volumes can be encrypted to protect dat awhile at rest or as its sent back and forth to the EC2 host. EBS can manage the encryption keys automatically behind the scenes or use keys that you provided through the AWS Key Management Service (KMS).

Instance Store Volumes

Unlike EBS volumes, instance store volumes are ephemeral, meaning when the instances they are attached to are shutdown the data is permanently lost. The question is why would you want to store data on these volumes?

  • Instance store volumes are SSDs that are physically attached to the server hosting your instance are are connected via a fast NVMe interface
  • The use of the instance store volumes are included in the price of the instance itself
  • These volumes work especially well for deployment models where instances are launched to fill short-term roles such as autoscaling groups

Even with all of the benefits of EBS and instance storage, its worth noting that there will be cases where you’re much better off keeping large data sets outside of EC2 altogether. This guide although it covers the basic needed information on what Elastic Compute Cloud (EC2) and Elastic Block Store (EBS) can bring, its worth taking into consideration how each pairs when working with your environment or personal project.

Comments are closed.