{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/21946","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/21946/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/21946/comments","events_url":"https://api.github.com/repos/docker/docker/issues/21946/events","html_url":"https://github.com/docker/docker/pull/21946","id":147561058,"number":21946,"title":"Add support for setting storage size on ZFS containers","user":{"login":"chosenken","id":91260,"avatar_url":"https://avatars.githubusercontent.com/u/91260?v=3","gravatar_id":"","url":"https://api.github.com/users/chosenken","html_url":"https://github.com/chosenken","followers_url":"https://api.github.com/users/chosenken/followers","following_url":"https://api.github.com/users/chosenken/following{/other_user}","gists_url":"https://api.github.com/users/chosenken/gists{/gist_id}","starred_url":"https://api.github.com/users/chosenken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chosenken/subscriptions","organizations_url":"https://api.github.com/users/chosenken/orgs","repos_url":"https://api.github.com/users/chosenken/repos","events_url":"https://api.github.com/users/chosenken/events{/privacy}","received_events_url":"https://api.github.com/users/chosenken/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/status/2-code-review","name":"status/2-code-review","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-04-11T21:29:47Z","updated_at":"2016-05-05T15:11:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/21946","html_url":"https://github.com/docker/docker/pull/21946","diff_url":"https://github.com/docker/docker/pull/21946.diff","patch_url":"https://github.com/docker/docker/pull/21946.patch"},"body":"**- What I did**\r\nAdded support for for the `--storage-opt` CLI flag to ZFS.  Users can specify a container's block device size by passing size (`--storage-opt size=2G`).  Built off of pull request https://github.com/docker/docker/pull/19367\r\n\r\n**- How I did it**\r\nWhen creating or cloning a ZFS volume, check storage options for the key `size`.  If it is provided, set the ZFS property `quota` to the given value on the new ZFS filesystem.  If size is not specified, do not set `quota`.\r\n\r\n**- How to verify it**\r\nHave docker engine setup with ZFS as the storage driver.  Pull an image and run it with the `--storage-opts size=<size>` flag.  Run `df -h` to view attached volumes sizes.  The `Avail` space on the root device should be the size specified.\r\n\r\n```\r\nroot@dockerzfs:~# docker run -it --rm --storage-opt size=2G ubuntu bash\r\nroot@217c5a71c117:/# df -h\r\nFilesystem                                                                            Size  Used Avail Use% Mounted on\r\nzpool-docker/docker/a9897bab72a60873898191704eb0dfff96aa4efdb0a2676d9e8a74ad20b265a7  2.2G  198M  2.0G   9% /\r\ntmpfs                                                                                1001M     0 1001M   0% /dev\r\ntmpfs                                                                                1001M     0 1001M   0% /sys/fs/cgroup\r\nzpool-docker/docker                                                                    48G  3.2M   48G   1% /etc/hosts\r\nshm                                                                                    64M     0   64M   0% /dev/shm\r\n```\r\n\r\nNote:  Due to the way docker utilizes ZFS, the newly created ZFS volume will be from a read-only snapshot of the docker image.  Therefore setting the `quota` on the new volume will make the available space the size of the quota as it is applied to the new volume and not parent volumes.\r\n\r\n**- A picture of a cute animal**\r\n![Westies at the Cincinnati Reds Parade](http://i.imgur.com/yVKcATw.jpg)\r\n\r\nThis is my first pull request to Docker, and I welcome all comments and suggestions!\r\n\r\nSigned-off-by: Ken Herner <kherner@progress.com>"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/217181091","html_url":"https://github.com/docker/docker/pull/21946#issuecomment-217181091","issue_url":"https://api.github.com/repos/docker/docker/issues/21946","id":217181091,"user":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"created_at":"2016-05-05T15:11:58Z","updated_at":"2016-05-05T15:11:58Z","body":"ping @chosenken could you address my comment? Also don't forget to update the relevant documentation and man-pages, but let me know if you need hints for which ones need an update"}}