container-storage-setup icon indicating copy to clipboard operation
container-storage-setup copied to clipboard

Provide capability to specify Minimum data volume size

Open rhvgoyal opened this issue 10 years ago • 15 comments

Currently our default is to create data volume of size 60%FREE. That is use 60% free space in volume group to create data volume.

But on some systems, there is very small free space available in root volume group (say 128MB) and in that case we end up creating a very small thin pool by default. (say 80MB).

This results in either docker start failure or docker hangs when first image is pulled. So too small a pool out of box is not good.

Provide a knob to specify minimum data volume size and keep the default as 2G. So if minimum required free space is not available, then pool creation will fail and docker will fall back to using loop devices.

rhvgoyal avatar Jul 28 '15 13:07 rhvgoyal

I think it should just fail and not fall back to loop devices, If the user asks for storage we should give them storage or fail.

rhatdan avatar Jul 28 '15 13:07 rhatdan

Well, docker-storage-setup will fail. But current docker is written in such a way that it has Wants= dependency on docker-storage-setup and not Requires= dependency.

We can change that but then on systems like fedora where installer consumes all disk space by default, docker will fail out of box. I think in the past we decided that we don't want it to fail out of box instead want it to use loopback devices and warn user about it so that user can fix the storage part.

rhvgoyal avatar Jul 28 '15 13:07 rhvgoyal

May be we need to convert this into Requires= dependency so that if docker-storage-setup fails, docker fails too.

And provide an option where upon failure, user can edit /etc/sysconfig/docker-storage-setup and be able to start docker using loopback devices.

So out of box docker will fail if enough free space is not available to setup lvm thin pool. But there will be an easy way to override it and let user opt-in for loopback devices.

Will that work?

rhvgoyal avatar Jul 28 '15 13:07 rhvgoyal

I just want to catch the time that if an admin set it up to run, we don't failover back to loopback.

rhatdan avatar Jul 28 '15 13:07 rhatdan

Hmm..., so basically if user decided to override any of the defaults using /etc/sysconfig/docker-storage-setup, we don't want docker to start if docker-storage-setup fails?

Currently atomic specifies GROWPART=yes in /etc/sysconfig/docker-storage-setup. That means atomic's default will be not fallback to loop devices. Is that alright?

rhvgoyal avatar Jul 28 '15 13:07 rhvgoyal

I thought we can't have docker fail out of the box...I thought we specifically did not want to require use of any brain cells.

jeremyeder avatar Jul 28 '15 13:07 jeremyeder

I feel that if we provide user an easy way to opt-in for loop devices (if lvm thin pool setup failed), then it might be ok to fail docker out of box with appropriate error message.

This should not affect atomic product where we will have to make sure that our images have sufficient space free to create lvm thin pool out of box.

For other flavors where installer consumes all the disk, docker will fail out of box and then user can add more disk or opt-in to use loop devices.

I an provide another config option say "STORAGE_DRIVER_MODE=". For device mapper possible values will be "thin-pool" and "loopback". Default will be "thin-pool" and user can override it by

echo STORAGE_DRIVER_MODE="loopback" >> /etc/sysconfig/docker-storage-setup

rhvgoyal avatar Jul 28 '15 14:07 rhvgoyal

How about we add a flag, that states

LOOPBACK_FALLBACK: True

And if user sets this to false, it fails.

I don't want docker to fail out of the box, but I also don't want docker to use loopback when the user does not intend.

rhatdan avatar Jul 28 '15 14:07 rhatdan

We need to bring more folks into this discussion.

jeremyeder avatar Jul 28 '15 14:07 jeremyeder

I think this patch series can go in as it is. What do to when storage-setup fails is a separate discussion and I will open a new issue to track that.

rhvgoyal avatar Jul 28 '15 14:07 rhvgoyal

Ok, I opended issue #62 to discuss this issue.

rhvgoyal avatar Jul 28 '15 14:07 rhvgoyal

@jeremyeder @rhvgoyal and I had a side meeting to discuss this.

I think for docker-1.8 release we might want to make docker require docker-storage-setup So we fail docker out of the box if storage is not setup. BUT we need systemctl status docker to give us enough information to make the admin know he needs to edit /etc/sysconfig/docker-storage-setup file to fix it. Then they could setup loopback or real storage.

The problem with this is handling upgrades. If someone was using docker prior to docker-1.8 on loopback this needs to continue working. We also need the migration script so people can get off of loopback and on to a different back end.

rhatdan avatar Jul 28 '15 15:07 rhatdan

I understand; just want to make sure atomic/openshift guys are ok with this? i did notice that the openshift installer script mentions docker-storage-setup but it is not a hard technical requirement.

jeremyeder avatar Jul 28 '15 15:07 jeremyeder

Right, we will open this for discussion when we get to the Next docker-1.8 release.

rhatdan avatar Jul 28 '15 15:07 rhatdan

@cgwalters

I have pushed patches again after taking care of review comments. I have added libdss.sh now but I have not added any test cases. That can come later.

rhvgoyal avatar Jul 30 '15 19:07 rhvgoyal