Skip to content

dynfsal

Philippe DENIEL edited this page Oct 30, 2012 · 2 revisions

Table of Contents

Using the "Dynamic FSAL" feature for using more than one FSAL in a single NFS-Ganesha instance?

The "dynamic FSAL" feature allows you to compile NFS-Ganesha with no internal FSAL. The FSAL will be loaded at runtime, using the dlopen API. This makes it possible to load several FSALs in a single NFS-Ganesha daemon. The type of FSAL to be used for a given export entry will then become a characteristic of the export entry.

Compiling a FSAL to be used as a shaed object

Compiling NFS-Ganesha with no FSAL is very easy. You just have to specify "DYNFSAL" as the FSAL to be use. This is a fake name in the configure.ac that indicates that no FSAL is to be compiled and linked. To configure and compile, proceed this way

# ./configure --with-fsal=DYNFSAL
# make
# make install

You'll get a dynfsal.ganesha.nfsd that you'll be using later.

Compiling NFS-GANESHA with no FSAL

Compiling NFS-Ganesha with FSAL set to be shared object is done like this (in this example, XFS is used, but other FSALs may work as well)

# ./configure --with-fsal=XFS --enable-buildsharedfsal 
# make 
# make install

You'll find the shared objects under src/FSAL/FSAL_<name></name>/.libs . Note that a nfsd will ne generated in the src/MainNFSD directory, and it will be dynamically linked with the FSAL shared object. If you are generating rpm files, you will get an additionnal rpm package with the FSAL object in it. File will have a name matching nfs-ganesha-fsal-*.rpm .

Using FSAL per export entry in a dynamic way

Once you both have the dynfsal.ganesha.nfsd and the FSAL shared object, you just need to configure NFS-Ganesha properly. First thing to do is setting the paths to load the FSALs. Path are by the FSAL_Shared_Library parameter in block NFS_Core_param. The value is formatted this way : "FSAL name:FSAL Path". FSAL name is one of the following string: GPFS, HPSS, LUSTRE, POSIX, PROXY, SNMP, VFS, XFS, ZFS, CEPH.

For example, if you want to use FSAL_PROXY, FSAL_XFS, FSAL_VFS and FSAL_ZFS, you'll be using something like this:

  FSAL_Shared_Library &#61; &quot;PROXY&#58;/usr/lib/libfsalproxy.so.1.1.0&quot; &#59;
  FSAL_Shared_Library &#61; &quot;ZFS&#58;/usr/lib/libfsalzfs.so.1.1.0&quot; &#59;
  FSAL_Shared_Library &#61; &quot;XFS&#58;/usr/lib/libfsalxfs.so.1.1.0&quot; &#59;
  FSAL_Shared_Library &#61; &quot;VFS&#58;/usr/lib/libfsalvfs.so.1.1.0&quot; &#59;

 ( ... )
&#125;

The next step is to indicate, for each export entry, the FSAL to be used. This is done in the 'Export' block by setting parameter 'FSALID' which expects its value to be a valid FSAL name. This parameter is mandatory when using dynamic FSALs.

Example with xfs:

  &#35; Export Id (mandatory)
  Export_Id &#61; 77 &#59;

  &#35; Exported path (mandatory)
  Path &#61; &quot;/xfs&quot; &#59;

  Root_Access &#61; &quot;localhost&quot; &#59;

  Access &#61; &quot;&#42;&quot;&#59;

  &#35; Pseudo path for NFSv4 export (mandatory)
  Pseudo &#61; &quot;/xfs&quot;&#59;


  Access_Type &#61; RW&#59;


  &#35; This sets the filesystem id for the entries of this export.
  Filesystem_id &#61; 192.168 &#59;


  &#35; Export entry file system dependant options.
  &#35; NOTHING for POSIX FS
  FS_Specific &#61; &quot;/xfs&quot; &#59;

  &#35; Export entry &quot;tag&quot; name
  &#35; Can be used as an alternative way of addressing the
  &#35; export entry at mount time ( alternate to the &#39;Path&#39;)
  Tag &#61; &quot;xfs&quot; &#59;

  FSALID &#61; &quot;XFS&quot; &#59;
&#125;