X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=LustreProgrammingInterfaces.xml;h=cd3d44b9bd0f72a2e98af608c48a3d334c1ec2d5;hb=a239b0876f76e85a259765f2b47b1ddd588f1bcd;hp=0780e2c12eced15baa5ed5696075062f52faf32d;hpb=0bf7f3688379b38453ea990df0c4e9ae420e49f0;p=doc%2Fmanual.git diff --git a/LustreProgrammingInterfaces.xml b/LustreProgrammingInterfaces.xml index 0780e2c..cd3d44b 100644 --- a/LustreProgrammingInterfaces.xml +++ b/LustreProgrammingInterfaces.xml @@ -1,115 +1,118 @@ - - - Lustre Programming Interfaces - This chapter describes public programming interfaces to control various aspects of Lustre from userspace. These interfaces are generally not guaranteed to remain unchanged over time, although we will make an effort to notify the user community well in advance of major changes. This chapter includes the following section: + + Programming Interfaces + This chapter describes public programming interfaces to that can be + used to control various aspects of a Lustre file system from userspace. + This chapter includes the following sections: - + - + Lustre programming interface man pages are found in the lustre/doc folder. -
- <indexterm><primary>programming</primary><secondary>upcall</secondary></indexterm>User/Group Cache Upcall - This section describes user and group upcall. +
+ <indexterm> + <primary>programming</primary> + <secondary>upcall</secondary> + </indexterm>User/Group Upcall + This section describes the supplementary user/group upcall, which + allows the MDS to retrieve and verify the supplementary groups to which + a particular user is assigned. This avoids the need to pass all the + supplementary groups from the client to the MDS with every RPC. - For information on a universal UID/GID, see . + For information about universal UID/GID requirements in a Lustre + file system environment, see + .
- Name - Use /proc/fs/lustre/mdt/${FSNAME}-MDT{xxxx}/identity_upcall to look up a given user's group membership. + Synopsis + The MDS uses the utility as specified by + lctl get_param mdt.${FSNAME}-MDT{xxxx}.identity_upcall + to look up the supplied UID in order to retrieve the user's supplementary + group membership. The result is temporarily cached in the kernel (for + five minutes, by default) to avoid the overhead of calling into + userspace repeatedly.
Description - The group upcall file contains the path to an executable that, when installed, is invoked to resolve a numeric UID to a group membership list. This utility should complete the mds_grp_downcall_data data structure (see ) and write it to the /proc/fs/lustre/mdt/${FSNAME}-MDT{xxxx}/identity_info pseudo-file. - For a sample upcall program, see lustre/utils/l_getgroups.c in the Lustre source distribution. + The identity_upcall parameter contains the path + to an executable that is run to map a numeric UID to a group membership + list. This upcall executable opens the + mdt.${FSNAME}-MDT{xxxx}.identity_info parameter file + and writes the related identity_downcall_data data + structure (see ). The + upcall is configured with + lctl set_param mdt.${FSNAME}-MDT{xxxx}.identity_upcall. + The default identity upcall program installed is + lustre/utils/l_getidentity.c in the Lustre source + distribution.
Primary and Secondary Groups - The mechanism for the primary/secondary group is as follows: + The mechanism for the primary/secondary group is as follows: + - The MDS issues an upcall (set per MDS) to map the numeric UID to the supplementary group(s). + The MDS issues an upcall (set per MDS) to map the numeric + UID to the supplementary group(s). - If there is no upcall or if there is an upcall and it fails, supplementary groups will be added as supplied by the client (as they are now). + If there is no upcall or if there is an upcall and it fails, + one supplementary group at most will be added as supplied by the + client. - The default upcall is /usr/sbin/l_getidentity, which can interact with the user/group database to obtain UID/GID/suppgid. The user/group database depends on authentication configuration, and can be local /etc/passwd, NIS, LDAP, etc. If necessary, the administrator can use a parse utility to set /proc/fs/lustre/mdt/${FSNAME}-MDT{xxxx}/identity_upcall. If the upcall interface is set to NONE, then upcall is disabled. The MDS uses the UID/GID/suppgid supplied by the client. + The default upcall /usr/sbin/l_getidentity + can interact with the user/group database on the MDS to map the + UID to the GID and supplementary GID. The user/group database + depends on how authentication is configured on the MDS, such as + local /etc/passwd, Network Information Service + (NIS), Lightweight Directory Access Protocol (LDAP), or SMB + Domain services, as configured. If the upcall interface is set + to NONE, then upcall is disabled, and the MDS uses only the UID, + GID, and one supplementary GID supplied by the client. - The default group upcall is set by mkfs.lustre. Use tunefs.lustre --param or echo{path}>/proc/fs/lustre/mds/{mdsname}/group_upcall + The MDS will wait a limited time for the group upcall program + to complete, to avoid MDS threads and clients hanging due to + errors accessing a remote service node. The upcall must finish + within 30s before the MDS will continue without the supplementary + data. The upcall timeout can be set on the MDS using: + lctl set_param mdt.*.identity_acquire_expire=seconds - The Lustre administrator can specify permissions for a specific UID by configuring /etc/lustre/perm.conf on the MDS. As commented in lustre/utils/l_getidentity.c + The default group upcall is set permanently by + mkfs.lustre. To set a custom upcall for a + particular filesystem, use + tunefs.lustre --param or + lctl set_param -P mdt.FSNAME-MDTxxxx.identity_upcall=path - - -/* -* permission file format is like this: -* {nid} {uid} {perms} -* -* '*' nid means any nid -* '*' uid means any uid -* the valid values for perms are: -* setuid/setgid/setgrp/rmtacl -- enable corresponding perm -* nosetuid/nosetgid/nosetgrp/normtacl -- disable corresponding perm -* they can be listed together, seperated by ',', -* when perm and noperm are in the same line (item), noperm is preferential, -* when they are in different lines (items), the latter is preferential, -* '*' nid is as default perm, and is not preferential.*/ - Currently, rmtacl/normtacl can be ignored (part of security functionality), and used for remote clients. The /usr/sbin/l_getidentity utility can parse /etc/lustre/perm.conf to obtain permission mask for specified UID. - - To avoid repeated upcalls, the MDS caches supplemental group information. Use /proc/fs/lustre/mdt/${FSNAME}-MDT{xxxx}/identity_expire to set the cache time (default is 600 seconds). The kernel waits for the upcall to complete (at most, 5 seconds) and takes the "failure" behavior as described. Set the wait time in /proc/fs/lustre/mdt/${FSNAME}-MDT{xxxx}/identity_acquire_expire (default is 15 seconds). Cached entries are flushed by writing to /proc/fs/lustre/mdt/${FSNAME}-MDT{xxxx}/identity_flush. + The group downcall data is cached by the kernel to avoid + repeated upcalls for the same user slowing down the MDS. This + cache is expired from the kernel after 1200s (20 minutes) by + default. The cache age can be set on the MDS using: + lctl set_param mdt.*.identity_expire=seconds
-
- Parameters - - - Name of the MDS service - - - Numeric UID - - -
-
+
Data Structures - struct identity_downcall_data { - __u32 idd_magic; - __u32 idd_err; - __u32 idd_uid; - __u32 idd_gid; - __u32 idd_nperms; - struct perm_downcall_data idd_perms[N_PERMS_MAX]; - __u32 idd_ngroups; - __u32 idd_groups[0]; -}; -
-
-
- <indexterm><primary>programming</primary><secondary>l_getgroups</secondary></indexterm><literal>l_getgroups</literal> Utility - The l_getgroups utility handles Lustre user/group cache upcall. -
- Synopsis - l_getgroups [-v] [-d|mdsname] uid] -l_getgroups [-v] -s -
-
- Description - The group upcall file contains the path to an executable that, when properly installed, is invoked to resolve a numeric UID to a group membership list. This utility should complete the mds_grp_downcall_data data structure (see Data structures) and write it to the /proc/fs/lustre/mds/mds-service/group_info pseudo-file. - l_getgroups is the reference implementation of the user/group cache upcall. -
-
- Files - /proc/fs/lustre/mds/mds-service/group_upcall + struct perm_downcall_data { + __u64 pdd_nid; + __u32 pdd_perm; + __u32 pdd_padding; +}; + +struct identity_downcall_data{ + __u32 idd_magic; + : + :