Bug 1322006

Summary: [RFE] Support to prevent from using same pvc by multiple pods accidentally
Product: OpenShift Container Platform Reporter: Kenjiro Nakayama <knakayam>
Component: RFEAssignee: Bradley Childs <bchilds>
Status: CLOSED NOTABUG QA Contact: Johnny Liu <jialiu>
Severity: medium Docs Contact:
Priority: high    
Version: 3.1.0CC: agoldste, aos-bugs, erich, jkrieger, jokerman, mmccomas, swatt
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: 2017-02-15 22:55:32 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:

Description Kenjiro Nakayama 2016-03-29 14:35:04 UTC
1. Proposed title of this feature request

[RFE] Support to prevent from using same pvc by multiple pods accidentally

3. What is the nature and description of the request?

- There are no way to restrict to be used pvc which is "in use" by other pods in same namespace(project)

4. Why does the customer need this? (List the business requirements here)
5. How would the customer like to achieve this? (List the functional requirements here)

Steps to Reproduce:
step-1. Create pvc

  $ oc get pvc
  NAME      LABELS    STATUS    VOLUME    CAPACITY   ACCESSMODES   AGE
  claim1    <none>    Bound     pv0001    1Gi        RWO           13s

step-2. Create pod(nfs-test) and use above pvc(claim1).

  $ oc describe pod nfs-test |grep -1 claim1
      Type:	PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
      ClaimName:	claim1
      ReadOnly:	false

step-3. Create another pod(nfs-test2) and use same pvc(claim1).

  $ oc describe pod nfs-test2 |grep -1 claim1
      Type:	PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
      ClaimName:	claim1
      ReadOnly:	false

- It is possible to use the pvc "in-use" by other pods.
- We want some options to prevent from using in-use pvc by other pods.


7. Is there already an existing RFE upstream or in Red Hat Bugzilla?

- No, as far as I searched.

Comment 2 Kenjiro Nakayama 2016-03-29 15:04:50 UTC
I think we should some way to see if pvc has already been in-use or not.

Comment 5 Steve Watt 2016-07-19 01:18:01 UTC
I think this issue is that you have specified a Shared File System as READWRITEONCE(RWO). That is really a READWRITEMANY accessmode. ReadWriteOnce devices (Block Devices - such as ISCSI, AWS EBS, or Ceph RBD) have their own locking mechanisms to prevent simultaneous access to the storage resource from more than one host.

NFS is designed to be used by more than one host. I think you can get around this issue by verifying that the AccessMode of all of your PVs are correctly specified.