Provide capability to specify Minimum data volume size
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.
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.
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.
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?
I just want to catch the time that if an admin set it up to run, we don't failover back to loopback.
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?
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.
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
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.
We need to bring more folks into this discussion.
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.
Ok, I opended issue #62 to discuss this issue.
@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.
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.
Right, we will open this for discussion when we get to the Next docker-1.8 release.
@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.