From 20bcf49fb63858c3a532c22dc667b5c1f2015cc8 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Thu, 16 Feb 2017 15:33:03 -0500 Subject: [PATCH] Add option to auto-configure blkdev for devmapper Instead of forcing users to manually configure a block device to use with devmapper, this gives the user the option to let the devmapper driver configure a device for them. Adds several new options to the devmapper storage-opts: - dm.directlvm_device="" - path to the block device to configure for direct-lvm - dm.thinp_percent=95 - sets the percentage of space to use for storage from the passed in block device - dm.thinp_metapercent=1 - sets the percentage of space to for metadata storage from the passed in block device - dm.thinp_autoextend_threshold=80 - sets the threshold for when `lvm` should automatically extend the thin pool as a percentage of the total storage space - dm.thinp_autoextend_percent=20 - sets the percentage to increase the thin pool by when an autoextend is triggered. Defaults are taken from [here](https://docs.docker.com/engine/userguide/storagedriver/device-mapper-driver/#/configure-direct-lvm-mode-for-production) The only option that is required is `dm.directlvm_device` for docker to set everything up. Changes to these settings are not currently supported and will error out. Future work could support allowing changes to these values. Signed-off-by: Brian Goff --- docs/reference/commandline/dockerd.md | 54 +++++++++++++++++++++++++++ man/dockerd.8.md | 48 ++++++++++++++++++++++++ 2 files changed, 102 insertions(+) diff --git a/docs/reference/commandline/dockerd.md b/docs/reference/commandline/dockerd.md index 22cda151f3..5f28f6f21c 100644 --- a/docs/reference/commandline/dockerd.md +++ b/docs/reference/commandline/dockerd.md @@ -343,6 +343,60 @@ not use loopback in production. Ensure your Engine daemon has a $ sudo dockerd --storage-opt dm.thinpooldev=/dev/mapper/thin-pool ``` +##### `dm.directlvm_device` + +As an alternative to providing a thin pool as above, Docker can setup a block +device for you. + +###### Example: + +```bash +$ sudo dockerd --storage-opt dm.directlvm_device=/dev/xvdf +``` + +##### `dm.thinp_percent` + +Sets the percentage of passed in block device to use for storage. + +###### Example: + +```bash +$ sudo dockerd --storage-opt dm.thinp_percent=95 +``` + +##### `dm.thinp_metapercent` + +Sets the percentage of the passed in block device to use for metadata storage. + +###### Example: + +```bash +$ sudo dockerd --storage-opt dm.thinp_metapercent=1 +``` + +##### `dm.thinp_autoextend_threshold` + +Sets the value of the percentage of space used before `lvm` attempts to +autoextend the available space [100 = disabled] + +###### Example: + +```bash +$ sudo dockerd --storage-opt dm.thinp_autoextend_threshold=80 +``` + +##### `dm.thinp_autoextend_percent` + +Sets the value percentage value to increase the thin pool by when when `lvm` +attempts to autoextend the available space [100 = disabled] + +###### Example: + +```bash +$ sudo dockerd --storage-opt dm.thinp_autoextend_percent=20 +``` + + ##### `dm.basesize` Specifies the size to use when creating the base device, which limits the diff --git a/man/dockerd.8.md b/man/dockerd.8.md index 228a887e15..6a12d3f165 100644 --- a/man/dockerd.8.md +++ b/man/dockerd.8.md @@ -420,6 +420,54 @@ Example use: $ dockerd \ --storage-opt dm.thinpooldev=/dev/mapper/thin-pool +#### dm.directlvm_device + +As an alternative to manually creating a thin pool as above, Docker can +automatically configure a block device for you. + +Example use: + + $ dockerd \ + --storage-opt dm.directlvm_device=/dev/xvdf + +##### dm.thinp_percent + +Sets the percentage of passed in block device to use for storage. + +###### Example: + + $ sudo dockerd \ + --storage-opt dm.thinp_percent=95 + +##### `dm.thinp_metapercent` + +Sets the percentage of the passed in block device to use for metadata storage. + +###### Example: + + $ sudo dockerd \ + --storage-opt dm.thinp_metapercent=1 + +##### dm.thinp_autoextend_threshold + +Sets the value of the percentage of space used before `lvm` attempts to +autoextend the available space [100 = disabled] + +###### Example: + + $ sudo dockerd \ + --storage-opt dm.thinp_autoextend_threshold=80 + +##### dm.thinp_autoextend_percent + +Sets the value percentage value to increase the thin pool by when when `lvm` +attempts to autoextend the available space [100 = disabled] + +###### Example: + + $ sudo dockerd \ + --storage-opt dm.thinp_autoextend_percent=20 + #### dm.basesize Specifies the size to use when creating the base device, which limits