LCTL-NODEMAP_FILESET_ADD(8)

NAME
lctl-nodemap_fileset_add - add a fileset to a nodemap

SYNOPSIS
lctl nodemap_fileset_add or
lctl nodemap fileset_add [--alt] [--ro] --name NODEMAP_NAME --fileset SUBDIRECTORY

DESCRIPTION
nodemap_fileset_add adds a fileset with a SUBDIRECTORY path to a nodemap, specified by its NODEMAP_NAME. The SUBDIRECTORY must begin with a slash ('/') and represents a relative path from the root of the Lustre file system.

Filesets can be used to provide namespace isolation within the Lustre file system by explicitly restricting clients of a nodemap to a specific SUBDIRECTORY when mounting the client. The restriction depends on whether the fileset is designated as primary or alternate (using the --alt option). Further, the fileset can be restricted to be mounted as read-only using the --ro option. Note that the nodemap 'readonly_mount' property takes precedence if a fileset is set to read-write which is the fileset default. On mounting the Lustre client the following rules apply:

1.  If the nodemap is inactive or no filesets are defined, no subdirectory restrictions are applied.

2.  If the primary fileset is set and no subdirectory is presented when mounting the Lustre client, the primary fileset's SUBDIRECTORY is used as the file system root.

3.  If any defined fileset (primary or alternate) matches the presented mounted subdirectory exactly or as a prefix, the subdirectory mount is used as the file system root.

4.  If fileset matches in 3, the presented mounting subdirectory is appended to the primary fileset. Note, if the resulting subdirectory is matched by any other (alternate) fileset that has the read-only flag set, read-only is enforced for this mounting subdirectory.

If no primary fileset is set, only 3 applies.

OPTIONS

-n, --name NODEMAP_NAME
    The name of the nodemap that this fileset should be associated with.

-f, --fileset SUBDIRECTORY
    The fileset to restrict the clients to. The fileset must begin with '/'.

-a, --alt
    Indicates that this fileset should be added as an alternate fileset. Without this option, the fileset is added as the primary fileset. A nodemap is restricted to a single primary fileset while up to 255 alternate filesets can be added per nodemap. Duplicate fileset definitions across fileset types are not allowed.

-r, --ro
    Indicates that the fileset should be mounted as read-only (defaults to read-write if not set).

EXAMPLES
Add a primary fileset to nodemap 'tenant1':
    # lctl nodemap_fileset_add --name tenant1 --fileset '/dir0'
    # lctl nodemap_fileset_add --name tenant1 --fileset '/dir1' --ro

Add alternate filesets to different nodemaps:
    # lctl nodemap_fileset_add --name tenant1 --fileset '/dir2' --alt
    # lctl nodemap_fileset_add --name tenant1 --fileset '/dir3' --alt
    # lctl nodemap_fileset_add --name tenant2 --fileset '/dir10' --alt
    # lctl nodemap_fileset_add --name tenant2 --fileset '/dir11' --alt --ro

AVAILABILITY
lctl nodemap_fileset_add is part of the lustre(7) filesystem package since release 2.17.0.

SEE ALSO
lustre(7), lctl-nodemap-fileset-del(8), lctl-nodemap-fileset-modify(8), lctl-nodemap-new(8),