Making bulk changes to NFS exports

The mmnfs export load command can be used to make bulk changes to existing NFS Exports as an alternative to using the mmnfs export change command.

Since the existing command to change an NFS export, mmnfs export change, will require a few seconds runtime for every invocation of the command, an alternate method is provided to facilitate bulk changes to the NFS configuration. This procedure can be used, for example, to quickly and easily add additional NFS clients to an export, or to change NFS export attributes, on a per client basis, for any existing NFS client definition.

CAUTION:
Start of changeIf you reuse existing export IDs for a different path, restart the server so that changes are recognized correctly. The mmnfs export load <NFS_exports_config_file> command reloads CES NFS.End of change

Existing NFS export

If there is at least one existing NFS export, use the following procedure to make changes to an NFS exports configuration file:

  1. Check that there is at least one existing NFS export by issue the following command:
    mmnfs export list -Y | grep nfsexports | grep -v HEADER
  2. Check that there is at least one CES node in the cluster:
    mmces node list -Y | grep -v HEADER
  3. Check that NFS is enabled:
    mmces service list -Y | grep NFS:enabled
  4. Log into a CES node:
    ssh `mmces node list -Y | grep -v HEADER | tail -1 | awk -F':' '{print $8}'
  5. Start NFS (if not already started) on the CES node:
    mmces service start NFS
  6. Copy the existing NFS exports configuration file to /tmp:
    cp -pr /var/mmfs/ces/nfs-config/gpfs.ganesha.exports.conf /tmp/gpfs.ganesha.exports.conf
  7. Make a backup copy of the original NFS exports configuration file:
    cp /tmp/gpfs.ganesha.exports.conf /tmp/gpfs.ganesha.exports.conf.bak
  8. Manually edit /tmp/gpfs.ganesha.exports.conf:
    vim /tmp/gpfs.ganesha.exports.conf
  9. When making changes, observe the following guidelines for attributes and values (subject to change at the discretion of the IBM Storage Scale software development team):
    # EXPORT Only Options (One EXPORT block per Path):
    EXPORT {
    Path="<value>"; # must be unique
    Pseudo="<value>"; # must be unique; usually same as Path
    Tag="<value>"; # must be unique; usually same as Path
    Export_id=<value>; # must be unique
    MaxRead=<value>;
    MaxWrite=<value>;
    PrefRead=<value>;
    PrefWrite=<value>;
    PrefReaddir=<value>;
    MaxOffsetWrite=<value>;
    MaxOffsetRead=<value>;
    Filesystem_id=<value>;
    UseCookieVerifier=<value>;
    Attr_Expiration_Time=<value>;
    Delegations=none;
    ...
    } # encloses EXPORT block containing FSAL and one or more CLIENT blocks
    # EXPORT Option Values:
    ["PATH"]="MANDATORY=yes;TYPE=string;DEFAULT=no_default"
    ["PSEUDO"]="MANDATORY=yes;TYPE=string;DEFAULT=no_default"
    ["TAG"]="MANDATORY=yes;TYPE=string;DEFAULT=no_default"
    ["EXPORT_ID"]="MANDATORY=yes;TYPE=value;MIN=1;MAX=65535;DEFAULT=no_default"
    ["MAXREAD"]="MANDATORY=yes;TYPE=value;MIN=512;MAX=67108864;DEFAULT=1048576"
    ["MAXWRITE"]="MANDATORY=yes;TYPE=value;MIN=512;MAX=67108864;DEFAULT=1048576"
    ["PREFREAD"]="MANDATORY=yes;TYPE=value;MIN=512;MAX=67108864;DEFAULT=1048576"
    ["PREFWRITE"]="MANDATORY=yes;TYPE=value;MIN=512;MAX=67108864;DEFAULT=1048576"
    ["PREFREADDIR"]="MANDATORY=yes;TYPE=value;MIN=512;MAX=67108864;DEFAULT=1048576"
    ["MAXOFFSETREAD"]="MANDATORY=yes;TYPE=value;MIN=512;MAX=18446744073709551615;DEF
    AULT=18446744073709551615"
    ["MAXOFFSETWRITE"]="MANDATORY=yes;TYPE=value;MIN=512;MAX=18446744073709551615;DE
    FAULT=18446744073709551615"
    ["FILESYSTEM_ID"]="MANDATORY=yes;TYPE=value;MIN=0;MAX=18446744073709551615;DEFAU
    LT=666.666"
    ["USECOOKIEVERIFIER"]="MANDATORY=yes;TYPE=bool;DEFAULT=false"
    ["ATTR_EXPIRATION_TIME"]="MANDATORY=yes;TYPE=value;MIN=0;MAX=360;DEFAULT=60"
    # FSAL Only Options (One FSAL block per EXPORT block):
    FSAL {
    Name=GPFS;
    }
    # CLIENT Only Options (One or more CLIENT blocks per EXPORT block):
    CLIENT {
    Clients=<value>;
    Access_Type=<value>;
    Protocols=<value>;
    Transports=<value>;
    Anonymous_uid=<value>;
    Anonymous_gid=<value>;
    SecType=<value>;
    PrivilegedPort=<value>;
    Manage_Gids=<value>;
    Squash=<value>;
    NFS_Commit=<value>;
    Delegations=none;
    }
    # CLIENT Option Values:
    ["CLIENTS"]="MANDATORY=yes;TYPE=string;DEFAULT=*"
    ["ACCESS_TYPE"]="MANDATORY=yes;TYPE=enum;LIST=none,RW,RO,MDONLY,MDONLY_RO;DEFAUL
    T=RO"
    ["PROTOCOLS"]="MANDATORY=yes;TYPE=enum;LIST=3,4,NFS3,NFS4,V3,V4,NFSv3,NFSv4;DEFA
    ULT=3,4"
    ["TRANSPORTS"]="MANDATORY=yes;TYPE=enum;LIST=UDP,TCP;DEFAULT=TCP"
    ["ANONYMOUS_UID"]="MANDATORY=yes;TYPE=value;MIN=-
    2147483648;MAX=4294967295;DEFAULT=-2"
    ["ANONYMOUS_GID"]="MANDATORY=yes;TYPE=value;MIN=-
    2147483648;MAX=4294967295;DEFAULT=-2"
    ["SECTYPE"]="MANDATORY=yes;TYPE=enum;LIST=none,sys,krb5,krb5i,krb5p;DEFAULT=sys"
    ["PRIVILEGEDPORT"]="MANDATORY=yes;TYPE=bool;DEFAULT=false"
    ["MANAGE_GIDS"]="MANDATORY=yes;TYPE=bool;DEFAULT=false"
    ["SQUASH"]="MANDATORY=yes;TYPE=enum;LIST=root,root_squash,rootsquash,all,all_squ
    ash,allsquash,no_root_squash,none,noidsquash;DEFAULT=root_squash"
    ["NFS_COMMIT"]="MANDATORY=yes;TYPE=bool;DEFAULT=false"
  10. Load the changes to the NFS exports config file (this will restart NFS on every CES node on which NFS is currently running):
    mmnfs export load /tmp/gpfs.ganesha.exports.conf
    Note: The mmnfs export load command will conduct a check of the exports configuration file. If the following message is displayed, check the syntax of the NFS exports configuration file, focusing on the changes made in the previous step and try again:
    mmnfs export load. The syntax of the NFS export configuration file to load is not correct:
     /tmp/gpfs.ganesha.exports.conf.
  11. Verify changes to the NFS configuration via the mmnfs export list command:
    mmnfs export list -Y

    If a long listing of all NFS exports is desired, use a keyword with the -n option. For example, with /gpfs as the keyword (/gpfs is the root of each NFS file system in this case):

    [11:00:48] xxxxx:~:% mmnfs export list -Y -n /gpfs
    
    mmcesnfslsexport:nfsexports:HEADER:version:reserved:reserved:Path:Delegations:Cl
    ients:Access_Type:Protocols:Transports:Squash:Anonymous_uid:Anonymous_gid:SecTyp
    e:PrivilegedPort:DefaultDelegations:Manage_Gids:NFS_Commit:
    
    mmcesnfslsexport:nfsexports:0:1:::/gpfs/fs1/fset1:none:10.0.0.1:RO:3,4:TCP:NO_RO
    OT_SQUASH:-2:-2:SYS:FALSE:none:FALSE:FALSE:
    
    mmcesnfslsexport:nfsexports:0:1:::/gpfs/fs1/fset1:none:*:RW:3,4:TCP:ROOT_SQUASH:
    -2:-2:SYS:FALSE:none:FALSE:FALSE:

No existing NFS export

  1. Check that there is not an existing NFS export by issuing the following command:
    mmnfs export list -Y | grep nfsexports | grep -v HEADER
  2. Create NFS exports (adding the first export restarts NFS on every CES node on which NFS is running. Adding more exports does not restart NFS):
    mmnfs export add <export>