By using AWS re:Post, you agree to the AWS re:Post Terms of Use

How do I increase the available disk space on my Amazon ECS container instances if I launched my container instances as standalone Amazon EC2 instances?

3 minute read
0

I want to increase the available disk space on my Amazon Elastic Container Service (Amazon ECS) container instances. I launched my container instances as standalone Amazon Elastic Compute Cloud (Amazon EC2) instances.

Short description

To increase the storage space on your container instances, you must launch replacement instances and then terminate your original instances. If you used a different method to launch your container instances, then complete the steps in either of the following articles:

Note: Your Amazon Elastic Block Store (Amazon EBS) volume configuration varies depending on the Amazon ECS optimized Amazon Machine Image (AMI) that you use. For more information, see Amazon ECS optimized AMI.

Resolution

Launch replacement instances

Important: To avoid downtime for your Amazon ECS services, launch replacement instances before you drain your original container instances. After all the tasks stop on the original container instances, confirm that the tasks on the replacement instances have started. Then, terminate the original container instances.

To launch replacement instances, complete the following steps:

  1. Open the Amazon EC2 console.
  2. From the navigation pane, choose Instances.
  3. In the Instance ID column for each of your original ECS container instances, note the instance ID.
  4. Select one of your original container instances.
  5. Choose Actions, choose Image and templates, and then choose Launch more like this.
    Note: The Launch more like this option pre-populates the Launch an instance window with the options from your original container instances. You can then update the configuration to increase the EBS volume or any other configuration updates.
  6. Choose Configure storage.
  7. For Size (GiB), enter a value to increase the size of your volume.
    Note: For more information on volume options, see Block device mappings.
  8. (Optional) To update the AMI ID to the latest Amazon ECS optimized AMI, choose 1. Choose AMI, and then enter the AMI ID for your AWS Region.
  9. Choose Launch.

Drain the previous ECS container instances to migrate containers to new instances

  1. Open the Amazon ECS console.
  2. Choose the cluster in which your container instance is grouped.
  3. Choose the Infrastructure tab, and then select the original container instances by the instance IDs that you noted earlier.
  4. Choose Actions, and then choose Drain instances.
    Note: You can drain the previous instances in batches to avoid downtime for your Amazon ECS services. When you drain service tasks for container instances, container instances in the RUNNING state are stopped and replaced. The container instances are replaced according to the service's deployment configuration parameters, minimumHealthyPercent and maximumPercent. Any PENDING or RUNNING tasks that don't belong to the service aren't affected. You must wait for these tasks to finish or manually stop them.
  5. When the DRAINING instances have 0 running tasks, repeat steps 2-3 until all of the original container instances are in DRAINING status.
  6. Terminate the original instances.

Related information

Configure storage

Draining Amazon ECS container instances

Storage options for your Amazon ECS tasks

AWS OFFICIAL
AWS OFFICIALUpdated 7 months ago