Amazon Elastic Compute Cloud
User Guide (API Version 2014-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Placement Groups

A placement group is a logical grouping of instances within a single Availability Zone. Using placement groups enables applications to participate in a low-latency, 10 Gbps network. Placement groups are recommended for applications that benefit from low network latency, high network throughput, or both. To provide the lowest latency, and the highest packet-per-second network performance for your placement group, choose an instance type that supports enhanced networking. For more information, see Enhanced Networking.

First, you create a placement group and then you launch multiple instances into the placement group. We recommend that you launch the number of instances that you need in the placement group in a single launch request. If you try to add more instances to the placement group later, you increase your chances of getting an insufficient capacity error.

If you stop an instance in a placement group and then start it again, it still runs in the placement group. However, the start fails if there isn't enough capacity for the instance.

If you receive a capacity error when launching an instance in a placement group, stop and restart the instances in the placement group, and then try the launch again.

Placement Group Limitations

Placement groups have the following limitations:

  • A placement group can't span multiple Availability Zones.

  • The name you specify for a placement group a name must be unique within your AWS account.

  • The following are the only instance types that you can use when you launch an instance into a placement group:

    • Compute optimized: c3.large | c3.xlarge | c3.2xlarge | c3.4xlarge | c3.8xlarge | cc2.8xlarge

    • GPU: cg1.4xlarge | g2.2xlarge

    • Memory optimized: cr1.8xlarge | r3.large | r3.xlarge | r3.2xlarge | r3.4xlarge | r3.8xlarge

    • Storage optimized: hi1.4xlarge | hs1.8xlarge | i2.xlarge | i2.2xlarge | i2.4xlarge | i2.8xlarge

  • You can't merge placement groups. Instead, you must terminate the instances in one placement group, and then relaunch those instances into the other placement group.

  • A placement group can span peered VPCs; however, you will not get full-bisection bandwidth between instances in peered VPCs. For more information about VPC peering connections, see VPC Peering in the Amazon Virtual Private Cloud User Guide.

Launching Instances into a Placement Group

We suggest that you create an AMI specifically for the instances that you'll launch into a placement group.

To launch an instance into a placement group using the console

  1. Open the Amazon EC2 console.

  2. Create an AMI for your instances.

    1. From the Amazon EC2 dashboard, click Launch Instance. After you complete the wizard, click Launch.

    2. Connect to your instance. (For more information, see Connect to Your Instance.)

    3. Install software and applications on the instance, copy data, or attach additional Amazon EBS volumes.

    4. In the navigation pane, click Instances, select your instance, click Actions, and then click Create Image. Provide the information requested by the Create Image dialog box, and then click Create Image.

    5. (Optional) You can terminate this instance if you have no further use for it.

  3. Create a placement group.

    1. In the navigation pane, click Placement Groups.

    2. Click Create Placement Group.

    3. In the Create Placement Group dialog box, provide a name for the placement group that is unique in the AWS account you're using, and then click Create.

      When the status of the placement group is available, you can launch instances into the placement group.

  4. Launch your instances into the placement group.

    1. In the navigation pane, click Instances.

    2. Click Launch Instance. Complete the wizard as directed, taking care to select the following:

      • The AMI that you created

      • The number of instances that you'll need

      • The placement group that you created

To create a placement group using the command line

You can use one of the following commands. For more information about these command line interfaces, see Accessing Amazon EC2.

If you prefer, you can use the ec2-create-image command to create your AMI, the ec2-create-placement-group command to create your placement group, and use the ec2-run-instances command to launch an instance into the placement group.

Deleting a Placement Group

You can delete a placement group if you need to replace it or no longer need a placement group. Before you can delete your placement group, you must terminate all instances that you launched into the placement group.

To delete a placement group using the console

  1. Open the Amazon EC2 console.

  2. In the navigation pane, click Instances.

  3. Select and terminate all instances in the placement group. (You can verify that the instance is in a placement group before you terminate it by checking the value of Placement Group in the details pane.)

  4. In the navigation pane, click Placement Groups.

  5. Select the placement group, and then click Delete Placement Group.

  6. When prompted for confirmation, click Yes, Delete.

To delete a placement group using the command line

You can use one of the following sets of commands. For more information about these command line interfaces, see Accessing Amazon EC2.