Discussion Forums
Discussion Forums > Category: Management Tools > Forum: AWS CloudFormation >Thread: Specify block-device-mapping for AWS::EC2::Instance?
Advanced search options
Specify block-device-mapping for AWS::EC2::Instance?
Posted by: elasticchris
Posted on: Mar 7, 2011 9:21 AM
  Click to reply to this thread Reply
This question is not answered. Answer it to earn points.
I'm trying out an EBS-backed Amazon Linux AMI on CloudFormation and would like to make use of the ephemeral storage. However, EBS-backed instances do not expose their available ephemeral storage by default, you need to specify a block device mapping.

Is there a way to do this in a CloudFormation template? If not, is there a recommended workaround?
Permlink Replies: 12 | Pages: 1 - Last Post: Dec 27, 2012 2:54 PM by: ChrisW@AWS
Replies
Re: Specify block-device-mapping for AWS::EC2::Instance?
Posted by: ChrisW@AWS
Posted on: Mar 9, 2011 9:22 PM
in response to: elasticchris in response to: elasticchris
  Click to reply to this thread Reply
Thank you for your feedback. You are correct that device block mappings are not exposed today on EC2 instance resources. Auto Scaling launch configurations allow you to specify a device block mapping. You could wrap your instances in an Auto Scaling group as a workaround.

Thanks again for your feedback - it helps us figure out what additional features and resources we need to support and how to prioritize them.

/Chris
Re: Specify block-device-mapping for AWS::EC2::Instance?
Posted by: elasticchris
Posted on: Apr 28, 2011 3:18 PM
in response to: ChrisW@AWS in response to: ChrisW@AWS
  Click to reply to this thread Reply
Chris,

Given this constraint, for the purpose of being able to configure a block device mapping, is it possible to define an Auto Scaling Group that does not actually auto-scale? i.e. no instances will be added or terminated automatically?

Thanks,

Chris
Re: Specify block-device-mapping for AWS::EC2::Instance?
Posted by: ChrisW@AWS
Posted on: Apr 28, 2011 6:06 PM
in response to: elasticchris in response to: elasticchris
  Click to reply to this thread Reply
Hi Chris,

Unless you put a trigger on an Auto Scaling group, the group acts just like a container for the instances. Auto Scaling groups with no trigger are the suggested and recommended way to create templates where you want to instantiate multiple hosts that are running the same configuration (e.g. AMI and other properties).

You also get the advantage that Auto Scaling will health check your instances at the ec2 level and will automatically restart any ailed instances (by terminating the bad instance and recreating a replacement instance)

/Chris
Re: Specify block-device-mapping for AWS::EC2::Instance?
Posted by: Grace RealName(TM)
Posted on: May 13, 2011 3:21 PM
in response to: ChrisW@AWS in response to: ChrisW@AWS
  Click to reply to this thread Reply
Are there any plans to include the ability to expose block device mappings as part of the ec2 resource?
Re: Specify block-device-mapping for AWS::EC2::Instance?
Posted by: ChrisW@AWS
Posted on: May 13, 2011 5:40 PM
in response to: Grace in response to: Grace
  Click to reply to this thread Reply
Hi there,
BlockDeviceMappings is indirectly exposed by associating EBS volumes with a "raw" EC2 instance or you can use Auto Scaling to wrap one or more instances. So that we ca prioritize the feature, what specifically do you need from BlockDeviceMappings for an individual instance?

Thanks for your help
/Chris
Re: Specify block-device-mapping for AWS::EC2::Instance?
Posted by: Grace RealName(TM)
Posted on: May 17, 2011 2:27 PM
in response to: ChrisW@AWS in response to: ChrisW@AWS
  Click to reply to this thread Reply
Hi Chris,

I am referring to exposing the ephemeral storage like you can when using the CLI

Grace
Re: Specify block-device-mapping for AWS::EC2::Instance?
Posted by: ChrisW@AWS
Posted on: May 17, 2011 2:47 PM
in response to: Grace in response to: Grace
  Click to reply to this thread Reply
Perfect - thanks for the feedback, this helps prioritize the features
/Chris
Re: Specify block-device-mapping for AWS::EC2::Instance?
Posted by: Vijay B. Gupta RealName(TM)
Posted on: Jul 28, 2012 6:30 PM
in response to: ChrisW@AWS in response to: ChrisW@AWS
  Click to reply to this thread Reply
Chris,

It would be incredibly helpful, if we could configure BlockDeviceMappings for EC2 instances (that aren't in an autoscaling group), so that we can override the default EBS root volume size, without having to prep custom AMIs. (It's a simple matter to run resize2fs as part of the boot process.)

Thanks,
Brian
Re: Specify block-device-mapping for AWS::EC2::Instance?
Posted by: ChrisW@AWS
Posted on: Aug 1, 2012 3:08 PM
in response to: Vijay B. Gupta in response to: Vijay B. Gupta
  Click to reply to this thread Reply
Yep - its high on our list of priorities
/Chris
Re: Specify block-device-mapping for AWS::EC2::Instance?
Posted by: Vijay B. Gupta RealName(TM)
Posted on: Aug 3, 2012 4:40 AM
in response to: ChrisW@AWS in response to: ChrisW@AWS
  Click to reply to this thread Reply
Thanks, can we assume you'll also be adding support for Provisioned IOPS? (For both boot and secondary volumes?)
Re: Specify block-device-mapping for AWS::EC2::Instance?
Posted by: adamsb6
Posted on: Dec 18, 2012 2:00 PM
in response to: ChrisW@AWS in response to: ChrisW@AWS
  Click to reply to this thread Reply
What does it mean to associate an EBS volume with a raw EC2 instance? How would I be able to do that in a template, and why would an EBS volume result in ephemeral storage being attached?

I need access to ephemeral storage because I have a lot of big but unimportant files that need to be stored locally on the machines I'm launching.

Autoscaling doesn't work well because I do have some important data on an EBS volume attached to the instance, and an EBS volume created as part of an autoscaling launch configuration gets deleted on instance termination.
Re: Specify block-device-mapping for AWS::EC2::Instance?
Posted by: ChrisW@AWS
Posted on: Dec 27, 2012 2:54 PM
in response to: ChrisW@AWS in response to: ChrisW@AWS
  Click to reply to this thread Reply
We are pleased to announce that AWS CloudFormation now supports full access to EC2 instance block device mappings in a template. For more information see:

https://forums.aws.amazon.com/ann.jspa?annID=1784

Enjoy
/Chris