Bug 1463120 - 'nfsclient' resource is not inheriting 'mountpoint' attribute from 'fs' resource [NEEDINFO]
'nfsclient' resource is not inheriting 'mountpoint' attribute from 'fs' resource
Status: ASSIGNED
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: resource-agents (Show other bugs)
6.9
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: Oyvind Albrigtsen
cluster-qe@redhat.com
:
Depends On:
Blocks: 1374441 1461138 1493755
  Show dependency treegraph
 
Reported: 2017-06-20 03:51 EDT by Ondrej Faměra
Modified: 2017-10-17 10:00 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
jruemker: needinfo? (ofamera)


Attachments (Terms of Use)
patch to nfsclient to allow the proper inheritance of 'mountpoint' attribute into 'path' attribute (1.18 KB, patch)
2017-06-20 03:51 EDT, Ondrej Faměra
no flags Details | Diff

  None (edit)
Description Ondrej Faměra 2017-06-20 03:51:07 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.