AMI and Instance Concepts
This section describes AMIs and instances, the basic building blocks of Amazon EC2. Before accomplishing anything with Amazon EC2, you must understand the concepts in this section.
AMIs
An Amazon Machine Image (AMI) is an encrypted machine image that contains all information necessary to boot instances of your software. For example, an AMI might contain Linux, Apache, and your web site or it might contain Linux, Hadoop, and a custom application.
AMIs are stored in Amazon S3.
Public AMIs are made available by Amazon and the Amazon EC2 community and can be downloaded from the Resource Center. You can use public AMIs as a base to create your own custom private AMIs.
Private AMIs are AMIs that you own and can only be accessed by you or those to whom you grant access.
Paid AMIs are AMIs that you purchase from developers or AMIs that come with service contracts from organization such as Red Hat.
Shared AMIs are AMIs that developers build and make available for other AWS developers to use. Building safe, secure, useable AMIs for public consumption is a fairly straightforward process, if you follow a few simple guidelines. For information on how to use shared AMIs and how to share AMIs, see Using Shared AMIs and How to Share AMIs.
Bundling an AMI
To use a file system image with Amazon EC2, you must bundle it as an AMI. The bundling process does the following:
-
Compresses the image to minimize bandwidth usage and storage requirements
-
Encrypts and signs the compressed image to ensure confidentiality and authenticates the image against its creator
-
Splits the encrypted image into manageable parts for upload
-
Creates a manifest file that contains a list of the image parts with their checksums
Instances
After an AMI is launched, the resulting running system is called an instance. By default, you can run up to 20 instances. If you need more than 20 instances, please complete the Amazon EC2 Instance Request Form and your request will be considered.
Instances remain running unless they fail or are terminated. When this happens, the data on the instance is no longer available.
Instance Usage
The instance is your basic computation building block. Amazon EC2 offers multiple instance types from which you can choose. You can run as many or as few instances as you need at any given time.
For information about available instance types, see Instance Types.
Once launched, an instance looks very much like a traditional host. You have complete control of your instances; you have root access to each one and you can interact with them as you would any machine.
Here are some suggestions for making the best use of Amazon EC2 instances:
-
Do not rely on an instance's local storage for valuable, long-term data.
When instances fail, the data on the local disk is lost. Use a replication strategy across multiple instances to keep your data safe or store your persistent data in Amazon S3
-
Define images based on the type of work they perform.
For "Internet applications," you might define one image for database instances and another for web servers. Image creation and storage are cheap and easy operations, so you can individualize and customize as necessary. Specialized images can result in smaller AMI sizes, which boot considerably faster.
-
Monitor the health of your instances.
You can make your instances work for you by configuring them to monitor each other. For example, you could create an image that contains a monitoring tool (e.g., the open-source Nagios or OpenNMS on Linux and UNIX). Then, your other instances could report their health to the monitoring instance.
-
Keep your Amazon EC2 firewall permissions as restrictive as possible.
Only open up permissions that you require. Use separate groups to deal with instances that have different security requirements. Consider using additional security measures inside your instance (such as using your own firewall). If you need to log in interactively (ssh), consider creating a bastion security group that allows external login and keep the remainder of your instances in a group that does not allow external login.
Instance Types
Amazon EC2 instances are grouped into two families: standard and High-CPU. Standard instances have memory to CPU ratios suitable for most general purpose applications; High-CPU instances have proportionally more CPU resources than memory (RAM) and are well suited for compute-intensive applications. When selecting instance types, you might want to use less powerful instance types for your web server instances and more powerful instance types for your database instances. Additionally, you might want to run CPU instance types for CPU-intensive data processing tasks.
One of the advantages of EC2 is that you pay by the instance hour, which makes it convenient and inexpensive to test the performance of your application on different instance families and types. One good way to determine the most appropriate instance family and instance type is to launch test instances and benchmark your application.
Available Instance Types
The instance types described in the following table are available.
Type | CPU | Memory | Storage | Platform | I/O | Name |
---|---|---|---|---|---|---|
Small |
1 EC2 Compute Unit (1 virtual core with 1 EC2 Compute Unit) |
1.7 GB |
160 GB instance storage (150 GB plus 10 GB root partition) |
32-bit |
Moderate |
m1.small |
Large |
4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each) |
7.5 GB |
850 GB instance storage (2 x 420 GB plus 10 GB root partition) |
64-bit |
High |
m1.large |
Extra Large |
8 EC2 Compute Units (4 virtual cores with 2 EC2 Compute Units each) |
15 GB |
1690 GB instance storage (4 x 420 GB plus 10 GB root partition) |
64-bit |
High |
m1.xlarge |
High-CPU Medium |
5 EC2 Compute Units (2 virtual cores with 2.5 EC2 Compute Units each) |
1.7 GB |
350 GB instance storage (340 GB plus 10 GB root partition) |
32-bit |
Moderate |
c1.medium |
High-CPU Extra Large |
20 EC2 Compute Units (8 virtual cores with 2.5 EC2 Compute Units each) |
7 GB |
1,690 GB instance storage (4 x 420 GB plus 10 GB root partition) |
64-bit |
High |
c1.xlarge |
Note | |
---|---|
The small instance type is the original Amazon EC2 instance type
available since the launch of Amazon EC2. It is the default instance type for all customers.
To use other instance types, you must specify them through the |
Important | |
---|---|
We strongly recommend using the 2.6.18 Xen stock kernel with the c1.medium and c1.xlarge instances. Although the default Amazon EC2 kernels work, the new kernels provide greater stability and performance for these instance types. For more information about kernels, see Kernels, RAM Disks, and Block Device Mappings FAQ. |
Instance Storage
Every instance includes a fixed amount of storage space on which you can store data. Within this document, it is referred to as the "instance store" as it is not designed to be a permanent storage solution.
If an instance reboots (intentionally or unintentionally), the data on the instance store will survive. If the underlying drive fails or the instance is terminated, the data will be lost.
We highly recommend backing up important data to Amazon S3.
Storage Locations
Storage is exposed on the instance types as described in the following table.
Location | Description |
---|---|
/dev/sda1 | Formatted and mounted as root (/) on all Linux and UNIX instance types. Formatted and mounted as C:\ on all Windows instance types. |
/dev/sda2 or xvdb (Windows) | Formatted and mounted as /mnt on m1.small and c1.medium instances. Formatted and mounted on small Windows instance types. |
/dev/sda3 | Formatted and mounted as /swap on m1.small and c1.medium instances on all Linux and UNIX instance types. Not available on Windows instances. |
/dev/sdb or xvdb (Windows) | Formatted and mounted as /mnt on m1.large, m1.xlarge, and c1.xlarge Linux and UNIX instances. Formatted and mounted on m1.large, m1.xlarge, and c1.xlarge Windows instances. |
/dev/sdc or xvdc (Windows) | Available on m1.large, m1.xlarge, and c1.xlarge Linux and UNIX instances. Formatted and mounted on m1.large, m1.xlarge, and c1.xlarge Windows instances. |
/dev/sdd or xvdd (Windows) | Available on m1.xlarge and c1.xlarge Linux and UNIX instances. Formatted and mounted on m1.xlarge and c1.xlarge Windows instances. |
/dev/sde or xvde (Windows) | Available on m1.xlarge and c1.xlarge Linux and UNIX instances. Formatted and mounted on m1.xlarge and c1.xlarge Windows instances. |
On-Demand and Reserved Instances
This section describes the differences between standard On-Demand and Reserved Instances.
On-Demand Instance Concepts
On-Demand Instances let you pay for compute capacity by the hour with no long-term commitments. This frees you from the costs and complexities of planning, purchasing, and maintaining hardware and transforms what are commonly large fixed costs into much smaller variable costs.
Note | |
---|---|
For information about pricing, refer to the Amazon EC2 Product Page. |
Reserved Instance Concepts
With Amazon EC2 Reserved Instances, you can make a low one-time payment for each instance to reserve and receive a significant discount on the hourly usage charge for that instance.
Amazon EC2 Reserved Instances are based on instance type and location (region and Availability Zone) for a specified period of time (e.g., 1 year or 3 years) and are only available for Linux/UNIX instances.
Reserved Instance Process
1 |
Choose a region where you want to run the instance. |
2 |
Search for offerings. To limit the results returned, you can specify the instance type or Availability Zone. |
3 |
Purchase offerings that meet your requiremnts. |
4 |
Run instances of the purchased instance type in the correct region and Availability Zone. |
Note | |
---|---|
For information about pricing, refer to the Amazon EC2 Product Page. For information on using Reserved Instances, see Reserving Amazon EC2 Instances. |
How Reserved Instances are Applied
Reserved Instances are applied to instances that meet the type/location criteria during the specified period. In this example, a user is running the following instances:
-
(4) m1.small instances in Availability Zone us-east-1a
-
(4) c1.medium instances in Availability Zone us-east-1b
-
(2) c1.xlarge instances in Availability Zone us-east-1b
The user then purchases the following Reserved Instances.
-
(2) m1.small instances in Availability Zone us-east-1a
-
(2) c1.medium instances in Availability Zone us-east-1a
-
(2) m1.xlarge instances in Availability Zone us-east-1a
Amazon EC2 applies the two m1.small Reserved Instances to two of the instances in Availability Zone us-east-1a. Amazon EC2 doesn't apply the two c1.medium Reserved Instances because the c1.medium instances are in a different Availability Zone and does not apply the m1.xlarge Reserved Instances because there are no running m1.xlarge instances.
Windows Instance Types
This section describes major concepts that you should understand when using Windows instances.
Differences Between Windows and Linux/UNIX Instances
Using Amazon EC2 instances running Windows is similar to using instances running Linux and UNIX. The following are the major differences between instances that use Linux/UNIX and Windows:
-
Remote Desktop—To access Windows instances, you use Remote Desktop instead of SSH.
-
Administrative Password—To access Windows instances the first time, you must obtain the administrative password using the ec2-get-password command.
-
Simplified Bundling—To bundle a Windows instance, you use a single command that shuts down the instance, saves it as an AMI, and restarts it.
Amazon EC2 Running Windows
As part of this service, Amazon EC2 instances can now run Microsoft Windows Server 2003. Our base Windows image provides you with most of the common functionality associated with Windows. However, if you require more than two concurrent Windows users or need to leverage applications that require LDAP, Kerberos, RADIUS, or other credential services, you must use Windows with Authentication Services. For example, Microsoft Exchange Server and Microsoft SharePoint Server require Windows with Authentication Services.
Note | |
---|---|
To get started using Windows instances, we recommend using the AWS Management Console. There are differences in pricing between Windows and Windows with Authentication Services instances. For information on pricing, go to the Amazon EC2 Product Page. |
Windows AMI
Amazon EC2 currently provides the following Windows AMIs:
-
Windows Authenticated (32-bit)
-
Windows Authenticated (64-bit)
-
Windows Anonymous (32-bit)
-
Windows Anonymous (64-bit)
The Windows public AMIs that Amazon provides are unmodified versions of Windows with the following two exceptions: we added drivers to improve the networking and disk I/O performance and we created the Amazon EC2 configuration service. The Amazon EC2 configuration service performs the following functions:
-
Randomly sets the Administrator password on initial launch, encrypts the password with the user’s SSH key, and reports it to the console. This operation happens upon initial AMI launch. If you change the password, AMIs that are created from this instance use the new password.
-
Configures the computer name to the internal DNS name. To determine the internal DNS name, see Using Instance Addressing.
-
Sends the last three system and application errors from the event log to the console. This helps developers to identify problems that caused an instance to crash or network connectivity to be lost.
Measuring Compute Resources
Transitioning to a utility computing model changes how developers are trained to think about CPU resources. Instead of purchasing or leasing a particular processor to use for several months or years, you are renting capacity by the hour. Because Amazon EC2 is built on commodity hardware, over time there might be several different types of physical processors underlying different virtual EC2 instances. Our goal is to provide a consistent amount of CPU capacity regardless of the actual underlying hardware.
Amazon EC2 uses a variety of measures to provide each instance with a consistent and predictable amount of CPU capacity. To make it easy for developers to compare CPU capacity between different instance types, we defined an Amazon EC2 Compute Unit.
Note | |
---|---|
We use several internal benchmarks and tests to manage the consistency and predictability of the performance of an Amazon EC2 Compute Unit. For more information, go to the Instance page. |
To find out which instance works best for your application, we recommend launching an instance and using your own benchmark application. This helps you determine which instance type works best for your specific use case.
I/O Resources
Amazon EC2 provides virtualized server instances. While some resources like CPU, memory and instance storage are dedicated to a particular instance, other resources like the network and the disk subsystem are shared amongst instances. If each instance on a physical host tries to use as much of one of these shared resources as possible, each receives an equal share of that resource. However, when a resource is under-utilized you are often able to consume a higher share of that resource while it is available.
The different instance types provide higher or lower minimum performance from the shared resources depending on their size. Each of the instance types has an I/O performance indicator (moderate or high). Instance types with high I/O performance have a larger allocation of shared resources. Allocating larger share of shared resources also reduces the variance of I/O performance. For most applications, moderate I/O performance is more than enough. However, for applications that require greater or more consistent I/O performance, consider instances with high I/O performance.