docker-latest-storage-setup (1) - Linux Manuals

docker-latest-storage-setup: Grows the root filesystem and sets up storage for docker-latest.


docker-latest-storage-setup - Grows the root filesystem and sets up storage for docker-latest.


docker-latest-storage-setup [OPTIONS]


  Print usage statement

  Reset your docker-latest storage to init state. Reset does not try to remove volume groups or try to remove any of the disks added previously.
   Note: The --reset command is not sufficient to cleanup your docker-latest environment. This option is used by other tools. (atomic storage reset)


Run docker-latest-storage-setup after setting up your configuration in /etc/sysconfig/docker-latest-storage-setup. One can look at /usr/lib/docker-latest-storage-setup/docker-latest-storage-setup for various options and their default settings. Anything user wants to change, should be changed in /etc/sysconfig/docker-latest-storage-setup. This is the file which will override any settings specified in /usr/lib/docker-latest-storage-setup/docker-latest-storage-setup.

lvm2 version should be same or higher than lvm2-2.02.112 for lvm thin pool functionality to work properly.

Supported options for the configuration file:

Specify a storage driver to be used with docker-latest. Default
driver is "devicemapper". Other valid values are overlay,
overlay2 and "". Empty string tells docker-latest-storage-setup to
not do any storage setup.

A set of extra options that should be passed to the Docker

DEVS: A quoted, space-separated list of devices to be used.
If a drive is partitioned and contains a ${dev}1 partition,
that partition will be configured for use. Unpartitioned
drives will be partitioned and configured for use. If "VG"
is not specified, then use of the root disk's extra space
is implied.

VG: The volume group to use for docker-latest storage. Defaults to the
volume group where the root filesystem resides.  If VG is
specified and the volume group does not exist, it will be
created (which requires that "DEVS" be nonempty, since we don't
currently support putting a second partition on the root disk).

lvm2 version should be same or higher than lvm2-2.02.112 for lvm
thin pool functionality to work properly.

One can use this option to enable/disable growing of partition
table backing root volume group. This is intended for
virtualization and cloud installations. By default it is
disabled. Use GROWPART=true to enable automatic partition
table resizing.

Enable automatic extension of pool by lvm. lvm can monitor
the pool and automatically extend it when pool is getting full.

Determines the pool extension threshold in terms of percentage
of pool size. For example, if threshold is 60, that means when
pool is 60% full, threshold has been hit.

Determines the amount by which pool needs to be grown. This is
specified in terms of of pool size. So a value of 20 means
that when threshold is hit, pool will be grown by 20% of existing
pool size.

Controls the chunk size/block size of thin pool. Value of CHUNK_SIZE
be suitable to be passed to --chunk-size option of lvconvert.

     Specifies a device wait timeout value in seconds. In
     certain cases required devices might not be immediately
     available and docker-latest-storage-setup might decide to wait for
     it. This timeout specifies how long one should wait for the
     device. Default is 60 seconds. One can disable the wait by
     specifying a value of 0.

Wipe any signatures found on disk. Valid values are
true/false and default value is false. By default if any
signatures are found on disk operation is aborted. If this value
is set to true, then signatures will either be wiped or
overwritten as suitable. This also means that if there is any
data on disk, it will be lost.

By default no new volume and filesystem will be setup
for docker-latest root dir. Docker creates /var/lib/docker-latest/ on
top of underlying filesystem for storing images and containers.

To carve out a separate logical volume for storing docker-latest
images/containers/volumes data, set DOCKER_ROOT_VOLUME=yes
NOTE: devicemapper stores images/containers on thin pool.

docker-latest-storage-setup creates a logical volume with an XFS
filesystem mounted on docker-latest root directory
(default: /var/lib/docker-latest).

Specify the desired size for docker-latest root volume. It defaults
to 40% of all free space.

DOCKER_ROOT_VOLUME_SIZE can take values acceptable to
"lvcreate -L" as well as some values acceptable to to 
"lvcreate -l". If user intends to pass values acceptable 
to "lvcreate -l", then only those values which contains "%" 
in syntax are acceptable.  If value does not contain "%" it 
is assumed value is suitable for "lvcreate -L".

NOTE: If both STORAGE_DRIVER=devicemapper and 
DOCKER_ROOT_VOLUME=yes is set, docker-latest-storage-setup would set
up the thin pool for devicemapper first, followed by docker-latest 
root volume. e.g if free space in the volume group is 10G, 
devicemapper thin pool size would be 4G (40% of 10G) and docker-latest
root volume would be 2.4G (40% of 6G).

The options below should be specified as values acceptable to 'lvextend -L':

ROOT_SIZE: The size to which the root filesystem should be grown.

DATA_SIZE: The desired size for the docker-latest data LV. Defaults to using
     40% free space in the VG after the root LV and docker-latest
     metadata LV have been allocated/grown.

     DATA_SIZE can take values acceptable to "lvcreate -L" as
     well as some values acceptable to "lvcreate -l". If user
     intends to pass values acceptable to "lvcreate -l", then
     only those values which contains "%" in syntax are
     acceptable.  If value does not contain "%" it is assumed
     value is suitable for "lvcreate -L".

     Specifies the minimum size of the data volume. If sufficient
     free space is not available, the pool creation will fail.

     Value should be a number followed by a optional suffix.
     "bBsSkKmMgGtTpPeE" are valid suffixes. If no suffix is
     specified then value will be considered as megabyte unit.

     Both upper and lower case suffix represent same unit of
     size. Use suffix B for Bytes, S for sectors as 512 bytes, K
     for kibibytes (1024 bytes), M for mebibytes
     (1024 kibibytes), G for gibibytes, T for tebibytes, P for
     pebibytes and E for exbibytes.


A simple, sample /etc/sysconfig/docker-latest-storage-setup:




November 2014, originally compiled by Joe Brockmeier <jzb [at]> based on comments in Andy Grimm's <agrimm [at]> script.


Joe Brockmeier Andy Grimm