Amazon Elastic Compute Cloud User Guide API Version 2011-11-01 Amazon Elastic Compute Cloud User Guide
Total Page:16
File Type:pdf, Size:1020Kb
Amazon Elastic Compute Cloud User Guide API Version 2011-11-01 Amazon Elastic Compute Cloud User Guide Amazon Elastic Compute Cloud: User Guide Copyright © 2011 Amazon Web Services LLC or its affiliates. All rights reserved. Amazon Elastic Compute Cloud User Guide Table of Contents Welcome ............................................................................................................................................................. 1 Introduction to Amazon EC2 .............................................................................................................................. 3 Using Amazon EC2 .......................................................................................................................................... 14 Using AMIs ........................................................................................................................................... 15 AMI Basics .................................................................................................................................. 15 Creating Your Own AMIs ............................................................................................................. 17 Overview of the AMI Creation Process .............................................................................. 17 Creating Amazon EBS-Backed AMIs ................................................................................. 18 Bundling Amazon EC2 instance store-backed Windows AMIs .......................................... 21 Bundling Amazon EC2 instance store-backed Linux/UNIX AMIs ..................................... 25 Tools You Need ......................................................................................................... 26 From an Existing AMI ............................................................................................... 27 From a Loopback ...................................................................................................... 31 Creating Paid AMIs ............................................................................................................ 39 Sharing AMIs Safely .................................................................................................................... 48 Amazon Linux AMI Basics ........................................................................................................... 56 Enabling Your Own Linux Kernels ................................................................................................ 62 Technical Notes for Advanced Users ................................................................................. 69 Using Instances .................................................................................................................................... 70 Instance Families and Types ....................................................................................................... 70 Instance Usage ........................................................................................................................... 75 Launching and Using Instances .................................................................................................. 76 Finding a Suitable AMI ....................................................................................................... 76 Getting an SSH Key Pair .................................................................................................... 78 Adding Rules to the Default Security Group ...................................................................... 84 Running an Instance .......................................................................................................... 86 Stopping and Starting Instances ........................................................................................ 90 Ensuring Idempotency ....................................................................................................... 92 Enabling Termination Protection for an Instance ................................................................ 94 Using Instance Metadata ................................................................................................... 97 Using Shared AMIs .......................................................................................................... 103 Paying for AMIs ................................................................................................................ 105 What to Do If an Instance Immediately Terminates ......................................................... 108 Getting Console Output and Rebooting Instances ........................................................... 110 Connecting to Instances ............................................................................................................ 112 Connecting to Linux/UNIX Instances from Linux/UNIX .................................................... 114 Connecting to Linux/UNIX Instances from Windows Using PuTTY ................................. 118 Connecting to Windows Instances ................................................................................... 123 Using Storage ..................................................................................................................................... 126 Amazon Elastic Block Store ...................................................................................................... 127 API and Command Overview ........................................................................................... 132 Creating an Amazon EBS Volume ................................................................................... 133 Attaching the Volume to an Instance ................................................................................ 135 Describing Volumes and Instances .................................................................................. 137 Making an Amazon EBS Volume Available for Use .......................................................... 139 Creating an Amazon EBS Snapshot ................................................................................ 141 Describing Snapshots ...................................................................................................... 142 Modifying Snapshot Permissions ..................................................................................... 144 Detaching an Amazon EBS Volume from an Instance ..................................................... 146 Deleting an Amazon EBS Snapshot ................................................................................ 149 Deleting an Amazon EBS Volume .................................................................................... 150 Amazon Simple Storage Service ............................................................................................... 151 Amazon EC2 Instance Storage ................................................................................................. 152 Amazon EC2 Storage Options Quick Reference ....................................................................... 161 Root Device Storage ................................................................................................................. 161 Amazon Elastic Compute Cloud User Guide Block Device Mapping ............................................................................................................... 168 Using Amazon EBS-Backed AMIs and Instances ............................................................................... 178 Basics of Amazon EBS-Backed AMIs and Instances ................................................................ 178 Launching, Stopping, and Starting ............................................................................................ 182 Creating an Image from a Running Instance ............................................................................. 186 Automatically Attaching Volumes ............................................................................................... 188 Launching an Instance from a Snapshot ................................................................................... 190 Modifying Attributes of a Stopped Instance ............................................................................... 191 Changing the Instance Initiated Shutdown Behavior ................................................................. 194 Using Instances of Your Virtual Machine in Amazon EC2 ................................................................... 195 Before You Get Started .............................................................................................................. 197 Using the Amazon EC2 VM Import Connector to Import Your Virtual Machine to Amazon EC2 ........................................................................................................................................... 198 Using the Command Line Tools to Import Your Virtual Machine to Amazon EC2 ...................... 212 Reserved Instances ............................................................................................................................ 225 Understanding the Pricing Benefit and Consolidated Billing ..................................................... 227 Reserved Instances and Consolidated Billing .................................................................. 228 Tools and Prerequisites ............................................................................................................. 230 Working with Reserved Instances ............................................................................................