| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
In this topic, you'll learn about cluster instances and how to create hardware virtual machine (HVM) AMIs. You'll also learn how to create placement groups and then launch cluster instances into them.
Topics
Amazon Elastic Compute Cloud (Amazon EC2) offers two cluster instance types: cluster compute instances and cluster graphics processing unit (GPU) instances. These instance types provide a very large amount of computational power coupled with increased network performance. They are well suited for High Performance Computing (HPC) applications and other demanding network-bound applications, such as science and engineering applications, financial modeling applications, and business analytics applications.
Cluster GPU instances have the same networking and placement group properties as cluster compute instances, but also include NVIDIA Tesla M2050 GPUs. These GPUs can be used to accelerate many scientific, engineering, and rendering applications by leveraging the Compute Unified Device Architecture (CUDA) or OpenCL parallel computing frameworks.
You can logically group cluster instances into clusters, known as cluster placement groups. This enables applications to get the full-bisection bandwidth and low-latency network performance required for tightly coupled, node-to-node communication typical of many HPC applications. A cluster placement group is a logical grouping of cluster instances within a single Availability Zone. A placement group cannot span multiple Availability Zones. You first create a placement group and then launch multiple cluster instances into the placement group. You must give each placement group a name that is unique within your AWS account.
Important
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 do receive an "Insufficient Capacity" error, stop and restart the instances in the placement group, and try to add more instances again.
Tip
You can't merge cluster placement groups. Instead, you must terminate the instances in one group, and then relaunch those instances into the other group.
A cluster instance is an Amazon EC2 instance type. This means that cluster instances interoperate with other Amazon EC2 features and AWS cloud services just as other Amazon EC2 instance types do. The functionality of cluster instances is similar to the functionality of other Amazon EC2 instance types, but with the important differences described in the following table and sections.
| Feature | Description |
|---|---|
|
Cluster Placement Groups |
Provides low latency and high-bandwidth connectivity between the cluster instances within a single Availability Zone. You just create a placement group and then launch cluster instances into it. Instances launched within a placement group participate in a full-bisection bandwidth cluster appropriate for HPC applications. |
|
HVM-Based Virtualization |
Cluster instances run as hardware virtual machine (HVM)-based instances. HVM virtualization uses hardware-assist technology provided by the AWS platform. With HVM virtualization, the guest VM runs as if it were on a native hardware platform, except that it still uses paravirtual (PV) network and storage drivers for improved performance. For more information, see HVM-Based AMIs. |
|
Amazon EBS-Backed, HVM-Based AMIs |
You must launch cluster instances from Amazon EBS-backed, HVM-based AMIs. Launching
an instance from an Amazon EC2 instance store-backed AMI is not
supported. AWS labels all AMIs as either |
Cluster instances currently have the following limitations:
Cluster instance types aren't available in every region. For more information, see the Amazon EC2 Release Notes.
Before you launch your first cg1.4xlarge instance, complete the Amazon EC2 instance request form.
Cluster instance types aren't available for use with Amazon DevPay.
Cluster placement groups currently have the following limitations:
Amazon EC2 Reserved Instances are not guaranteed within a specific requested placement group.
A cluster placement group can't span multiple Availability Zones.
A cluster placement group can't contain cluster instances of different instance types.
Cluster instances require the use of HVM-based, Amazon EBS-backed AMIs. Paravirtual (PV) AMIs employed by Linux instances and other instance types that use paravirtual machine (PVM)-based virtualization are not supported. Cluster instances do not require the use of Amazon Kernel Images (AKIs) or Amazon RAM disk Images (ARIs) that are part of PVM-based AMIs used with other EC2 instance types.
To help you get started with cluster instances, AWS provides a reference Amazon Linux AMI and a reference Amazon Windows AMI. These reference AMIs include the NVIDIA driver and CUDA toolkit, which enable the NVIDIA GPUs. This topic shows you how to customize a cluster instance and create your own AMI from it. To learn more about the Amazon Linux reference AMI, see Amazon Linux AMI. To learn more about the Amazon Windows AMIs, see Amazon Machine Images (AMIs).
You can use the following steps to create, customize, and launch cluster instances in a placement group:
Launch a cluster instance.
Customize your cluster instance by installing the software that you need.
Create an HVM AMI from your running cluster instance.
Create a placement group.
Launch cluster instances into the placement group.
(Optional) Use AWS CloudFormation to automate these tasks for you. See AWS CloudFormation Templates for Cluster Instances.
The next sections show you how to complete these steps using the AWS Management Console, the command line tools, or the API.
To launch a cluster instance
Launch a cluster instance just as you would launch any other type of instance.
For general instructions, see Launching an Instance from an AMI.
When prompted to choose an AMI, select the Cluster Compute Amazon Linux AMI.
When prompted to edit the instance details, select the instance type that meets your needs. Notice that you can only select high I/O and cluster instance types with these AMIs.
To customize your cluster instance
Customize your cluster instance just as you would any other type of instance. First, connect to your instance. For instructions, see Connecting to Amazon EC2 Instances.
Install software and applications on the instance, copy data, or attach additional EBS volumes. After you've configured your instance to meet your needs, you're ready to create an AMI.
To create an HVM AMI from your running cluster instance
Create an AMI from your cluster instance just as you would create an AMI from any other type of instance. For instructions that use the AWS Management Console, see Creating Amazon EBS-Backed AMIs Using the Console.
After you've created your AMI, you can terminate the instance that served as the basis for your AMI. Now you're ready to launch instances into a placement group using this AMI that you've created.
To create a placement group
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
In the navigation bar, select the region for the placement group.
In the navigation pane, click Placement Groups.
Click Create Placement Group.
In the Create Placement group dialog box, provide a unique name for the placement group, and then click Yes, Create.
When the status of the placement group is available, you're ready to launch cluster instances into the placement group.
To launch cluster instances into your placement group
Launch an instance using the Classic Wizard.
For general instructions, see Launching an Instance from an AMI.
On the CHOOSE AN AMI page, click the My AMIs tab, and select the HVM AMI that you created.
When prompted by the Request Instances Wizard, select the placement group that you created from the Placement Group list.
To launch a cluster instance
Launch a cluster instance using the ec2-run-instances command, just
as you would launch any other type of instance.
Be sure to specify the Cluster Compute Amazon Linux AMI. This is an Amazon EBS-backed HVM AMI designed for cluster computing. Also specify one of the cluster instance types.
The following example launches a cc2.8xlarge instance.
PROMPT>ec2-run-instances ami-xxxxxxxx--instance-type cc2.8xlarge
To customize your cluster instance
Customize your cluster instance just as you would any other type of instance. First, connect to your instance. For instructions, see Connecting to Amazon EC2 Instances.
Install software and applications on the instance, copy data, or attach additional EBS volumes. After you've configured your instance to meet your needs, you're ready to create an AMI.
To create an HVM AMI from your running cluster instance
Use the ec2-create-image command to create your own image from your
customized instance.
PROMPT>ec2-create-image -nyour_image_nameinstance_id
For example:
PROMPT> ec2-create-image -n "My_Custom_HVM_AMI" i-1a2b3c4dAmazon EC2 begins creating the image and returns the new image's ID. For example:
IMAGE ami-5f4d3a2b To check whether the AMI is ready, use the following command.
PROMPT>ec2-describe-images -o self
Amazon EC2 returns information about the AMI.
To create a placement group
Use the
ec2-create-placement-group
command. You must name the placement group and
set the -s option to
cluster, as shown in the following example.
PROMPT> ec2-create-placement-group XYZ-cluster -s clusterThe following is example output.
PLACEMENTGROUP XYZ_cluster cluster available
Record the name of the placement group. You'll need this name when you launch your cluster instances into this group.
Use the
ec2-describe-placement-groups
command to get details about your cluster placement
groups.
If you do not specify the name of the cluster placement group, details about all the placement groups in your account are returned.
PROMPT> ec2-describe-placement-groupsThe following is example output.
PLACEMENTGROUP XYZ-cluster cluster available PLACEMENTGROUP ABC-cluster cluster available
To launch cluster instances into your placement group
Use the ec2-run-instances command
with the name of the placement group.
The following example launches 10 cc2.8xlarge instances into the XYZ-cluster placement group.
PROMPT> ec2-run-instances ami-5f4d3a2b --instance-type cc2.8xlarge -n 10 --placement-group XYZ-cluster The following is example output.
RESERVATION r-064bcd6d 999988887777 default INSTANCE i-89fea78c ... cc2.8xlarge ... us-east-1a ... XYZ-cluster hvm ...
To launch a cluster instance
Launch a cluster instance using the RunInstances action, just as you
would launch any other type of instance.
Be sure to specify the Cluster Compute Amazon Linux AMI. This is an Amazon EBS-backed HVM AMI designed for cluster computing. Also specify one of the cluster instance types.
The following example launches a cc2.8xlarge instance.
https://ec2.amazonaws.com/?Action=RunInstances
&ImageId=ami-xxxxxxxx
&InstanceType=cc2.8xlarge
&MaxCount=1
&MinCount=1
&AUTHPARAMSTo customize your cluster instance
Customize your cluster instance, just as you would any other type of instance. First, connect to your instance. For instructions, see Connecting to Amazon EC2 Instances.
Install software and applications on the instance, copy data, or attach additional EBS volumes. After you've configured your instance to meet your needs, you're ready to create an AMI.
To create an HVM AMI from your running cluster instance
Construct a Query request, as shown in the following example.
https://ec2.amazonaws.com/ ?Action=CreateImage &InstanceId=i-1a2b3c4d &Name=My_Custom_HVM_AMI &AUTHPARAMS...
To create a placement group
Construct a Query request, as shown in the following example. You must name
the placement group and specify the strategy as
cluster.
Action=CreatePlacementGroup &GroupName=XYZ-cluster &Strategy=cluster &AUTHPARAMS...
The following is an example response.
<CreatePlacementGroupResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/"> <requestID>d4904fd9-82c2-4ea5-adfe-a9cc3EXAMPLE</requestId> <return>true</return> </CreatePlacementGroupResponse>
To get information about your cluster placement groups, construct a Query request similar to the following.
Action=DescribePlacementGroups &GroupName.1=XYZ-cluster &AUTHPARAMS...
The following is an example response.
<DescribePlacementGroupsResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">
<requestId>d4904fd9-82c2-4ea5-adfe-a9cc3EXAMPLE</requestId>
<placementGroupSet>
<item>
<groupName>XYZ-cluster</groupName>
<strategy>cluster</strategy>
<state>available</state>
</item>
</placementGroupSet>
</DescribePlacementGroupsResponse>To launch cluster instances into your placement group
Construct a Query request similar to the following example. This example launches 10 cc2.8xlarge instances in the XYZ-cluster placement group.
Action=RunInstances &InstanceType=cc2.8xlarge &Placement.GroupName=XYZ-cluster &MinCount=10 &MaxCount=10 &AUTHPARAMS...
The following is an example response.
<RunInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">
...
<placement>
<availabiltyZone>us-east-1a</availabilityZone>
<groupName>XYZ-cluster</groupName>
</placement>
...
<virtualizationType>hvm</virtualizationType>
</RunInstancesResponse>You can delete a placement group if your cluster instance requirements change or if you no longer need the placement group.
Before you delete your placement group, first you need to terminate all running instances in the group.
To terminate an instance
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
In the navigation pane, click Instances.
Right-click the instance, and then click Terminate.
When prompted for confirmation, click Yes, Terminate.
After you've terminated the cluster instances in a placement group, use the following steps to delete the placement group.
Before you delete your placement group, first you need to terminate all running instances in the group.
To terminate an instance
Use the ec2-terminate-instances command. This example command terminates the instance
with the instance ID i-10a64379.
ec2-terminate instances i-10a64379The following is an example of the output for this command.
INSTANCE i-10a64379 running shutting-down
After you've terminated the cluster instances in a placement group, use the following steps to delete the placement group.
Before you delete your placement group, first you need to terminate all running instances in the group.
To terminate an instance
Construct a Query request similar to the following example.
https://ec2.amazonaws.com/?Action=TerminateInstances &InstanceId.1=i-10a64379 &AUTHPARAMS
The following is an example response.
<TerminateInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">
<requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
<instancesSet>
<item>
<instanceId>i-10a64379</instanceId>
<currentState>
<code>32</code>
<name>shutting-down</name>
</currentState>
<previousState>
<code>16</code>
<name>running</name>
</previousState>
</item>
</instancesSet>
</TerminateInstancesResponse>After you've terminated the cluster instances in a placement group, use the following steps to delete the placement group.
To delete a placement group
Construct a Query request similar to the following example.
Action=DeletePlacementGroup &GroupName=XYZ-cluster &AUTHPARAMS...
The following is an example response.
<DeletePlacementGroupResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/"> <requestID>d4904fd9-82c2-4ea5-adfe-a9cc3EXAMPLE</requestId> <return>true</return> </DeletePlacementGroupResponse>
To make it easy for you to launch a cluster, you can use AWS CloudFormation templates that provision a two-node cluster with NFS storage, monitoring and a mounted 200 GB data set.
Each template performs the following tasks:
Creates a new controller instance.
Bootstraps MIT StarCluster. For more information about MIT StarCluster, see http://star.mit.edu/cluster/.
Generates a new cluster configuration.
Creates a new data volume.
Creates a new cluster master, worker instance, and storage.
Configures the resources to process compute jobs using Oracle Grid Engine.
You can use these templates to create a stack, log into the controller image, and use the cluster master to submit jobs or configure your cluster.
Here is where you can download the templates from AWS:
Download the template for a cc2.8xlarge cluster from https://s3.amazonaws.com/cloudformation-templates-us-east-1/cc2-cluster.json
Download the template for a cc1.4xlarge cluster from https://s3.amazonaws.com/cloudformation-templates-us-east-1/cc1-cluster.json
For more information about using AWS CloudFormation, see the AWS CloudFormation User Guide.
We provide reference AMIs for cluster instances that already have the NVIDIA driver installed. Amazon provides updated and compatible builds of the NVIDIA kernel drivers for each new official kernel upgrade. If you decide to use a different NVIDIA driver version than the one Amazon provides, or decide to use a kernel that's not an official Amazon build, then you first need to uninstall the Amazon-provided NVIDIA packages from your system to avoid conflicts with the versions of the drivers you are trying to install.
Use this command to uninstall Amazon-provided NVIDIA packages:
[root@ip-xxx ~]# sudo yum erase nvidia cudatoolkit
Important
The Amazon-provided CUDA toolkit package has dependencies on the NVIDIA drivers. Uninstalling the NVIDIA packages erases the CUDA toolkit. You will need to reinstall the CUDA toolkit after installing the NVIDIA driver.
A cluster GPU instance must have the NVIDIA Tesla M2050 GPU driver. The NVIDIA driver you install needs to be compiled against the kernel you intend to run on your instance.
Tip
You can download NVIDIA drivers at http://www.nvidia.com/Download/Find.aspx. Look for the Tesla M-Class M2050 driver for Linux 64-bit systems.
To install the driver for an Amazon Linux AMI
Make sure the kernel-devel package is installed and matches the version of
the kernel you are currently running.
[root@ip-xxx ~]# yum install kernel-devel- uname –r
Install the NVIDIA driver.
[root@ip-xxx ~]# /root/NVIDIA-Linux-x86_64_260.19.12.run
Reboot the instance.
Confirm that the driver is functional.
[root@ip-xxx ~]# /usr/bin/nvidia-smi -q -a
The response lists the installed NVIDIA driver version and details about the GPUs.
Confirm that the GPUs are exposed.
[root@ip-xxx ~]# ls /dev/*nv* /dev/nvidia0 /dev/nvidia1 /dev/nvidiactl /dev/nvram
If a newer version of the NVIDIA driver is available, you might want to update your instance to use it. To update your instance, follow the steps in the preceding section for installing the driver, and run the self-install script from the newly downloaded driver version.
To install the CUDA toolkit package, download the package from the NVIDIA website, and run the self-install script as outlined in step 2 of the preceding section for installing the driver.
Hardware specifications for the cc1.4xlarge cluster compute instance type,
cg1.4xlarge cluster GPU instance type, cr1.8xlarge high-memory cluster instance type,
and cc2.8xlarge cluster compute instance type are described in the following table.
Item |
|
|
|
|---|---|---|---|
Processor | 33.5 EC2 Compute Units (2 x Intel Xeon X5570, quad-core) | 88 EC2 Compute Units (2 x Intel Xeon E5-2670, eight-core) | 88 EC2 Compute Units (2 x Intel Xeon E5-2670, eight-core) |
Hyperthreading | 8 physical cores with 16 threads | 16 physical cores with 32 threads | 16 physical cores with 32 threads |
|
Memory |
23 GiB Note: The cluster GPU instances can use up to 22 GiB, with 1 GiB reserved for GPU operation. The 22 GiB doesn't include the GPU on-board memory, which is 3 GiB per GPU for the NVIDIA Tesla M2050 GPU. |
244 GiB |
60.5 GiB |
|
Platform |
64-bit |
64-bit |
64-bit |
|
Network |
10 Gbps Ethernet |
10 Gbps Ethernet |
10 Gbps Ethernet |
|
Local Storage |
1680 GiB instance 64-bit storage (2 x 840 GiB) |
240 GiB instance 64-bit storage (2 x 120 GiB SSD) |
3360 GiB instance 64-bit storage (4 x 840 GiB) |
GPUs (cluster GPU instances only) |
Two NVIDIA Tesla M2050 GPUs Note: The instance must have the corresponding NVIDIA driver installed; the reference AMI we provide includes the driver. If you need to download and install the driver, see Manual Installation of the NVIDIA Driver. | N/A | N/A |
When determining the number of cluster instances you can launch, be aware that you're limited to a maximum of 20 instances, of which two can be cluster GPU instances. If you need more instances, use the Request to Increase Amazon EC2 Instance Limit form.
For more information, see Instance Families and Types.