ebook img

What is Amazon EC2? PDF

590 Pages·2013·11.93 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview What is Amazon EC2?

Amazon Elastic Compute Cloud User Guide API Version 2013-02-01 Amazon Elastic Compute Cloud User Guide Amazon Web Services Amazon Elastic Compute Cloud User Guide Amazon Elastic Compute Cloud: User Guide Amazon Web Services Copyright © 2013 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. The following are trademarks of Amazon Web Services, Inc.: Amazon, Amazon Web Services Design, AWS, Amazon CloudFront, Cloudfront, Amazon DevPay, DynamoDB, ElastiCache, Amazon EC2, Amazon Elastic Compute Cloud, Amazon Glacier, Kindle, Kindle Fire, AWS Marketplace Design, Mechanical Turk, Amazon Redshift, Amazon Route 53, Amazon S3, Amazon VPC. In addition, Amazon.com graphics, logos, page headers, button icons, scripts, and service names are trademarks, or trade dress of Amazon in the U.S. and/or other countries. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. Amazon Elastic Compute Cloud User Guide What is Amazon EC2?............................................................................................................................1 Getting Started ....................................................................................................................................... 8 Amazon Machine Images..................................................................................................................... 18 AMI Basics............................................................................................................................................18 Finding a Suitable AMI..........................................................................................................................21 Shared AMIs.........................................................................................................................................24 Paid AMIs ............................................................................................................................................. 26 Creating Amazon EBS-Backed AMIs Using the Console.....................................................................29 Creating Your Own AMIs.......................................................................................................................31 Creating Amazon EBS-Backed Linux AMIs.................................................................................31 Creating Instance Store-Backed Linux/UNIX AMIs ....................................................................35 Tools You Need .................................................................................................................. 35 From an Existing AMI.........................................................................................................37 From a Loopback............................................................................................................... 40 Creating and Launching an AMI from a Snapshot......................................................................48 Creating Paid AMIs ..................................................................................................................... 48 Sharing AMIs Safely....................................................................................................................58 Copying AMIs ....................................................................................................................................... 67 Amazon Linux AMIs..............................................................................................................................71 Enabling Your Own Linux Kernels................................................................................................77 Instances .............................................................................................................................................. 86 Instance Basics.....................................................................................................................................87 Families and Types......................................................................................................................87 Micro Instances..................................................................................................................94 High I/O Instances ........................................................................................................... 101 High Storage Instances....................................................................................................102 Cluster Instances ............................................................................................................. 104 Regions and Availability Zones ................................................................................................. 116 Supported Platforms ................................................................................................................. 121 Root Device Volume..................................................................................................................123 Best Practices ........................................................................................................................... 129 Stopping, Starting, and Terminating Instances..........................................................................130 Spot Instances....................................................................................................................................132 Getting Started with Spot Instances..........................................................................................133 Viewing Spot Price History .............................................................................................. 136 Creating a Spot Instance Request...................................................................................139 Finding Running Spot Instances......................................................................................143 Canceling Spot Instance Requests..................................................................................147 Fundamentals of Spot Instances...............................................................................................150 Placing Spot Requests.....................................................................................................150 Spot Instance Limits............................................................................................... 151 Customizing Your Spot Requests ........................................................................... 152 Tracking Spot Requests with Bid Status Codes......................................................153 Tagging Spot Instance Requests.....................................................................................159 Protecting Your Spot Instance Data Against Interruptions...............................................160 Planning for Interruptions ....................................................................................... 160 Persisting Your Root EBS Partition.........................................................................160 Walkthroughs: Using Spot Instances with AWS Services.........................................................161 Managing Spot Instances with Auto Scaling....................................................................161 Tools for Managing Auto Scaling with Spot Instances............................................162 Launching Spot Instances with Auto Scaling..........................................................164 Obtaining Information About the Instances Launched by Auto Scaling..................167 Updating the Bid Price for the Spot Instances........................................................171 Scheduling Spot Bid Requests...............................................................................173 Using Auto Scaling to Get Notifications for Spot Instances....................................174 Using CloudFormation Templates to Launch Spot Instances..........................................176 Launching Amazon Elastic MapReduce Job Flows with Spot Instances.........................177 Launching Spot Instances in Amazon Virtual Private Cloud............................................178 API Version 2013-02-01 4 Amazon Elastic Compute Cloud User Guide Advanced Tasks ........................................................................................................................ 180 Subscribe to Your Spot Instance Data Feed....................................................................180 Programming Spot with AWS Java SDK..........................................................................183 Tutorial: Amazon EC2 Spot Instances....................................................................184 Tutorial: Advanced Amazon EC2 Spot Request Management...............................193 Starting Clusters on Spot Instances................................................................................209 Reserved Instances............................................................................................................................211 Getting Started with Reserved Instances..................................................................................212 Tools for Working with Reserved Instances.....................................................................214 Choosing Reserved Instances Based on Your Usage Plans.....................................................216 Buying Reserved Instances.......................................................................................................218 Becoming a Buyer............................................................................................................219 Purchasing Reserved Instances......................................................................................220 Reading Your Statement (Invoice)....................................................................................226 Understanding Discount Pricing Tiers.......................................................................................228 Obtaining Information About Your Reserved Instances.............................................................236 Understanding the Pricing Benefit of Reserved Instances........................................................240 Reserved Instances and Consolidated Billing..................................................................241 Reserved Instance Marketplace................................................................................................242 Selling in the Reserved Instance Marketplace..........................................................................244 Registering as a Seller.....................................................................................................245 Selling Your Reserved Instances......................................................................................249 After Your Reserved Instance Is Sold...............................................................................269 Requirements Checklist for Reserved Instances.......................................................................271 Launching Instances...........................................................................................................................273 Getting a Key Pair ..................................................................................................................... 273 Have AWS Create the Key Pair........................................................................................274 Generate Your Own Key...................................................................................................278 Verifying Your Key Pair.....................................................................................................282 Launching an Instance from an AMI..........................................................................................283 Creating and Launching an AMI from a Snapshot....................................................................289 Connecting to Amazon EC2 Instances...............................................................................................292 Authorizing Network Access to Your Instances.........................................................................292 Connecting to Your Linux/UNIX Instances Using SSH..............................................................294 Connecting to Linux/UNIX Instances from Windows Using PuTTY...........................................300 Connecting to Windows Instances............................................................................................ 304 Importing and Exporting Instances.....................................................................................................306 Importing EC2 Instances...........................................................................................................306 Before You Get Started.................................................................................................... 307 Using the Amazon EC2 VM Import Connector to Import Your Virtual Machine to Amazon EC2 .................................................................................................................................. 309 Using the Command Line Tools to Import Your Virtual Machine to Amazon EC2............324 Troubleshooting Instance Importation..............................................................................336 Exporting EC2 Instances...........................................................................................................338 Managing Instances............................................................................................................................340 Auto Scaling and Load Balancing Your Instances.....................................................................340 Monitoring Your Instances ......................................................................................................... 342 Monitoring Your Instances with CloudWatch....................................................................343 Monitoring the Status of Your Instances...........................................................................354 Monitoring Instances with Status Checks...............................................................354 Monitoring Events for Your Instances......................................................................358 Ensuring Idempotency .............................................................................................................. 363 Instance Metadata and User Data.............................................................................................365 Stopping Instances ............................................................................................................................. 375 Stopping and Starting Instances...............................................................................................378 Terminating Instances ............................................................................................................... 380 Enabling Termination Protection................................................................................................380 Changing the Shutdown Behavior.............................................................................................384 API Version 2013-02-01 5 Amazon Elastic Compute Cloud User Guide Modifying Attributes of a Stopped Instance...............................................................................386 Troubleshooting Instances.................................................................................................................. 389 Instances with Failed Status Checks.........................................................................................389 What To Do If An Instance Immediately Terminates..................................................................412 Getting Console Output and Rebooting Instances....................................................................413 Network and Security ......................................................................................................................... 415 Security Groups..................................................................................................................................415 Controlling Access..............................................................................................................................421 IAM Policies...............................................................................................................................423 IAM Roles..................................................................................................................................425 Amazon VPC ...................................................................................................................................... 428 Instance IP Addressing.......................................................................................................................430 Elastic IP Addresses...........................................................................................................................438 Elastic Network Interfaces .................................................................................................................. 442 Storage ............................................................................................................................................... 454 Amazon EBS ...................................................................................................................................... 456 Increasing EBS Performance.................................................................................................... 461 Creating or Restoring a Volume................................................................................................467 Attaching a Volume to an Instance............................................................................................469 Describing Volumes...................................................................................................................473 Making a Volume Available for Use...........................................................................................475 Monitoring the Status of Your Volumes......................................................................................478 Detaching a Volume from an Instance.......................................................................................489 Deleting a Volume ..................................................................................................................... 491 Creating a Snapshot..................................................................................................................492 Copying a Snapshot..................................................................................................................494 Describing Snapshots ............................................................................................................... 497 Modifying Snapshot Permissions .............................................................................................. 499 Deleting a Snapshot..................................................................................................................501 Expanding a Volume..................................................................................................................502 Updating a Linux Instance ............................................................................................... 505 Updating a Windows Instance..........................................................................................506 Using Public Data Sets..............................................................................................................509 API and Command Overview....................................................................................................511 Instance Store.....................................................................................................................................513 Amazon S3 ......................................................................................................................................... 521 Block Device Mapping ........................................................................................................................ 522 Resources and Tags........................................................................................................................... 534 Resource Locations............................................................................................................................534 Listing and Filtering Your Resources.................................................................................................. 535 Tagging Your Resources..................................................................................................................... 540 Setting Up the CLI Tools.....................................................................................................................560 Verify the Signature ............................................................................................................................ 565 Making API Requests.........................................................................................................................569 Query Requests..................................................................................................................................570 SOAP Requests..................................................................................................................................574 Document History............................................................................................................................... 575 API Version 2013-02-01 6 Amazon Elastic Compute Cloud User Guide Amazon EC2 Concepts What is Amazon EC2? Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable computing capacity in the cloud. Amazon EC2 eliminates your need to invest in hardware up front and enables you to develop and deploy applications faster.You can use the web service interfaces to launch as many or as few virtual servers as you need, configure security and networking, and manage storage. With Amazon EC2, you pay only for the resources that you use. Amazon EC2 enables you to scale to handle your changes in requirements or spikes in popularity, reducing your need to forecast traffic. Topics • Amazon EC2 Concepts (p.1) • Working with Amazon EC2 (p.5) • How You're Charged for Amazon EC2 (p.6) • Amazon EC2 Resources (p.6) • What's Next? (p.7) Amazon EC2 Concepts As you get started with Amazon EC2, you should understand the key concepts of this computing environment and how it's similar to or different from your own computing environment. Amazon Machine Images and Instances An Amazon Machine Image (AMI) is a template that contains a software configuration (for example, an operating system, an application server, and applications). From an AMI, you launch instances, which are copies of the AMI running as virtual servers in the cloud.You can launch multiple instances of an AMI, as shown in the following figure. API Version 2013-02-01 1 Amazon Elastic Compute Cloud User Guide Regions and Availability Zones Your instances keep running until you stop or terminate them, or until they fail. If an instance fails, you can launch a new one from the AMI. Amazon publishes many AMIs that contain common software configurations for public use. In addition, members of the AWS developer community have published their own custom AMIs.You can also create your own custom AMI or AMIs; doing so enables you to quickly and easily start new instances that have everything you need. For example, if your application is a web site or web service, your AMI could include a web server, the associated static content, and the code for the dynamic pages. As a result, after you launch an instance from this AMI, your web server starts, and your application is ready to accept requests. You can launch different types of instances from a single AMI. An instance type essentially determines the hardware of the host computer used for your instance. Each instance type offers different compute and memory capabilities. Select an instance type based on the amount of memory and computing power that you need for the application or software that you plan to run on the instance. For more information, see Available Instance Types (p.88). When you launch an instance, the root device contains the image used to boot the instance. For more information, see Amazon EC2 Root Device Volume (p.123). All AMIs are categorized as either backed by Amazon EBS, which means that the root device for an instance launched from the AMI is an Amazon EBS volume, or backed by instance store, which means that the root device for an instance launched from the AMI is an instance store volume created from a template stored in Amazon S3. The description of an AMI indicates the type of root device (either ebs or instance store).This is important because there are significant differences in what you can do with each type of AMI. For more information about these differences, see Storage for the Root Device (p.19). For information about AMIs and instances, see Amazon Machine Images (AMI) (p.18) and Amazon EC2 Instances (p.86). Regions and Availability Zones Amazon has data centers in different areas of the world (for example, North America, Europe, and Asia). Correspondingly, Amazon EC2 is available to use in different regions. By launching instances in separate regions, you can design your application to be closer to specific customers or to meet legal or other requirements. Prices for Amazon EC2 usage vary by region (for more information about pricing by region, see Amazon EC2 Pricing). Each region contains multiple distinct locations called Availability Zones. Each Availability Zone is engineered to be isolated from failures in other Availability Zones, and to provide inexpensive, low-latency API Version 2013-02-01 2 Amazon Elastic Compute Cloud User Guide Storage network connectivity to other zones in the same region. By launching instances in separate Availability Zones, you can protect your applications from the failure of a single location. For more information about the available regions and Availability Zones, see Regions and Availability Zones (p.116). Storage When using an instance, you may have data that you need to store. Amazon EC2 offers the following storage options: • Amazon Elastic Block Store (Amazon EBS) • Amazon EC2 Instance Store (p.513) • Amazon Simple Storage Service (Amazon S3) The following figure shows the relationship between these types of storage. Amazon EBS Amazon EBS volumes are the recommended storage option for the majority of use cases, and are especially suited for applications that require a database, a file system, or access to raw block-level storage. Amazon EBS volumes are essentially hard disks that you can attach to a running instance and provide your instance with persistent, block-level storage. API Version 2013-02-01 3 Amazon Elastic Compute Cloud User Guide Databases As illustrated in the previous figure, you can attach multiple volumes to an instance. Also, to keep a back-up copy of your data, you can create a snapshot of an EBS volume, which is stored in Amazon S3. You can create a new Amazon EBS volume from a snapshot, and attach it to another instance.You can also detach a volume from an instance and attach it to a different instance. For more information about Amazon EBS volumes, see Amazon Elastic Block Store (Amazon EBS) (p.456). Instance Store All instance types, with the exception of micro instances, offer instance store, which provides your instances with temporary, block-level storage.This is storage that is physically attached to the host computer.The data on an instance store volume doesn't persist when the associated instance is stopped or terminated. For more information about instance store volumes, see Amazon EC2 Instance Store (p.513). Instance store is an option for inexpensive temporary storage.You can use instance store volumes if you don't require data persistence. Amazon S3 Amazon S3 is storage for the Internet. It provides a simple web service interface that enables you to store and retrieve any amount of data from anywhere on the web. For more information, see the Amazon S3 product page. Databases The application you're running on Amazon EC2 may need a database.The following are common ways to implement a database for your application: • Use Amazon Relational Database Service (Amazon RDS), which enables you to easily get a managed relational database in the cloud • Launch an instance of a database AMI, and use that instance as the database Amazon RDS offers the advantage of handling your database management tasks, such as patching the software, backing up, and storing the backups. For more information, see the Amazon RDS product page. Networking and Security You can launch an instance into one of two platforms: EC2-Classic or EC2-VPC. An instance that's launched into EC2-Classic is assigned a public IP address. An instance that's launched into EC2-VPC is assigned a public IP address only if it's launched into a default VPC. For more information about EC2-Classic and EC2-VPC, see Supported Platforms in the Amazon Elastic Compute Cloud User Guide. Instances can fail or terminate for reasons outside of your control. If one fails and you launch a replacement instance, the replacement has a different public IP address than the original. However, if your application needs a static IP address, Amazon EC2 offers Elastic IP addresses. For more information, see Instance IP Addresses in the Amazon Elastic Compute Cloud User Guide. You can use security groups to control who can access your instances.These are analogous to an inbound network firewall that enables you to specify the protocols, ports, and source IP ranges that are allowed to reach your instances.You can create multiple security groups and assign different rules to each group. You can then assign each instance to one or more security groups, and we use the rules to determine which traffic is allowed to reach the instance.You can configure a security group so that only specific IP addresses or specific security groups have access to the instance. For more information about security groups, see Amazon EC2 Security Groups (p.415). API Version 2013-02-01 4

Description:
The home page for AWS Technical Support.You can access the Support Center from the Amazon EC2 console by clicking. Help in the navigation bar, and selecting Support. AWS Support Center. API Version 2013-02-01. 6. Amazon Elastic Compute Cloud User Guide. How You're Charged for Amazon
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.