Search code examples
amazon-ecs

ECS not starting tasks even though there is enough capacity


I've got a task definition that uses 977MB memory and 1024 CPU, using awsvpc networking: Task definition

And I have EC2 instances provided by an Auto Scaling group tied to a Capacity Provider, already running 4 tasks across 4 instances: ECS Instances

But when I launch 2 new tasks on top the 4 that are already running, they get stuck in "PROVISIONING" state. Despite what looks like enough memory and CPU to run the new tasks.

What could be going wrong and where can I look further to debug this?


Solution

  • I found the answer.

    I was running t3a.small instances, but these have a limit of at most 2 network interfaces including the host. So you can only run one container on them. Limits are documented here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI