-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI flag for docker create(run) to change block device size. #19367
CLI flag for docker create(run) to change block device size. #19367
Conversation
Now that daemon option (--storage-opt dm.basesize) has been introduced upstream, I would like to rekindle the discussion on introducing CLI flag (e.g. --storage-opt size:30G) for docker create/run which would allow a user to set containers rootfs size at creation time (provided it is greater than the base device size) There were two major problems with the existing implementation (daemon option):
If I create a new container on any of the existing images (fedora, ubuntu) the rootfs size of those containers would still be 10G as they are snapshots of the existing image block device and not the basedevice which we just expanded. I feel this would be a little confusing to the user as he might be expecting the new size to show up. To make it work, I would need to remove my existing images (possibly containers associated with it) and repull them in order for my new containers rootfs to be of new base device size (dm.basesize=30G)
This solution gives more flexibility and solves these problems. Shishir |
16e6c20
to
2808fff
Compare
ping @calavera @rhvgoyal @tiborvass Can we atleast start the design discussions ? Shishir |
5650290
to
4c2efec
Compare
4c2efec
to
841fec4
Compare
@calavera @rhvgoyal @tiborvass Shishir |
8b690f2
to
bb686db
Compare
Please fix test failures. |
bb686db
to
d51e5d3
Compare
@anusha-ragunathan Fixed. Please check now. Shishir |
d51e5d3
to
13489ef
Compare
10581ff
to
0144a96
Compare
@shishir-a412ed it should be there (see 928ea1e) |
0651e54
to
7521e1c
Compare
@thaJeztah Please check now. |
Thanks @shishir-a412ed, LGTM |
fdf91e4
to
59f002e
Compare
janky hitting #21408 (not related) |
59f002e
to
9abddb1
Compare
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
9abddb1
to
b16decf
Compare
@thaJeztah any updates on this one ? |
oh! I think it needs one more LGTM for the documentation ping @vdemeester @MHBauer ptal |
LGTM 🐮 |
@@ -60,6 +60,27 @@ func (s *DockerSuite) TestCreateArgs(c *check.C) { | |||
|
|||
} | |||
|
|||
// Make sure we can grow the container's rootfs at creation time. | |||
func (s *DockerSuite) TestCreateGrowRootfs(c *check.C) { | |||
testRequires(c, Devicemapper) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something missing? I can not find any code about Devicemapper
testRequirement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…ock device size Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
|
||
$ 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thaJeztah @SvenDowideit it should be noted that htis is devicemapper specific. The flag is not, but the value is. Followup pr someone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tiborvass what are you looking for ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do all storage drivers have a size
option ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tiborvass I think this would be easier to discuss on irc. We can discuss this on Monday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about on docker build ? can we somehow get it to create the new images with a larger base size? |
@DrewRay Please see discussions going on at #22701 With this patch, I can create/run a container with a size bigger than base device size. However there were certain limitations.
Upvote on the Issue #22701, If you feel this is a useful feature. Shishir |
CloudRAN need this. cherry-pick from moby#19367 Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com> Signed-off-by: Lei Jitang <leijitang@huawei.com>
CLI flag for docker create(run) to change block device size CloudRAN need this. cherry-pick from moby#19367 Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com> Signed-off-by: Lei Jitang <leijitang@huawei.com> See merge request docker/docker!245
Signed-off-by: Shishir Mahajan shishir.mahajan@redhat.com