Posts

Showing posts from April, 2019

Use Instance Store With AWS Elastic Container Storage

Many EC2 instance types come with instance attached storage (Instance Store) which can provide a fast local storage that is faster than using an EBS volume. If your using the Amazon ECS-optimized AMI (Amazon Linux 1), it’s instance storage is a secondary EBS volume that is used for storing docker containers and volumes. If your launching it on an EC2 with instance store, it is ignored and only the one EBS volume is used. So here is a simplistic cloud-init script that detects the attached SSD and NVMe SSD’s and adds them to the LVM volume group.
Note: I have not done thorough performance testing but have noticed a slight increase in IO times when configured this way on the newer generation (i.e. c5d, r5d etc) types.Just launch your EC2 instance with the following user data or download the script from this gist if you’ve got a more complex init script already.EC2 User Data#cloud-boothook set -ex # find ephemeral devices using the metadata service # note: this will block loading until t…