How to Run an Instance
This section describes how to run an instance.
AWS Management Console
To launch an instance
-
Log in to the AWS Management Console and click the Amazon EC2 tab.
-
Click Instances in the Navigation pane.
The console displays a list of running instances.
-
Click Launch Instance.
The Launch Instance wizard appears.
-
Select the Quick Start tab.
-
If you are launching a Linux/UNIX instance, locate the Getting Started on Fedora Core 8 AMI and click its Select button. If you are launching a Windows instance, locate the Getting Started on Microsoft Windows Server 2003 AMI and click its Select button.
Note We recommend launching basic AMIs for this tutorial, but you can launch any AMI.
-
If the Configure Firewall page of the wizard appears, click the Skip button because you already configured the
default
security group.The Launch page of the wizard appears.
-
Confirm the following settings and click Launch.
-
Enter
1
in the Number of Instances field. -
Select the
m1.small
Instance Type option. -
Select the key pair that you created from the Key Pair Name list box.
-
Select
default
from the Security Groups list box.
The instance(s) begin launching.
-
Command Line Tools
To launch an instance
-
Use the
ec2-run-instances
command.PROMPT>
ami-235fba4a
-k gsg-keypairAmazon EC2 returns output similar to the following example.
RESERVATION r-7430c31d 924417782495 default INSTANCE i-ae0bf0c7 ami-2bb65342 pending gsg-keypair 0 m1.small 2008-03-21T16:19:25+0000 us-east-1a
-
Look for the instance ID in the second field and write it down.
You use it to manipulate this instance (including terminating it when you are finished).
It takes a few minutes for the instance to launch.
-
The following command displays the launch status of the instance.
PROMPT>
i-ae0bf0c7
RESERVATION r-7430c31d 924417782495 default INSTANCE i-ae0bf0c7 ami-2bb65342 ec2-67-202-7-236.compute-1.amazonaws.com ip-10-251-31-162.ec2.internal running gsg-keypair 0 m1.small 2008-03-21T16:19:25+0000us-east-1a
Important | |
---|---|
After launching an instance, you are billed hourly for running time. When you are finished, make sure to terminate any instances that you started. |
When the instance state in the field just before the key pair name reads "running" the instance started booting. There might be a short time before it is accessible over the network, however. The first DNS name is your instance's external DNS name, i.e. the one that can be used to contact it from the Internet. The second DNS name is your instance's local DNS name, and is only contactable by other instances within the Amazon EC2 network. The DNS names of your instances are different than those shown in the preceding example and you should use yours instead. The examples in this guide use the public DNS name.