Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Elastic Beanstalk - Increase Instance Disk Capacity

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?

like image 912
dsw88 Avatar asked Jun 30 '14 23:06

dsw88


People also ask

How do I increase the size of my EBS volume if I receive an error that there's no space left on my file system?

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.

How do I add an EBS volume to an EC2 instance?

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.

What are AWS Elastic Beanstalk instances?

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.

What is capacity rebalancing in AWS Elastic Beanstalk?

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.

How do I configure an Amazon EC2 instance in Elastic Beanstalk?

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.

How much space does elasticbeanstalk take up on EBS?

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.


2 Answers

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"
like image 72
smentek Avatar answered Nov 12 '22 18:11

smentek


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.

like image 33
Andy P Avatar answered Nov 12 '22 18:11

Andy P