Bug 1813927

Summary: StorageClass mount options not being honored
Product: OpenShift Container Platform Reporter: Luke Stanton <lstanton>
Component: StorageAssignee: Jan Safranek <jsafrane>
Status: CLOSED ERRATA QA Contact: Wei Duan <wduan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.11.0CC: aos-bugs, jsafrane, piqin
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: OpenShift iSCSI and FibreChannel volume plugin did not honor mountOptions field in PersistentVolumes nor StorageClasses. Consequence: iSCSI and FibreChannel volumes were mounted without these options. Fix: The volume plugins now properly check mountOptions field in PersistentVolumes and StorageClasses. Result: The volumes are mounted with given mountOptions.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-13 17:20:18 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 Luke Stanton 2020-03-16 14:04:29 UTC
Description of problem:

Mounts created for iscsi PV's using a StorageClass with the 'discard' mount option (-o discard) are missing the setting. PV's that are created with the StorageClass include the defined mount option and are bound successfully. However, when the PV is mounted on the OpenShift node as defined by the pod spec referencing the PVC/PV, the mount options are not applied during the container creation process.

The pod shows a running status and the mount is seen and can be consumed, however it is missing the desired mount option.


How reproducible: Consistently


Actual results: 'discard' mount option is not applied to actual mount


Expected results: 'discard' option would be applied to mount

Comment 4 Jan Safranek 2020-03-17 09:15:39 UTC
Tested with v3.11.188.

iscsi.MountDevice calls:

mount -t ext4 -o defaults /dev/disk/by-path/ip-10.0.148.103:3260-iscsi-iqn.2003-01.io.k8s:jsafrane-lun-0 /var/lib/origin/openshift.local.volumes/plugins/kubernetes.io/iscsi/iface-default/10.0.148.103:3260-iqn.2003-01.io.k8s:jsafrane-lun-0

(no "-o discard" !)

iscsi.SetUp calls:
mount -o bind /var/lib/origin/openshift.local.volumes/plugins/kubernetes.io/iscsi/iface-default/10.0.148.103:3260-iqn.2003-01.io.k8s:
jsafrane-lun-0 /var/lib/origin/openshift.local.volumes/pods/3e486339-682e-11ea-8b24-fa163e4e2fdb/volumes/kubernetes.io~iscsi/nfs-pv

mount -o bind,remount,discard /var/lib/origin/openshift.local.volumes/plugins/kubernetes.io/iscsi/iface-default/10.0.148.103:3260-iqn
.2003-01.io.k8s:jsafrane-lun-0 /var/lib/origin/openshift.local.volumes/pods/3e486339-682e-11ea-8b24-fa163e4e2fdb/volumes/kubernetes.io~iscsi/nfs-pv

It's too late to add "discard" (or any other real option) at this point.

Comment 15 errata-xmlrpc 2020-07-13 17:20:18 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/RHBA-2020:2409