2

I have done configuration of devicemapper as described here.
I created thinpool, profile, and other related stuff.
/etc/docker/daemon.json:

{
    "storage-driver": "devicemapper",
    "storage-opts": [
        "dm.thinpooldev=/dev/mapper/userspace-thinpool",
        "dm.use_deferred_removal=true",
        "dm.use_deferred_deletion=true",
        "dm.basesize=1G",
        "dm.fs=ext4",
        "dm.libdm_log_level=6",
        "dm.min_free_space=10%"
    ]
}

/etc/lvm/profile/docker-thinpool.profile:

activation {
    thin_pool_autoextend_threshold=50
    thin_pool_autoextend_percent=25
}

$ lvs -o+seg_monitor userspace/thinpool

File descriptor 8 (pipe:[2545597]) leaked on lvs invocation. Parent PID 5123: bash
  LV       VG        Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Monitor  
  thinpool userspace twi-aot--- 150.00g             2.86   0.23                             monitored

$ docker info

Containers: 8
 Running: 7
 Paused: 0
 Stopped: 1
Images: 26
Server Version: 17.12.0-ce
Storage Driver: devicemapper
 Pool Name: userspace-thinpool
 Pool Blocksize: 524.3kB
 Base Device Size: 1.074GB
 Backing Filesystem: ext4
 Udev Sync Supported: true
 Data Space Used: 4.614GB
 Data Space Total: 161.1GB
 Data Space Available: 156.4GB
 Metadata Space Used: 2.433MB
 Metadata Space Total: 1.074GB
 Metadata Space Available: 1.071GB
 Thin Pool Minimum Free Space: 16.11GB
 Deferred Removal Enabled: true
 Deferred Deletion Enabled: true
 Deferred Deleted Device Count: 0
 Library Version: 1.02.110 (2015-10-30)
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: 89623f28b87a6004d4b785663257362d1658a729
runc version: b2567b37d7b75eb4cf325b77297b140ea686ce8f
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-112-generic
Operating System: Linux Mint 18.1
OSType: linux
Architecture: x86_64

So when I run new container and use all space (/ in a container) nothing happens. What I expect: size of root file system in the container automatically extended by 25%.
How I tested it:

docker run --rm -it alpine
cat /dev/urandom >> /1.spam.bin
  cat: write error: No space left on device
df -h /

and some combinations of it.
Please let me know if I misunderstood official guide. Also, I read this

Monitor the thin pool
Do not rely on LVM auto-extension alone. The volume group automatically extends, but the volume can still fill up.

Grigory
  • 411
  • 3
  • 10
  • 1
    Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Feb 05 '18 at 21:28

0 Answers0