Bug 1462275

Summary: PVs are dynamically provisioned with incorrect/inaccurate AccessModes
Product: OpenShift Container Platform Reporter: Matthew Wong <mawong>
Component: StorageAssignee: Matthew Wong <mawong>
Status: CLOSED ERRATA QA Contact: Chao Yang <chaoyang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.5.1CC: aos-bugs, bchilds, eparis, jhou, smunilla
Target Milestone: ---Keywords: NeedsTestCase
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: the AccessModes field of a PVC is ignored when a PV is dynamically provisioned for it Consequence: users receive a PV with inaccurate AccessModes, e.g. a RWM PV that can technically only be used RWO Fix: fail to dynamically provision a PV when the volume plugin cannot support the requested AccessModes Result: user never receives a PV with inaccurate AccessModes
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-10 05:28:09 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:
Embargoed:

Description Matthew Wong 2017-06-16 15:07:46 UTC
Description of problem: PVs are dynamically provisioned with incorrect/inaccurate AccessModes

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

How reproducible: Always

Steps to Reproduce:
1. Create a PVC asking for RWM AccessModes from a provisioner that can only do RWO (e.g. AWS EBS)
2. PV is created with RWM AccessModes
3. PV can't be used as RWM because it's an AWS EBS disk.

Actual results:
PV is created with incorrect AccessModes

Expected results:
PV is not created with incorrect AccessModes, provisioning should fail

Comment 1 Matthew Wong 2017-06-16 15:08:34 UTC
https://github.com/openshift/origin/pull/14705

Comment 3 Chao Yang 2017-06-29 06:30:54 UTC
This is passed on 
oc v3.6.126.1
kubernetes v1.6.1+5115d708d7
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://ip-172-18-4-64.ec2.internal:8443
openshift v3.6.126.1
kubernetes v1.6.1+5115d708d7


[root@ip-172-18-4-64 ~]# oc get pvc
NAME      STATUS    VOLUME    CAPACITY   ACCESSMODES   STORAGECLASS   AGE
ebsc      Pending                                      gp2            3s
[root@ip-172-18-4-64 ~]# oc describe pvc ebsc
Name:		ebsc
Namespace:	default
StorageClass:	gp2
Status:		Pending
Volume:		
Labels:		<none>
Annotations:	volume.beta.kubernetes.io/storage-provisioner=kubernetes.io/aws-ebs
Capacity:	
Access Modes:	
Events:
  FirstSeen	LastSeen	Count	From				SubObjectPath	Type		Reason			Message
  ---------	--------	-----	----				-------------	--------	------			-------
  11s		7s		2	persistentvolume-controller			Warning		ProvisioningFailed	Failed to provision volume with StorageClass "gp2": invalid AccessModes [ReadWriteMany]: only AccessModes [ReadWriteOnce] are supported

[root@ip-172-18-4-64 ~]# oc get pvc
NAME      STATUS    VOLUME    CAPACITY   ACCESSMODES   STORAGECLASS   AGE
ebsc      Pending                                      gp2            6m
ebsc1     Pending                                      gp2            4s
[root@ip-172-18-4-64 ~]# oc describe pvc ebsc1
Name:		ebsc1
Namespace:	default
StorageClass:	gp2
Status:		Pending
Volume:		
Labels:		<none>
Annotations:	volume.beta.kubernetes.io/storage-provisioner=kubernetes.io/aws-ebs
Capacity:	
Access Modes:	
Events:
  FirstSeen	LastSeen	Count	From				SubObjectPath	Type		Reason			Message
  ---------	--------	-----	----				-------------	--------	------			-------
  9s		9s		1	persistentvolume-controller			Warning		ProvisioningFailed	Failed to provision volume with StorageClass "gp2": invalid AccessModes [ReadOnlyMany]: only AccessModes [ReadWriteOnce] are supported

Comment 5 errata-xmlrpc 2017-08-10 05:28:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:1716