2

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:

1 Answer 1

6

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:

us-east-1   precise 12.04 LTS   amd64   hvm             20130624    ami-25d9a94c    hvm
us-east-1   precise 12.04 LTS   amd64   ebs             20130624    ami-23d9a94a    aki-88aa75e1
us-east-1   precise 12.04 LTS   i386    ebs             20130624    ami-21d9a948    aki-b6aa75df
us-east-1   precise 12.04 LTS   amd64   instance-store  20130624    ami-d9d6a6b0    aki-88aa75e1
us-east-1   precise 12.04 LTS   i386    instance-store  20130624    ami-bfd3a3d6    aki-b6aa75df

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:

"BlockDeviceMappings": [
    { "DeviceName": "/dev/sdb", "VirtualName": "ephemeral0" },
    { "DeviceName": "/dev/sdc", "VirtualName": "ephemeral1" },
    { "DeviceName": "/dev/sdd", "VirtualName": "ephemeral2" },
    { "DeviceName": "/dev/sde", "VirtualName": "ephemeral3" }
],

You may want to review the AWS block device mapping concepts page as well.

1
  • 1
    Your intuition was correct about precise 12.04. A great answer, thank you for your time. Jul 26, 2013 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.