My EC2 instance in Amazon ECS has run out of space with an error message similar to the following in the /var/log/messages log file:

Mar 18 16:29:36 ip-10-10-10-10 lvm[2016]: Insufficient free space: 1120 extents needed, but only 19 available

By default, the Amazon ECS Agent on the container instance cleans up stopped containers in a task.

The default interval for this cleanup is 3 hours, but this can be controlled using the following agent parameter in the /etc/ecs/ecs.config file:


Note: Any value shorter than 1 minute is ignored. For more information, see Available Parameters.

With the release of ECS container agent version 1.13.0, Docker images and stopped tasks are cleaned up automatically with the following variable:


Note: If you set this variable to true, automated image cleanup is disabled on your container instance, and no images are automatically removed.

If you are not on ECS agent version 1.13.0 or greater, you must upgrade to use the automatic image removal feature; see Updating the Amazon ECS Container Agent. The ECS container agent configuration variables can be configured to tune your automated task and image cleanup experience; see Tunable Parameters.

Amazon EC2 Container Service, ECS container agent, Docker

Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2016-11-02