Creating NFS exports

Prerequisites

To create NFS exports

Admin panel

  1. Create the root export:
    1. On the Storage services > NFS > Shares screen, click the number in the Exports column in the row of the desired share. This will open the share screen.
    2. On the share screen, click Add export, specify root as the export name and / as path and select the Read and write access mode.

      Do not use other names or paths for the root export.

      This will create a directory with a default path that designates the export location inside the share. This path is automatically generated based on the share name and used (alongside the share’s IP address) to mount the export.

      Do not give the users access to the root export.

      The root export will be shown in the export list.

  2. Mount the root export, as described in the Storage User’s Guide.

    Do not mount NFS shares on cluster nodes. It may lead to node freeze.

  3. Create user exports in the mounted root export:
    1. In the mounted root export, create a subdirectory for a user export, for example, export1.
    2. On the share screen, click Add export, enter a user export name, specify /export1 as path, and select the access mode.
    3. Click Done.

    The user export will appear in the export list.

Command-line interface

  1. Create the root export. For example, for the share share1, run:

    # vinfra service nfs export create share1 root --path / --access-type rw --security-types none
  2. Mount the root export, as described in the Storage User’s Guide.

    Do not mount NFS shares on cluster nodes. It may lead to node freeze.

  3. Create user exports in the mounted root export by using the following command:

    vinfra service nfs export create --path <path> --access-type <access-type> --security-types <security-types>
                                     [--client <address=ip_addresses:access=access_type:security=security_types>]
                                     [--squash <squash>] [--anonymous-gid <anonymous-gid>] [--anonymous-uid <anonymous-uid>]
                                     <share-name> <export-name>
    --path <path>
    Path to the NFS export
    --access-type <access-type>
    Type of access to the NFS export (none, rw, or ro)
    --security-types <security-types>
    Types of NFS export security (none, sys, krb5, krb5i, or krb5p)
    --client <address=ip_addresses:access=access_type:security=security_types>
    Client access list of the NFS export
    --squash <squash>
    NFS export squash (root_squash, root_id_squash, all_squash, or none)
    --anonymous-gid <anonymous-gid>
    Anonymous GID of the NFS export
    --anonymous-uid <anonymous-uid>
    Anonymous UID of the NFS export
    <share-name>
    NFS share name
    <export-name>
    NFS export name

    For example, to create the user export export1 at /export1, run:

    # vinfra service nfs export create share1 export1 --path /export1 --access-type rw --security-types none

The created NFS exports will appear in the vinfra service nfs export list output:

# vinfra service nfs export list --share-name share1
+---------+-----------------+-------------+
| name    | path            | access_type |
+---------+-----------------+-------------+
| export1 | /share1/export1 | rw          |
| root    | /share1         | rw          |
+---------+-----------------+-------------+