2

How do I expand the root partition of all containers of a certain task definition by default? If it expands all containers in an instance or cluster (including the ECS Agent), that's still fine.

After reading https://docs.aws.amazon.com/AmazonECS/latest/developerguide/bootstrap_container_instance.html, I tried adding #cloud-boothook cloud-init-per once docker_options echo 'OPTIONS="${OPTIONS} --storage-opt dm.basesize=25G"' >> /etc/sysconfig/docker to the autoscaling group's advanced details, but to no avail.

I also tried (with no success) all of the following (in the same place):

sed -i '/^EXTRA_DOCKER_STORAGE_OPTIONS/s/"$/ --storage-opt dm.basesize=25G"/' /etc/sysconfig/docker-storage-setup

sed -i '/^DOCKER_STORAGE_OPTIONS/s/"$/ --storage-opt dm.basesize=25G"/' /etc/sysconfig/docker-storage

and sed -i '/^OPTIONS/s/"$/ --storage-opt dm.basesize=25G"/' /etc/sysconfig/docker

None of them worked.

I tried updating the ECS-Agent from 1.18 to 1.23. These solutions failed on both versions.

docker info output:

Containers: 2 Running: 2 Paused: 0 Stopped: 0 Images: 3 Server Version: 18.06.1-ce Storage Driver: devicemapper Pool Name: docker-docker--pool Pool Blocksize: 524.3kB Base Device Size: 10.74GB Backing Filesystem: ext4 Udev Sync Supported: true Data Space Used: 4.298GB Data Space Total: 106.1GB Data Space Available: 101.8GB Metadata Space Used: 708.6kB Metadata Space Total: 109.1MB Metadata Space Available: 108.3MB Thin Pool Minimum Free Space: 10.61GB Deferred Removal Enabled: true Deferred Deletion Enabled: true Deferred Deleted Device Count: 0 Library Version: 1.02.135-RHEL7 (2016-11-16) Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e runc version: 69663f0bd4b60df09991c08812a60108003fa340 init version: fec3683 Security Options: seccomp Profile: default Kernel Version: 4.14.67-66.56.amzn1.x86_64 Operating System: Amazon Linux AMI 2018.03 OSType: linux Architecture: x86_64 CPUs: 2 Total Memory: 7.503GiB Name: ip-172-30-1-205 ID: YY74:M3ZE:4J6G:W5TW:HI2U:GIWX:3ZJ7:LAM5:K5T3:MHVN:7T3Z:LGQP Docker Root Dir: /var/lib/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false

Uberhumus
  • 921
  • 1
  • 13
  • 24

1 Answers1

0

Turns out I was close with some of the previous attempts:

I made the mistake of not adding the #cloud-boothook line above #! /bin/bash.

And then I just added the sed -i '/^OPTIONS/s/"$/ --storage-opt dm.basesize=25G"/' /etc/sysconfig/docker line after cloud-init-per once docker_options

So eventually it looked like:

#cloud-boothook

#! /bin/bash

cloud-init-per once docker_options sed -i '/^OPTIONS/s/"$/ --storage-opt dm.basesize=25G"/' /etc/sysconfig/docker

And that worked.

Uberhumus
  • 921
  • 1
  • 13
  • 24