I am trying to launch an EC2 Instance with CloudFormation that uses ephemeral / instance storage rather than EBS.
I have managed this with Opsworks – so that in the EC2 management window "root device" is not ebs. I have yet to figure out how to do this with a CloudFormation template.
I have a feeling it has something to do with BlockDeviceMappings but have not figure it out yet. Closest discussion to what I want to do I found here: https://forums.aws.amazon.com/message.jspa?messageID=243921
Can someone supply a CloudFormation template snippet to launch a ephemeral storage based instance?
Other parts of the docs that seem useful:
- http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-blockdev-template.html
- http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-blockdev-mapping.html
- http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html
- http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2.html
Best Answer
I am not sure what OS you are trying to launch, but the key is that you have to use the right AMI. For example, look at Canonical's AMI listings for Ubuntu: http://cloud-images.ubuntu.com/locator/ec2/
If you search for precise us-east-1 you'll see there are 5 different AMIs:
The first one is for cluster compute instances only.
The second and third are for EBS-backed instances, 64bit or 32bit.
Finally, the fourth and fifth are for ephemeral / instance storage backed instances, 64bit or 32bit.
Once you have chosen an AMI that is instance-store backed, you can assign the rest of the emphemeral disks with this snippet inside the Properties:
You may want to review the AWS block device mapping concepts page as well.