Anda di halaman 1dari 21

 

 
 
 
 
 

Amazon Elastic Compute Cloud 
Booting from Amazon EBS Feature Guide 
 
 
 
 
 

 
Table of Contents 
Overview ....................................................................................................................................................... 1 
Tutorial #1: Running an Instance Backed by Amazon EBS ............................................................................ 2 
Core Concepts ........................................................................................................................................... 2 
Step 1: Login to the AWS Management Console ...................................................................................... 2 
Step 2: Choosing an AMI ........................................................................................................................... 3 
Step 3: Setting up a keypair ...................................................................................................................... 4 
Step 4: Setting up a Security Group .......................................................................................................... 5 
Step 5: Configuring an Instance ................................................................................................................ 6 
Step 6: Connecting to the Instance ........................................................................................................... 7 
Important Differences between Instances Backed by Amazon EBS and Local Instance Storage ............. 8 
Cleaning Up: Terminating your Instance................................................................................................... 9 
Tutorial #2: Stopping and Starting an Instance Backed by Amazon EBS .................................................... 10 
Core Concepts ......................................................................................................................................... 10 
Step 1: Setting Up Your Instance ............................................................................................................ 10 
Step 2: Stopping an Instance................................................................................................................... 11 
Step 3: (Re‐)Starting an Instance ............................................................................................................ 12 
Cleaning Up: Terminating your Instance................................................................................................. 12 
Tutorial #3: Bundling an Instance Backed by Amazon EBS ......................................................................... 13 
Core Concepts ......................................................................................................................................... 13 
Step 1: Make any Modifications ............................................................................................................. 14 
Step 2: Create the Image ........................................................................................................................ 14 
Step 3: Start a Clone ................................................................................................................................ 15 
Cleaning Up: Terminating your Instance / Deleting the New AMI ......................................................... 16 
Advanced Options for Instance Startup and AMI Creation ........................................................................ 17 
Frequently Asked Questions (FAQs) ........................................................................................................... 18 
What’s New ................................................................................................................................................. 19 
Overview 
 Amazon EC2 is further enhancing the integration between its Elastic Block Store (EBS) and EC2 
instance functionality.  Amazon EC2 instances can now be booted directly from Amazon EBS 
volumes, and customers now have much richer control over how block devices are exposed to 
their instances.  This allows larger root devices, faster launch times, greater instance durability, 
and the ability to repair a mis‐configured instance. This also enables a number of very desirable 
features that customers have been asking for, such as the ability to stop an instance without 
terminating it, and the ability to create an AMI that is based directly on an existing instance.  
 
With this feature release: 
• Instances can now be launched with an Amazon EBS volume root device of up to 1 TB.  
• Instances have several new states, most notably a stopped instance state. An instance 
can now be stopped on demand, which shuts the instance down and releases its 
associated compute hardware, but retains and preserves all of the its EBS volumes. A 
stopped instance can be started again at a later time using the StartInstances request, 
which will boot the instance on new compute hardware and bring it back to a running 
state. 
• The new CreateImage operation will create a new AMI and register it in one step that is 
based directly on an existing instance.  
• Customers now have full control over how block devices are exposed to their instances.  
• Amazon Machine Images (AMIs) can now reference one or more Amazon EBS snapshots. 
On instance launch, an Amazon EBS volume per snapshot will be created for each 
instance on your behalf, which will then be attached to the instance before it begins to 
boot. 
• Instances have new attributes that can be used to control various aspects of their 
behavior, such as preventing API based termination via the disableApiTermination flag. 
• Amazon Machine Images (AMIs) can be more richly described. AMIs now have an 
optional description that can be changed over time and allow for more human readable 
names. 
 
The goal of this guide is to provide several short tutorials that help you become acquainted with 
some of the key new features. More detail about each of these sub‐features and others related 
to booting from Amazon EBS can be found in the Amazon EC2 documentation at 
http://aws.amazon.com/documentation/. 

 
Tutorial #1: Running an Instance Backed by Amazon EBS 
Core Concepts 
Amazon Machine Images (AMIs) can now either be stored in Amazon S3 or as an Amazon EBS 
snapshot.  To the user, the first major difference appears when an Amazon EC2 instance is 
created from that AMI.  Specifically, the root device of an Amazon EC2 instance will be stored 
locally on an instance if booted from an AMI backed by Amazon S3 and will be stored on an 
Amazon EBS volume if booted from an AMI backed by Amazon EBS.   
 
When root partition data is stored locally on the instance, the data will only persist as long as 
the instance is running and the root device is up to a maximum of 10 GB of storage.  However, 
when using Amazon EBS volumes, the data can persist beyond the life of a running instance and 
a root device can contain up to 1 TB of storage. 
 
The goal of this tutorial is to provide a step by step walkthrough of launching an instance 
backed by Amazon EBS.  
 
Before you begin the tutorial, it is important to note that when using instances 
backed by Amazon EBS you will be charged for both the Amazon EC2 instance hours 
Note  and the Amazon EBS resources consumed (e.g.‐ the Amazon EBS volume that serves 
as the root device). 
 

Step 1: Login to the AWS Management Console 
To start an Amazon EC2 instance, you need to login to the AWS Management Console, which 
can be found at http://aws.amazon.com/console. Simply click the “Sign in to the AWS Console”. 

 
 

 
When prompted, enter your login information for your AWS account.  If you do not have an 
AWS account, you can create one using the simple wizard by selecting the “I am a new user” 
radio button. 

 
 

Step 2: Choosing an AMI 
Once you have logged into the Console, you now can select the Amazon Machine Image (AMI) 
that you would like to run. To get a list of the current AMIs, you can navigate to the “AMIs” tab 
in the AWS Management Console as shown below. 

 

 
  
Once you are on the AMIs tab, you can filter the AMIs you see so that you only look at those 
that are AMIs backed by EBS by selecting the “EBS Images” option as shown below.   

 
 
Once “EBS Images” have been selected, scroll down the list to right click on the “getting‐
started‐with‐ebs‐boot” image and select “Launch Instance”.  Then, you will enter you into the 
launch wizard for that AMI. 
 

 
Step 3: Setting up a keypair 
If you have already used the AWS Management Console (and your cookies are still configured), 
you will automatically skip this step.  If you are new to the AWS Management Console, you will 
be prompted to create a private key pair used to access your instance, which will enable you to 
securely log onto your instance after it is launched.  To create this keypair, simply label the key 

 
pair (we called it “gsg” below), click on “Create & Download your Key Pair”, and then 
“Continue” to move on after you have downloaded the file. 

 
 

Step 4: Setting up a Security Group 
If you have already used the AWS Management Console and have the appropriate security 
groups configured, you may automatically bypass this step or you can click the “Skip this” link 
next to the Continue button below to use your existing security group.  However, if you are new 
to the AWS Management Console this step helps you configure your instances firewall.  To 
complete this step, simply fill in your security group name and description and click “Continue”.  

 
Step 5: Configuring an Instance 
Now you can configure your instance.  First, you will want to select the number of instances 
that you want to launch.  We have chosen to launch “1” instance.  We want to launch on a 
small instance, since we do not need more compute resources for this demo. We also want to 
select the gsg keypair we configured earlier. Lastly we want to highlight the gsg security group 
we created earlier so that our firewall is properly configured.  Once we have entered in our 
changes, you simply click “Launch” as shown below. 

 
 
If you see the page below, then congratulations are in order! You have just launched your first 
instance backed by Amazon EBS.  

 
Step 6: Connecting to the Instance 
To log onto the instance, click on the “Instances” tab in the navigation panel as shown below. 

 
 
If you have used Amazon EC2 previously you may notice that the instances start 
 
faster, because the root device in Amazon EBS loads on demand. So, the instance 
can start nearly immediately, while the AMIs backed by S3 need to load 
New! 
completely before the instance will be started. 
 
Look at the instances launched to find your new instance.  Note that the root device type on 
your new instance will say “ebs”.  Once your instance is in the “Running” state, right click on 
your instance, and select the “Connect” option.   

 
 

 
To connect to the instance follow the instructions in the pop‐up. If you are new to using PuTTY 
and private keys, please visit the Amazon EC2 Getting Started Guide 
(http://aws.amazon.com/documentation) for a more in depth tutorial. 

 
 

Important Differences between Instances Backed by Amazon EBS and Local Instance Storage 
Let’s take a moment to explore one of the important differences with instances 
  backed by Amazon EBS – the fact that it has an EBS volume. To see the volume, 
click on the “Volumes” tab on the navigation bar.  You can then see the fact that 
New!  there is an Amazon EBS volume that is attached to your newly created instance.  
Also of note is that the volume size is 15 GB, which is bigger than the 10 GB 
limitation associated with instances backed by local instance storage.  

 
 

 
 
Since the goal of instances backed by Amazon EBS is to persist all of your data 
beyond the life of an instance, the local storage is not attached to your instances by 
Note  default.  If you wish to attach them, that advanced topic is covered in the Amazon 
EC2 developer guide at http://aws.amazon.com/documentation. 

Cleaning Up: Terminating your Instance 
Once you have completed using your instance, you can terminate the instance.  By default, this 
will release your computing resources and delete Amazon EBS volumes that were attached at 
instance launch (e.g.‐ the root device).  However, if you attach additional Amazon EBS volumes 
after instance launch (we did not do that in this example), those volumes will not automatically 
be deleted. 
 
There are ways to enable your Amazon EBS volumes to persist after terminating an 
instance that are not covered in this document.  If you wish to learn more, please visit 
Note  the Amazon EC2 developer guide at http://aws.amazon.com/documentation. 
 
To terminate your instance, click on the “Instances” tab in the Navigation panel.  Locate your 
instance in the associated window and right click on it.  Then select the “Terminate” option and 
click “Ok” on the associated pop‐up. 

 
Tutorial #2: Stopping and Starting an Instance Backed by Amazon EBS 
Core Concepts 
Using Amazon EBS volumes as root devices is valuable because Amazon EBS persists data 
outside of an instance, effectively decoupling your data and compute resources.  When you no 
longer need your CPU resources, you can now turn them off and stop paying for the compute 
cycles while preserving your root device data.  When your instance is stopped, you will only 
need to pay for your Amazon EBS storage costs, which can lead you to substantial savings. 
 
To enable this functionality we have introduced two new concepts: Stop (compared to 
Terminate) and Start (compared to Run).  Stop will shut down your instance releasing the 
compute resources, but it will not delete your Amazon EBS volume. When Stop is called, you 
will retain your instance id, so that you can restart it at a later time. Start is then used to restart 
instances that have previously been stopped. When the instance is restarted it will retain the 
original instance id.   
If you call shutdown from within your instance your instance will Stop by default.  
You can override that behavior so that a shutdown will also act like a Terminate. This 
Note  is documented in more detail in the Developer Guide. 

Analogously, Run can be used to start up a new instance from an AMI. Then, Terminate will 
actually release the compute resources and by default delete your Amazon EBS volume.  Once 
Terminate is called you will not be able to restore the instance/Amazon EBS volume unless you 
have an up‐to‐date snapshot of all of your storage.  
 
Start and Stop only work with instances backed by Amazon EBS.  This functionality 
does not work with instances and AMIs backed by local storage or Amazon S3. 
Note   
The tutorial below walks you through stopping and restarting an instance. 

Step 1: Setting Up Your Instance 
This tutorial assumes that you have a running instance backed by Amazon EBS that you can 
practice with and that you are already logged into the AWS Management Console.  If you have 
an instance running and are logged into the AWS Management Console, please skip to the next 
step.  If you need an instance backed by Amazon EBS, please follow the steps in Tutorial #1 to 
get an instance running.   

10 

 
Step 2: Stopping an Instance 
Stopping your instance will effectively shut it down while retaining the Amazon EBS volume.  To 
accomplish this go to the “Instances” tab in the Navigation panel, right click on your instance, 
and click “Stop”.  Your instance will move from the running to stopping to stopped state. 

 
Once your instance is stopped, you can see that the Amazon EBS volume is still persisted (see 
the vol‐3e954b56 shown below). To verify this for your own instance, click on the “Volumes” 
tab on the Navigation panel, and look at the volume attached to your instance id.  It should 
reflect that the Amazon EBS volume is in use.   

At this point you can treat that volume like any other Amazon EBS volume, and 
 
modify it as necessary.  For instance, you could detach it and re‐attach it to 
another instance and repair problems on the file system or update software from 
Cool! 
a centralized instance.   

 
11 

 
Step 3: (Re‐)Starting an Instance 
Once you are ready to restart the instance, you will need to click on the “Instances” tab in the 
Navigation panel again, right click on your stopped instance, select the “Start” option, and click 
“Ok” in the associated pop‐up as shown below.   

 
At this point, the instance will move from the “Stopped” to “Pending” to “Running” state. Once 
it is running, you can interact like any other running Amazon EC2 instance. 
 
It is potentially important to note that the public IP address of your instance may 
change after it has been stopped and restart.  If this is not desired behavior you can 
Note  leverage Elastic IPs to create a consistent IP address. 
 
Congratulations! You have successfully stopped and restarted your instance! 

Cleaning Up: Terminating your Instance 
Once you are done stopping and starting the instance, you will want to terminate your instance 
to release the compute resources and delete the associated Amazon EBS volume. Simply click 
on the “Instances” tab in the Navigation panel, right click on the appropriate instance, select 
the “Terminate” option, and click “Ok” on the pop‐up as shown below.  
 

12 

 
 

Tutorial #3: Bundling an Instance Backed by Amazon EBS 
Core Concepts 
One common use case is the desire to make a point‐in‐time copy of the contents of the root 
device so that another instance could boot off of that image. Images are typically created for 
backup purposes or to make clones of the existing instance.  Previously, this process on Linux 
required you to create an image of your instance on the instance itself and no APIs were 
available to assist.  On Windows, there was an API that you could call to create an image of the 
instance, but had to make another subsequent call to register the AMI.  Now, there is one API 
for both Linux/UNIX and Windows that allows you to bundle your AMI backed by Amazon EBS 
and register it. 
 
Previously you would also have to pay for the storage of the entire image in 
  Amazon S3, even if you just changed a couple of bits on the disk.  Now, AMIs 
backed by Amazon EBS store the full image the first time (e.g.‐the first time you 
Cool!  customize a public AMI it will copy the complete image), and thereafter you will 
only store the changes on disk during subsequent create image calls (just like 
Amazon EBS snapshots). Therefore, bundling AMIs through Amazon EBS change 
makes it cheaper, faster, and easier to store backups of your instances. 
 
The tutorial below walks you through bundling your AMI backed by Amazon EBS. 
 

13 

 
Step 1: Make any Modifications 
This tutorial assumes that you have a running instance backed by Amazon EBS that you can 
practice with and that you are already logged into the AWS Management Console.  If you have 
a customized instance running and are logged into the AWS Management Console, please skip 
to the next step.  If you need an instance backed by Amazon EBS, please follow the steps in 
Tutorial #1 to get an instance running and subsequently make a change on the root device so 
you can validate that the changes were saved after bundling.   

Step 2: Create the Image 
When you are ready to create your image from the AWS Management Console, you simply click 
on the “Instances” tab in the Navigation panel.  From there you right click on the desired 
instance and select “Create Image (EBS AMI)” as shown below. 

 
 

In the associated pop‐up, enter in a unique “Image Name”.  For those familiar with the process 
to create images of instances backed by local storage, the “Image Name” replaces the 
“Manifest Name” field (e.g. s3_bucket/something.manifest.xml), which helped to identify the 
Amazon S3 bucket and each unique AMI.  Now, the field is far more human legible.  The “Image 
Description” is new and enables you to optionally create up to 255 characters of additional 
information to help system administrators better decide which image to choose at startup.  
After you have named your image appropriately, click on “Create This Image” to start bundling 
your image. 

14 

 
 
Step 3: Start a Clone 
It may take a couple of minutes to create your image. To check on the status, go to the “AMIs” 
tab in the Navigation panel.  Then, select “Owned By Me” as shown below to filter out the 
other public or private AMIs you may be able to see. 

 
 

Once the status of the AMI is “Available”, you can now launch a clone of the instance that you 
imaged.  To accomplish that simply right click on the AMI and select “Launch instance” and 
complete the associated Launch Wizard (details on using the AWS Management Console 
Launch Wizard can be found in Tutorial #1). 

15 

 
 
Congratulations! You have now successfully created a new image and started a clone of your 
existing instance.  Assuming you made changes to the AMI, take this opportunity to login and 
verify that those changes were persisted. 

Cleaning Up: Terminating your Instance / Deleting the New AMI 
Once you are done experimenting with this tutorial, you will want to terminate your instances 
to release the compute resources and delete the associated Amazon EBS volume. You will also 
likely want to delete your AMI.  
 
To accomplish terminate your instances, simply click on the “Instances” tab in the Navigation 
panel, right click on the appropriate instance, select the “Terminate” option, and click “Ok” on 
the pop‐up as shown below.  

16 

 
To delete your test AMI, you must first de‐register the AMI.  You can do this by clicking on the 
“AMIs” tab in the Navigation panel, selecting the “Owned By Me” filter, right clicking on the test 
AMI, selecting “De‐register”, and clicking “Ok” on the associated pop‐up. 

Once the AMI is de‐registered, you can now delete the snapshot. You can do this by clicking on 
the “Snapshots” tab in the Navigation panel, selecting the “Owned By Me” filter, right clicking 
on the test AMI, selecting “Delete Snapshot”, and clicking “Ok” on the associated pop‐up. 

 
 
Now the test resources covered in this tutorial should be released. 

Advanced Options for Instance Startup and AMI Creation 
There are a number of helpful features in this release for power users.  Specifically, when you 
create a new AMI or Instance backed by Amazon EBS you can now specify snapshots to 
automatically instantiate and mount on additional partitions. Additionally, when an instance 
backed by Amazon EBS is in the “Stopped” state, you can modify the instance attributes kernel, 
ram disk, user data, Amazon EBS snapshots to mount, and instance type before re‐launching it.  
This enhancement enables you to upgrade your kernel and ram disk, and also makes vertical 
scaling easier. 
 

17 

 
These concepts are not enabled through the AWS Management Console yet, so they are 
outside the scope of this document.  But these concepts are covered in detail in the Amazon 
EC2 API, Command Line Tools, and Developer Guide documents found on 
http://aws.amazon.com/documentation.  Please refer to the RunInstances, CreateImage, 
ModifyImageAttributes, and ModifyInstanceAttributes APIs and the associated tools for details. 

Frequently Asked Questions (FAQs) 
 

Question #1: What are the differences between stopping and terminating an instance? 
The instance will first perform a normal shutdown in both cases. If the instance was stopped, it 
will then transition to a stopped state, all of its Amazon EBS volumes will remain attached, and 
it can then be started again at a later time. If the instance was terminated, attached Amazon 
EBS volumes will be deleted where the associated deleteOnTerminate instance attribute is set 
to true.  The instance itself will also be deleted, and the instance cannot be started again at a 
later date.  
More advanced topics are covered in the command line tools, API, and Developer Guide 
documentation at http://aws.amazon.com/documentation. 
 
Question #2: How does stopping and starting an instance effect how it is charged? 
You will not be charged for additional instance hours while the instance is in a stopped state.  A 
full instance hour will be charged for every transition from a stopped state to a running state, 
even if transitions happen multiple times within a single hour.  If the instance type was changed 
while the instance was stopped, you will be charged at the new instance type’s rate once the 
instance has been started. All of the associated Amazon EBS usage of your instance, including 
root device usage, will be charged at the typical Amazon EBS prices. 
 
Question #3: What limitations exist for stopped instances?  
In addition to the limit on running instances, there is an additional limit on the overall number 
of instances that you can have (whether running, stopped, or in any other state except for 
terminated.) This overall instance limit is 2 times your running instance limit. The running 
instance limit can be increased upon request via the instance limit request form.   
 
Question #4: Do I need to share the Amazon EBS snapshots that an AMI references in order to 
share the AMI? 
No, only the AMI itself needs to be shared. The system will automatically provide the instance 
access to the referenced Amazon EBS snapshots for the purposes of the launch. 
18 

 
What’s New 
Change  Description Release Date 
Initial Release  The initial release of the Boot  December 2, 2009 
from EBS Feature Guide. 
 
 

19 

Anda mungkin juga menyukai