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?
The 8 GB disk you are seeing is an EBS root volume mounted on /. That's the same no matter what instance type you use, which is why it still only shows 8GB. The 32GB of storage is ephemeral storage attached to the instance (not EBS). It's possible that it's not mounting automatically but it's certainly there.
Two options for you -
You can try to get that 32GB ephemeral storage mounted - here are a
few links on that topic:
http://www.hudku.com/blog/mounting-instance-storage-customizing/
http://www.hudku.com/blog/configuration-setup-customizing-aws-elastic-beanstalk/
You can create and mount a separate EBS volume of whatever size you
need:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-volume.html
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html
Either way you will need to make whatever changes are required to point to this new storage, where ever you mount it in the filesystem. That can be by changing your configurations or creating symlinks from the old location to the new filesystem.
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.