Add disk quota support for btrfs

Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
This commit is contained in:
Zhu Guihua 2016-03-24 09:14:38 +08:00 committed by Tibor Vass
parent fe09131526
commit f440f14613
4 changed files with 34 additions and 7 deletions

View File

@ -185,8 +185,10 @@ Linux kernel as of [3.18.0](https://lkml.org/lkml/2014/10/26/137). Call
### Storage driver options ### Storage driver options
Particular storage-driver can be configured with options specified with Particular storage-driver can be configured with options specified with
`--storage-opt` flags. Options for `devicemapper` are prefixed with `dm` and `--storage-opt` flags. Options for `devicemapper` are prefixed with `dm`,
options for `zfs` start with `zfs`. options for `zfs` start with `zfs` and options for `btrfs` start with `btrfs`.
#### Devicemapper options
* `dm.thinpooldev` * `dm.thinpooldev`
@ -470,7 +472,7 @@ options for `zfs` start with `zfs`.
$ dockerd --storage-opt dm.min_free_space=10% $ dockerd --storage-opt dm.min_free_space=10%
``` ```
Currently supported options of `zfs`: #### ZFS options
* `zfs.fsname` * `zfs.fsname`
@ -482,6 +484,18 @@ Currently supported options of `zfs`:
$ dockerd -s zfs --storage-opt zfs.fsname=zroot/docker $ dockerd -s zfs --storage-opt zfs.fsname=zroot/docker
#### Btrfs options
* `btrfs.min_space`
Specifies the mininum size to use when creating the subvolume which is used
for containers. If user uses disk quota for btrfs when creating or running
a container with **--storage-opt size** option, docker should ensure the
**size** cannot be smaller than **btrfs.min_space**.
Example use:
$ docker daemon -s btrfs --storage-opt btrfs.min_space=10G
## Docker runtime execution options ## Docker runtime execution options
The Docker daemon relies on a The Docker daemon relies on a

View File

@ -333,6 +333,7 @@ unit, `b` is used. Set LIMIT to `-1` to enable unlimited swap.
$ docker create -it --storage-opt size=120G fedora /bin/bash $ docker create -it --storage-opt size=120G fedora /bin/bash
This (size) will allow to set the container rootfs size to 120G at creation time. User cannot pass a size less than the Default BaseFS Size. This (size) will allow to set the container rootfs size to 120G at creation time. User cannot pass a size less than the Default BaseFS Size.
This option is only available for the `devicemapper`, `btrfs` and `zfs` graphrivers.
**--stop-signal**=*SIGTERM* **--stop-signal**=*SIGTERM*
Signal to stop a container. Default is SIGTERM. Signal to stop a container. Default is SIGTERM.

View File

@ -484,6 +484,7 @@ its root filesystem mounted as read only prohibiting any writes.
$ docker run -it --storage-opt size=120G fedora /bin/bash $ docker run -it --storage-opt size=120G fedora /bin/bash
This (size) will allow to set the container rootfs size to 120G at creation time. User cannot pass a size less than the Default BaseFS Size. This (size) will allow to set the container rootfs size to 120G at creation time. User cannot pass a size less than the Default BaseFS Size.
This option is only available for the `devicemapper`, `btrfs` and `zfs` graphrivers.
**--stop-signal**=*SIGTERM* **--stop-signal**=*SIGTERM*
Signal to stop a container. Default is SIGTERM. Signal to stop a container. Default is SIGTERM.

View File

@ -247,9 +247,9 @@ backends use operating system level technologies and can be
configured. configured.
Specify options to the storage backend with **--storage-opt** flags. The Specify options to the storage backend with **--storage-opt** flags. The
backends that currently take options are *devicemapper* and *zfs*. backends that currently take options are *devicemapper*, *zfs* and *btrfs*.
Options for *devicemapper* are prefixed with *dm* and options for *zfs* Options for *devicemapper* are prefixed with *dm*, options for *zfs*
start with *zfs*. start with *zfs* and options for *btrfs* start with *btrfs*.
Specifically for devicemapper, the default is a "loopback" model which Specifically for devicemapper, the default is a "loopback" model which
requires no pre-configuration, but is extremely inefficient. Do not requires no pre-configuration, but is extremely inefficient. Do not
@ -511,6 +511,17 @@ By default docker will pick up the zfs filesystem where docker graph
Example use: `dockerd -s zfs --storage-opt zfs.fsname=zroot/docker` Example use: `dockerd -s zfs --storage-opt zfs.fsname=zroot/docker`
## Btrfs options
#### btrfs.min_space
Specifies the mininum size to use when creating the subvolume which is used
for containers. If user uses disk quota for btrfs when creating or running
a container with **--storage-opt size** option, docker should ensure the
**size** cannot be smaller than **btrfs.min_space**.
Example use: `docker daemon -s btrfs --storage-opt btrfs.min_space=10G`
# CLUSTER STORE OPTIONS # CLUSTER STORE OPTIONS
The daemon uses libkv to advertise The daemon uses libkv to advertise