Skip to main content

Creating a NAS Share

Creating a share requires a Network Attached Server (NAS). Note:

  • The volume that you want to share must have a filesystem.
  • A volume cannot have two different shares on the same path.

Any directory path of a volume can be shared through the Network File System (NFS) protocol or Server Message Block (SMB) protocol. To share a volume directory path, use the command:

applications shares add --application=<app_inst> --volume=<vol_name> --share=<name> (--smb | --nfs) [-- path=<path>] [--browsable] [--allowedsubnets=<subnets>] [--readonlyaccess]

Command options

  • --application=<app_inst>: The application containing the volume. Replace <app_inst> with the name of the application.
  • --volume=<vol_name>: The volume to which you want to add the share. Replace <vol_name> with the name of the volume.
  • --share=<name>: The share name. Replace <name> with a name of your choice. For SMB, you can access the share at \\<floating_ip_or_dns>\<share_name>. For NFS, the share is exported at <floating_ip_or_dns>:/shares/<share_name>.
  • --smb or --nfs: Use the Server Message Block (SMB) or Network File System (NFS) protocol, respectively, to share the directory path.
  • --path=<path>: The directory path (in the volume) you want to share. If you do not specify a path, the root directory of the volume is shared.
  • --browsable: Enables directory browsing. Relevant only when using the SMB protocol. Allows clients to browse the share directory path.
  • --allowedsubnets=<subnets>: Limits access to only specified IP addresses. Replace <subnet> with a list of IP/mask addresses separated by semi-colon. For example, to allow access to the share from IP addresses 192.168.20.x and IP addresses 10.1.x.x, set --allowedsubnets 192.168.20.0/255.255.255.0;10.1.0.0/255.25.0.0. This parameter is optional. If the list is empty or contains a wildcard, any IP can access the shared directory path.
  • --readonlyaccess Creates the share as read-only. If this option is not specified, all clients will have read and write permissions.

Examples

  • To add an SMB share netStar with the following parameters

    • Application instance: sales
    • Volume name: interSales
    • Path on volume: \usr\intS
    • Browsable
    applications shares add --application sales --volume interSales --share netStar --smb --path \usr\intS --browsable
    
  • To add an NFS share named results_ro with the following parameters

    • Application instance: research
    • Volume name: figures
    • Path on volume: /home/R-team/Documents/results
    • Only IP addresses 10.0.0.x and 192.168.x.x allowed. (where x can be any number between 1-254).
    • Clients granted read-only permission.
    applications shares add --application research --volume figures --share results_ro --nfs --path /home/R-team/Documents/results --allowsubnets 10.0.0.0/255.255.255.0;192.168.0.0/255.255.0.0