Bug 1315956 - The automatic docker volume provisioning cannot be prevented
The automatic docker volume provisioning cannot be prevented
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Storage (Show other bugs)
3.x
Unspecified Unspecified
medium Severity high
: ---
: ---
Assigned To: Matthew Heon
Jianwei Hou
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-09 01:40 EST by Wenqi He
Modified: 2016-05-12 13:10 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-12 13:10:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Wenqi He 2016-03-09 01:40:53 EST
Description of problem:
To create a new Mongodb app which has the VOLUME directive but the pod spec does not include any corresponding volume, Docker will provision volume directories automatically within /var/lib/docker/volumes.  

Version-Release number of selected component (if applicable):
openshift v1.1.3-536-gda71953
kubernetes v1.2.0-alpha.7-703-gbc4550d
etcd 2.2.5

How reproducible:
Always

Steps to Reproduce:
1.Has the environment properly configured in AWS(devenv-rhel7_3655)
2.Create a project 
oc new-project projectname
3.Create a new Mongodb app with the template http://pastebin.test.redhat.com/355069 which has no "volumeMounts"
oc new-app --file=(template in pastebin)
4. Check the mongodb pod status
oc get pods
5. Check the directory /var/lib/docker/volumes/ to verify whether Docker provision volume directories automatically
ls /var/lib/docker/volumes/


Actual results:
The mongodb pod running well and there is a new directory under /var/lib/docker/volumes/ which is created for Mongodb automatically by docker

Expected results:
The mongodb pod should fail to start with the preventing of create directory under /var/lib/docker/volumes/ 

Additional info:
Comment 1 Matthew Heon 2016-03-16 13:11:16 EDT
I'm almost certain this is the result of the immutable bit not being set on the /var/lib/docker/volumes directory. I requested that Ops modify the deployment scripts for Online nodes to include the appropriate chattr command to accomplish this. I can think of several reasons why the command would be failing:

- The command never made it into the deployment scripts. Entirely possible I contacted the wrong person when I requested it be added.

- The command is placed incorrectly in the deployment script. The /var/lib/docker/volumes directory must exist in order for the command to work - therefore, it has to be run after Docker is started for the first time, or the directory needs to be manually created prior to running it

- The deployment scripts for release and QE differ, and the changes aren't in the QE scripts. I'm not at all familiar with the way that Online AWS deployments happen, so I can't rule this out.

I'm contacting Ops to look into getting this fixed.
Comment 2 Wenqi He 2016-03-18 03:46:41 EDT
This issue is fixed on below version:
kubernetes v1.2.0-alpha.7-703-gbc4550d
Docker 1.8.2-el7, build a01dc02/1.8.2
kernel 3.10.0-327.10.1.el7.x86_64
https://console.dev-preview-int.openshift.com/console/

But still repro on origin(devenv-rhel7_3734):
openshift v1.1.4-16-gb5da002
kubernetes v1.2.0-origin-41-g91d3e75
etcd 2.2.5
Comment 3 Abhishek Gupta 2016-03-21 03:11:11 EDT
The configuration to set the immutable bit on the /var/lib/docker/volumes directory is only applied to the dev-preview-int custer. You should not expect it to be applied on a regular origin devenv.

Marking this bug ON_QA based on comment above that this issue is now resolved in Dev Preview INT.
Comment 4 Wenqi He 2016-03-22 22:17:43 EDT
This issue is fixed on dev-preview-int, change the status to verified.

Note You need to log in before you can comment on or make changes to this bug.