Amazon Elastic Compute Cloud
User Guide (API Version 2012-04-01)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

Launching, Stopping, and Starting

This section walks you through launching an instance from an Amazon EBS-backed AMI, stopping the instance, and then restarting it.

We assume you've already walked through the Amazon Elastic Compute Cloud Getting Started Guide and know how to use the AWS Management Console to launch, connect to, and terminate an instance.

[Important]Important
  • The instance you're about to launch will be live (and not running in a sandbox). You will incur the standard Amazon EC2 usage fees for the instance until you terminate it. The total charges will be minimal (typically less than a dollar). For more information about Amazon EC2 usage rates, go to the Amazon EC2 product page.

  • Each time you transition an instance from stopped to started, we charge a full instance hour, even if transitions happen multiple times within a single hour.

  1. Locate the AMI to launch:

    1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

      [Note]Note

      If you're using Amazon VPC, make sure to log in with the email address and password of the AWS account that owns your VPC and subnets.

    2. In the Navigation pane, click AMIs.

      A list of AMIs is displayed.

    3. In the Viewing menu, select EBS Images to filter the list.

      AMI list

      A list of Amazon EBS-backed AMIs is displayed.

    4. Click the label on the Owner column to sort the AMIs by owner.

      The AMIs created by Amazon (Owner=amazon) appear at the top of the list.

    5. Locate and click the amazon/getting-started-with-ebs-boot AMI and look at its details.

      AMI details

      Notice that the Root Device Type is ebs and the Root Device is /dev/sda1. Notice also that the Block Devices field shows information about the root device's mapping: /dev/sda1=snap-a08912c9:15:true. This means the root device /dev/sda1 is mapped to a 15 GiB volume created from the snap-a08912c9 snapshot, and the volume's DeleteOnTermination flag is true.

  2. Launch an instance:

    1. Right-click the AMI in the list and click Launch Instance and click Classic Wizard.

      The launch wizard starts. Walk through the wizard and launch an instance. If you're using Amazon VPC, make sure to specify the subnet you want to launch the instance into. If you'd like, connect to the instance once it's running.

    2. Go to the Instances page and look at the instance's information. Specifically take note of the instance ID and public DNS.

      Instance before stopping

      For VPC users: Take note of the instance ID and private IP address. You might need to click Show/Hide in the top right corner of the dashboard and turn on the field called Private IP. This adds a new Private IP column to the list of instances.

    3. Go to the Volumes page and look at the volume that was created when you launched the instance. The snapshot ID is the one listed in the AMI's Block Devices field (which we saw in a previous step).

      Root volume
  3. Stop the instance:

    1. Go back to the Instances page, right-click the instance, and select Stop.

      The instance's status changes to stopping, and then to stopped. Notice that the Public DNS field on the far right is now blank.

      Instance is stopped
      [Note]Note
      • If you associated an Elastic IP address with this instance, stopping this instance also disassociates the Elastic IP address from it.

      • By default, Windows instance assigns drive letters to all the attached (non-root) EBS volumes. When the Windows instance is stopped and started again, the drive letter mapping is likely to change. You can change the default settings such that the drive letter is always associated with the EBS volume you specify. For information, go to Using Ec2Config Service in the Microsoft Windows Guide.

      • If you've registered the instance with a load balancer, it is likely the load balancer will not be able to route traffic to your instance after you've stopped and started the instance. You must de-register the instance from the load balancer after stopping, and then register after starting the instance. For more information on de-registering and registering your instances with a load balancer, go to De-Registering and Registering Amazon EC2 Instances section in the Elastic Load Balancer Developer Guide.

      For VPC users: Notice that the Private IP field is now blank.

    2. Go back to the Volumes page and notice that the root device volume is still there and in use even though the instance is stopped.

      Root volume still there while instance is stopped
      [Tip]Tip

      At this point you can treat the volume like any other Amazon EBS volume, and modify it (e.g., repair file system problems or update software). You just detach the volume from the stopped instance, attach it to a running instance, make your changes, detach it from the running instance, and then reattach it to the stopped instance. Make sure you reattach it to the correct storage device (whichever device name is specified as the root device in the instance's block device mapping).

  4. Go back to the Instances page, right-click the instance, and select Start to restart the instance.

    The instance's status changes to pending, and then to running. Notice that the instance ID is still the same, but the public DNS has changed.

    Instance restarted with new DNS name

    For VPC users: Notice that the private IP address is still the same as before you stopped the instance. Instances in a VPC maintain their private IP address when you stop and start them. It's therefore possible to have a subnet with no running instances (they're all stopped), and also no remaining IP addresses available.

[Tip]Tip

At this point, you can leave your instance running, and go to the next section on creating an image from your instance (see Creating an Image from a Running Instance). If you'd rather stop here, we recommend you terminate your instance to ensure you stop incurring charges for it. The root device volume is set to automatically delete upon instance termination, so you won't be charged for storage of that volume once you terminate the instance.

[Tip]Tip

When you launch an instance, you can set the root device volume to persist when the instance terminates. For more information, see Changing the Root Volume to Persist.