Bug 1234873

Summary: glusterfs-resource-agents - volume - voldir is not properly set
Product: [Community] GlusterFS Reporter: Niels de Vos <ndevos>
Component: scriptsAssignee: bugs <bugs>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs, jbelka
Target Milestone: ---Keywords: EasyFix, Patch, Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-v4.1.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-20 17:56:51 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: 1233344    

Description Niels de Vos 2015-06-23 12:22:17 UTC
+++ This bug was initially created as a clone of Bug #1233344 +++

Description of problem:
When creating a resource with the RA 'ocf:glusterfs:volume', it doesn't work as expected because it cannot find required infos.

Version-Release number of selected component (if applicable):
glusterfs-resource-agents-3.7.1-1.el7.noarch.rpm

How reproducible:
Everytime

Steps to Reproduce:
1. Create the resource (all prerequisites are OK, ie: the cluster is operational, the FS has been tested without Pacemaker, the resource glustered is created)
pcs resource create gluster_volume ocf:glusterfs:volume volname='gv0' op monitor interval=60s

2. Try to enable/disable/monitor the resource


Actual results:
# pcs status
...
 Clone Set: gluster_d-clone [gluster_d]
     Started: [ centos71-2 centos71-3 ]
 Clone Set: gluster_volume-clone [gluster_volume]
     gluster_volume     (ocf::glusterfs:volume):        FAILED centos71-3 (unmanaged)
     gluster_volume     (ocf::glusterfs:volume):        FAILED centos71-2 (unmanaged)

Failed actions:
    gluster_volume_stop_0 on centos71-3 'unknown error' (1): call=101, status=Timed Out, exit-reason='none', last-rc-change='Thu Jun 18 15:45:16 2015', queued=1ms, exec=20003ms
    gluster_volume_stop_0 on centos71-3 'unknown error' (1): call=101, status=Timed Out, exit-reason='none', last-rc-change='Thu Jun 18 15:45:16 2015', queued=1ms, exec=20003ms
    gluster_volume_stop_0 on centos71-2 'unknown error' (1): call=104, status=Timed Out, exit-reason='none', last-rc-change='Thu Jun 18 15:44:56 2015', queued=0ms, exec=20002ms
    gluster_volume_stop_0 on centos71-2 'unknown error' (1): call=104, status=Timed Out, exit-reason='none', last-rc-change='Thu Jun 18 15:44:56 2015', queued=0ms, exec=20002ms
...

Expected results:
# pcs status
...
 Clone Set: gluster_d-clone [gluster_d]
     Started: [ centos71-2 centos71-3 ]
 Clone Set: gluster_volume-clone [gluster_volume]
     Started: [ centos71-2 centos71-3 ]
...

Additional info:
I patched it localy in the file : /usr/lib/ocf/resource.d/glusterfs/volume

...
volume_getdir() {
    local voldir
    voldir="/var/lib/glusterd/vols/${OCF_RESKEY_volname}"         <===== new value
#    voldir="/etc/glusterd/vols/${OCF_RESKEY_volname}"            <===== old value

    [ -d ${voldir} ] || return 1

    echo "${voldir}"
    return 0
}
...

Comment 1 Jiri Belka 2018-03-29 16:44:18 UTC
Could you solve this finally please? Why does it take ages to repair one line?

The issue is still present in RHGS:

# rpm -qf /usr/lib/ocf/resource.d/glusterfs/volume
glusterfs-resource-agents-3.8.4-54.3.el7rhgs.noarch

~~~
--- /usr/lib/ocf/resource.d/glusterfs/volume.orig       2018-03-21 08:49:46.000000000 +0100
+++ /usr/lib/ocf/resource.d/glusterfs/volume    2018-03-29 18:36:27.718458622 +0200
@@ -70,7 +70,7 @@ EOF
 
 volume_getdir() {
     local voldir
-    voldir="/etc/glusterd/vols/${OCF_RESKEY_volname}"
+    voldir="/var/lib/glusterd/vols/${OCF_RESKEY_volname}"
 
     [ -d ${voldir} ] || return 1
~~~

Comment 2 Worker Ant 2018-03-29 22:19:30 UTC
REVIEW: https://review.gluster.org/19799 (ocf: use glusterd-workdir for finding volume status files) posted (#1) for review on master by Niels de Vos

Comment 3 Worker Ant 2018-04-02 12:59:43 UTC
COMMIT: https://review.gluster.org/19799 committed in master by "Kaleb KEITHLEY" <kkeithle> with a commit message- ocf: use glusterd-workdir for finding volume status files

The volume status files are located in the glusterd-workdir, not under
/etc (sysconfdir).

BUG: 1234873
Change-Id: Id7f7c83261bb4b5ac2fc104dcd6cb198d6a930aa
Signed-off-by: Niels de Vos <ndevos>

Comment 4 Shyamsundar 2018-06-20 17:56:51 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-v4.1.0, please open a new bug report.

glusterfs-v4.1.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://lists.gluster.org/pipermail/announce/2018-June/000102.html
[2] https://www.gluster.org/pipermail/gluster-users/