I'm trying to use ElasticBeanstalk for an app with some big initial space requirements. It exceeds the default 8GB capacity of the EBS disk on the EC2 instances.
I tried to increase the disk capacity by using a bigger EC2 instance type. For instance, I used an m3.large, which AWS tells me should provide me with 1x32GB of storage.
However, when the Beanstalk environment launches, it still only shows 8GB. I tried to run the "resize2fs" command on the instance, but it didn't expand the volume to anything over 8GB.
Does anyone know how to get bigger instance storage on ElasticBeanstalk environments?
To avoid No space left on device errors when expanding the root partition or root file system on your EBS volume, use the temporary file system, tmpfs, that resides in memory. Mount the tmpfs file system under the /tmp mount point, and then expand your root partition or root file system.
To attach an EBS volume to an instance using the console Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . In the navigation pane, choose Elastic Block Store, Volumes. Select an available volume and choose Actions, Attach Volume. For Instance, start typing the name or ID of the instance.
When you create a web server environment, AWS Elastic Beanstalk creates one or more Amazon Elastic Compute Cloud (Amazon EC2) virtual machines, known as Instances. The instances in your environment are configured to run web apps on the platform that you choose.
AWS Elastic Beanstalk now supports Capacity Rebalancing for Amazon EC2 Auto Scaling groups (ASG). This feature reduces Spot Instance interruptions to customers’ applications. When enabled, ASG Capacity Rebalancing is designed to automatically attempt to replace Spot Instances in an Auto Scaling group before they are interrupted.
To configure a running environment’s Amazon EC2 instances in the Elastic Beanstalk console Open the Elastic Beanstalk console , and in the Regions list, select your AWS Region. In the navigation pane, choose Environments, and then choose the name of your environment from the list.
I'm using ElasticBeanstalk for an app, it has some big initial space requirements. It exceeds the default 8GB capacity of the EBS disk on the EC2 instances.
Example of solution for Elastic Beanstalk with ebextensions config:
application-root-dir/.ebextensions/001-filesystem.config:
option_settings:
aws:autoscaling:launchconfiguration:
RootVolumeType: gp2
RootVolumeSize: "64"
There is a better way to do this now using RootVolumeType and RootVolumeSize in aws:autoscaling:launchconfiguration. Details are [here].1
Following is the relevant section from my cloudformation script to create elastic beanstalk
{
"Namespace": "aws:autoscaling:launchconfiguration",
"OptionName": "RootVolumeType",
"Value": "gp2"
},
{
"Namespace": "aws:autoscaling:launchconfiguration",
"OptionName": "RootVolumeSize",
"Value": 25
},
This can be easily achieved through ebextensions also.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With