Bug 1463120

Summary: 'nfsclient' resource is not inheriting 'mountpoint' attribute from 'fs' resource
Product: Red Hat Enterprise Linux 6 Reporter: Ondrej Faměra <ofamera>
Component: resource-agentsAssignee: Oyvind Albrigtsen <oalbrigt>
Status: CLOSED WONTFIX QA Contact: cluster-qe <cluster-qe>
Severity: high Docs Contact:
Priority: high    
Version: 6.9CC: agk, cfeist, cluster-maint, cww, fdinitto, jruemker, ofamera
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-08 15:18:16 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:
Bug Depends On:    
Bug Blocks: 1374441, 1461138    
Attachments:
Description Flags
patch to nfsclient to allow the proper inheritance of 'mountpoint' attribute into 'path' attribute none

Description Ondrej Faměra 2017-06-20 07:51:07 UTC
Created attachment 1289477 [details]
patch to nfsclient to allow the proper inheritance of 'mountpoint' attribute into 'path' attribute

=== Description of problem:
In documentation below we mention "nfsclient's path is inherited from the mountpoint and the fsid is added to the options string during export"
and following example that works as expected.
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Cluster_Administration/s1-clust-rsc-inherit-resc-reuse-CA.html

  <resources>
    <nfsclient name="bob" target="bob.example.com" options="rw,no_root_squash"/>
    <nfsclient name="jim" target="jim.example.com" options="rw,no_root_squash"/>
    <nfsexport name="exports"/>
  </resources>
  ...
  <fs name="1" mountpoint="/mnt/foo" device="/dev/sdb1" fsid="12344">
    <nfsexport ref="exports"> <!-- nfsexport's path and fsid attributes
                                   are inherited from the mountpoint &
                                   fsid attribute of the parent fs
                                   resource -->
      <nfsclient ref="bob"/> <!-- nfsclient's path is inherited from the
                                  mountpoint and the fsid is added to the
                                  options string during export -->
      <nfsclient ref="jim"/>
    </nfsexport>
  </fs> 

The above seems to suggest that 'nfsclient' inherits "mountpoint as path" from 'fs' resource.
According to resource agents this seems not to be true. The important role there plays
the 'nfsexport' resource which does the inheritance of 'mountpoint' and provides it later as 'path'
to child resources for inheriting.

Based on above documentation the following configuration fails
with '[nfsclient] No export path specified.'

  <resources>
    <nfsclient name="bob" target="bob.example.com" options="rw,no_root_squash"/>
    <nfsclient name="jim" target="jim.example.com" options="rw,no_root_squash"/>
    <nfsexport name="exports"/>
  </resources>
  ...
  <nfsexport ref="exports"> 
    <fs name="1" mountpoint="/mnt/foo" device="/dev/sdb1" fsid="12344">
      <nfsclient ref="bob"/>
      <nfsclient ref="jim"/>
    </fs> 
  </nfsexport>

=== Version-Release number of selected component (if applicable):
resource-agents-3.9.5-46.el6

=== How reproducible:
Always

=== Steps to Reproduce:
1. In rgmanager cluster make the 'nfsclient' to be a direct child of 'fs' resource 
  instead of being a direct child of 'nfsexport' resource. Example below.

  <resources>
    <nfsclient name="jim" target="jim.example.com" options="rw,no_root_squash"/>
    <nfsexport name="exports"/>
  </resources>
  ...
  <nfsexport ref="exports"> 
    <fs name="1" mountpoint="/mnt/foo" device="/dev/sdb1" fsid="12344">
      <nfsclient ref="jim"/>
    </fs> 
  </nfsexport>

2. Try to start the service containing this resource

=== Actual results:
Startup fails with error from nfsclient below:

  [nfsclient] No export path specified.

=== Expected results:
Service with this configuration starts and nfsclient uses the
'path' attribute inherited from fs's 'mountpoint' attribute.

=== Additional info:
Above issue impairs the reuse of resources as inheritance doesn't work and
attributes needs to be specified more than once and also resources cannot be
just referenced so they cannot be reused.

## Workaround:
  <resources>
    <nfsexport name="exports"/>
  </resources>
  ...
  <nfsexport ref="exports"> 
    <fs name="1" mountpoint="/mnt/foo" device="/dev/sdb1" fsid="12344">
      <nfsclient name="jim" target="jim.example.com" options="rw,no_root_squash" path="/mnt/foo"/>
    </fs> 
  </nfsexport>

## Proposed path to fix the behaviour
Attached to this bugzilla is patch against the /usr/share/cluster/nfsclient.sh resource agent that
is inheriting the 'path' from 'mountpoint' in case it is not inherited or specified manually.

Comment 9 Chris Feist 2017-11-08 15:18:16 UTC
Red Hat Enterprise Linux 6 is in the Production 3 Phase. During the Production
3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent
Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:

http://redhat.com/rhel/lifecycle

This issue does not meet the inclusion criteria for the Production 3 Phase and
will be marked as CLOSED/WONTFIX. If this remains a critical requirement,
please contact Red Hat Customer Support to request a re-evaluation of the
issue, citing a clear business justification. Note that a strong business
justification will be required for re-evaluation. Red Hat Customer Support can
be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com/