kadalu / moana

Moana is a frontend for the Kadalu Storage / GlusterFS. Moana provides tools for setting up and managing the Kadalu Storage / Gluster pools.
GNU General Public License v3.0
18 stars 7 forks source link

nfs-Ganesha integration #65

Open aravindavk opened 3 years ago

aravindavk commented 3 years ago
# Export a Volume
kadalu nfs-ganesha export <mgr-url:port>:/<pool>/<volume>

# Unexport a Volume
kadalu nfs-ganesha unexport <mgr-url:port>:/<pool>/<volume>

# List Local exports
kadalu nfs-ganesha list-local
aravindavk commented 2 years ago

@amarts, @sac the issue is available for nfs-ganesha export. Any suggestions to make export and unexport command to look like local command. That is, it exports the Volume from the current node where we run the command.

aravindavk commented 2 years ago

With this https://github.com/gluster/glusterfs/pull/3745 enhancement in Gluster. Vol file server is available with every Storage Unit processes. No changes required from Kadalu Storage to export with NFS Ganesha. We need to package nfs-ganesha + gluster integration as nfs-ganesha-kadalu package to avoid mixing with Gluster versions.

vatsa287 commented 2 years ago

@aravindavk @amarts

Intial Observations on nfs-ganesha + moana

https://github.com/gluster/glusterfs/blob/devel/api/src/glfs-mgmt.c#L363

    /* Need to fetch volume_uuid */
    glfs_get_volume_info(fs);
[2022-11-24 06:18:51.043320 +0000] E [MSGID: 104066] [glfs-mgmt.c:275:mgmt_get_volinfo_cbk] 0-gfapi: GET_VOLUME_INFO RPC call is not successful [{errno=22}, {error=Invalid argument}] 
[2022-11-24 06:18:51.043336 +0000] E [MSGID: 104015] [glfs-mgmt.c:340:mgmt_get_volinfo_cbk] 0-gfapi: In GET_VOLUME_INFO cbk, received error [{error=Invalid argument}, {errno=22}, {error=Invalid argument}] 
[2022-11-24 06:18:51.043350 +0000] E [MSGID: 104016] [glfs-mgmt.c:385:pub_glfs_get_volumeid] 0-gfapi: Unable to fetch volume UUID [{errno=22}, {error=Invalid argument}] 

nfs-ganesha setup

aravindavk commented 2 years ago

The client volfile in /var/lib/kadalu/volfiles/client-dev-vol1.vol need to be renamed to .vol during storage_unit init at https://github.com/kadalu/moana/blob/main/mgr/src/server/plugins/volume_utils.cr#L287 & in accessing these volfiles in mount_script.cr at https://github.com/kadalu/moana/blob/main/mgr/src/cmds/mount_script.cr#L181

Fix this issue for 1.0 release itself since changing this lator may need extra effort to handle in backward compatible way.

nfs-ganesha has a reliance on glusterd for getting volume uuid by one of the gf-api. So this is a blocker which restarts the nfs-ganesha process after remote volume is found.

@amarts is it possible to add volume-id in the generated Client Volfile and change gfapi to use that to get Volume ID. If not exists in Volfile then call the existing method so that it will be backward compatible.

amarts commented 2 years ago

Should be possible to add volume-id in client volfile.

aravindavk commented 1 year ago

NFS Ganesha integration worked! Little changes to the nfs-ganesha build steps(GLUSTER_PREFIX) if glusterfs is installed as source installation(github.com/kadalu/glusterfs kadalu_1 branch)

cmake -DUSE_FSAL_GLUSTER=ON -DGLUSTER_PREFIX=/usr/local ../src/

One more dependency required was rpcbind

aravindavk commented 1 year ago

CLIs:

kadalu nfs enable <pool>/<volume> [--nodes=node1,node2]
kadalu nfs disable <pool>/<volume> [--nodes=node1,node2]

Above commands enable or disable the NFS Ganesha exports in any of the managed nodes. If --nodes not given then creates the NFS ganesha export files from all the Volume nodes.

Note: Do not start/restart nfs-ganesha service, only handle export and unexport of volumes.

Another option to enable the NFS export locally (Outside the Storage cluster).

kadalu nfs enable/disable <mgr-url:port>:/<pool>/<volume> --local

To enable:

To disable:

aravindavk commented 1 year ago

Ref: Gluster Hook script that enables the NFS ganesha service

https://github.com/gluster/glusterfs/blob/1d534b57d279a59b8bded3a5fe57801c20a3e32c/extras/hook-scripts/start/post/S31ganesha-start.sh