Bug 1265187

Summary: Same volume mounted to multiple pvc's when pvc's are created through template
Product: OpenShift Container Platform Reporter: Jaspreet Kaur <jkaur>
Component: StorageAssignee: Mark Turansky <mturansk>
Status: CLOSED CURRENTRELEASE QA Contact: Liang Xia <lxia>
Severity: medium Docs Contact:
Priority: high    
Version: 3.0.0CC: aos-bugs, btison, jbride, jkrieger, jliggitt, jokerman, mmccomas, pep
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-23 14:43:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1267746    

Description Jaspreet Kaur 2015-09-22 10:53:23 UTC
Description of problem:

Same volume mounted to multiple pvc's when pvc's are created through template. Also, the volume shows bound to only one claim while the other volume is available.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
 
1. create new project
2. In the project, execute oc new-app -f template.json. Template has section as below :

 "objects": [
        {
            "kind": "PersistentVolumeClaim",
            "apiVersion": "v1",
            "metadata": {
                "name": "aem-author-data-pvc"
            },
            "spec": {
                "accessModes": [
                    "ReadWriteOnce"
                ],
                "resources": {
                    "requests": {
                        "storage": "3Gi"
                    }
                }
            }
        },
        {
            "kind": "PersistentVolumeClaim",
            "apiVersion": "v1",
            "metadata": {
                "name": "aem-author-logs-pvc"
            },
            "spec": {
                "accessModes": [
                    "ReadWriteOnce"
                ],
                "resources": {
                    "requests": {
                        "storage": "3Gi"
                    }
                }
            }
        },

3. Persistent volume claim shows as below :

 [chris@master ~]$ oc get pvc
NAME                  LABELS                                           STATUS    VOLUME
aem-author-data-pvc   map[application:aem-author createdBy:template]   Bound     phpvolume
aem-author-logs-pvc   map[application:aem-author createdBy:template]   Bound     phpvolume


4. Persistent volume shows bound to only one volume claim.

 oc get pv
NAME        LABELS    CAPACITY     ACCESSMODES   STATUS      CLAIM                            REASON
newvolume   <none>    5368709120   RWO           Available                                    
phpvolume   <none>    5368709120   RWO           Bound       persistent/aem-author-data-pvc  



Actual results:

The volume is bound to only one claim while the claim both are bound to same volume

Expected results:

The two pvc's should get bound to different volumes.


Additional info:

Comment 1 Mark Turansky 2015-10-28 15:12:47 UTC
Upstream fix to patch into Origin: https://github.com/kubernetes/kubernetes/pull/16432

Comment 3 Mark Turansky 2015-11-05 14:28:14 UTC
The fix merged into Origin yesterday: https://github.com/openshift/origin/pull/5467

Comment 4 Liang Xia 2015-11-06 04:42:42 UTC
Test scenario:
1. Create a PV, and then 5 PVCs at the same time(via template).
2. Create the PVCs, then create a PV.

Verified that only one PVC bound to the PV.

# openshift version
openshift v3.1.0.0
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4
etcd 2.1.2