Whamcloud - gitweb
759860f044985f3c06dd5be74e07798600105612
[doc/manual.git] / LustreProgrammingInterfaces.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <article version="5.0" xml:lang="en-US" xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink">
3   <info>
4     <title>Lustre Programming Interfaces</title>
5   </info>
6   <informaltable frame="none">
7     <tgroup cols="2">
8       <colspec colname="c1" colwidth="50*"/>
9       <colspec colname="c2" colwidth="50*"/>
10       
11       
12       <tbody>
13         <row>
14           <entry align="left"><para>Lustre 2.0 Operations Manual</para></entry>
15           <entry align="right" valign="top"><para><link xl:href="index.html"><inlinemediaobject><imageobject role="html">
16                     <imagedata contentdepth="26" contentwidth="30" fileref="./shared/toc01.gif" scalefit="1"/>
17                   </imageobject>
18 <imageobject role="fo">
19                     <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/toc01.gif" scalefit="1" width="100%"/>
20                   </imageobject>
21 </inlinemediaobject></link><link xl:href="UserUtilities_HTML.html"><inlinemediaobject><imageobject role="html">
22                     <imagedata contentdepth="26" contentwidth="30" fileref="./shared/prev01.gif" scalefit="1"/>
23                   </imageobject>
24 <imageobject role="fo">
25                     <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/prev01.gif" scalefit="1" width="100%"/>
26                   </imageobject>
27 </inlinemediaobject></link><link xl:href="SettingLustreProperties_HTML.html"><inlinemediaobject><imageobject role="html">
28                     <imagedata contentdepth="26" contentwidth="30" fileref="./shared/next01.gif" scalefit="1"/>
29                   </imageobject>
30 <imageobject role="fo">
31                     <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/next01.gif" scalefit="1" width="100%"/>
32                   </imageobject>
33 </inlinemediaobject></link><link xl:href="ix.html"><inlinemediaobject><imageobject role="html">
34                     <imagedata contentdepth="26" contentwidth="30" fileref="./shared/index01.gif" scalefit="1"/>
35                   </imageobject>
36 <imageobject role="fo">
37                     <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/index01.gif" scalefit="1" width="100%"/>
38                   </imageobject>
39 </inlinemediaobject></link></para></entry>
40         </row>
41       </tbody>
42     </tgroup>
43   </informaltable>
44   <para><link xl:href=""/></para>
45   <informaltable frame="none">
46     <tgroup cols="1">
47       <colspec colname="c1" colwidth="100*"/>
48       
49       <tbody>
50         <row>
51           <entry align="right"><para><anchor xml:id="dbdoclet.50438291_pgfId-874" xreflabel=""/>C H A P T E R  33</para></entry>
52         </row>
53       </tbody>
54     </tgroup>
55   </informaltable>
56   <informaltable frame="none">
57     <tgroup cols="1">
58       <colspec colname="c1" colwidth="100*"/>
59       
60       <tbody>
61         <row>
62           <entry align="right"><para><anchor xml:id="dbdoclet.50438291_pgfId-5529" xreflabel=""/><anchor xml:id="dbdoclet.50438291_66186" xreflabel=""/>Lustre Programming Interfaces</para></entry>
63         </row>
64       </tbody>
65     </tgroup>
66   </informaltable>
67   <para><anchor xml:id="dbdoclet.50438291_pgfId-1293209" xreflabel=""/>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:</para>
68   <itemizedlist><listitem>
69       <para><anchor xml:id="dbdoclet.50438291_pgfId-1294898" xreflabel=""/><anchor xml:id="dbdoclet.50438291_85876" xreflabel=""/><link xl:href="LustreProgrammingInterfaces.html#50438291_32926">User/Group Cache Upcall</link></para>
70     </listitem>
71 <listitem>
72       <para> </para>
73     </listitem>
74 <listitem>
75       <para><anchor xml:id="dbdoclet.50438291_pgfId-1295238" xreflabel=""/><link xl:href="LustreProgrammingInterfaces.html#50438291_73963">l_getgroups Utility</link></para>
76     </listitem>
77 <listitem>
78       <para> </para>
79     </listitem>
80 </itemizedlist>
81    <informaltable frame="none">
82     <tgroup cols="1">
83       <colspec colname="c1" colwidth="100*"/>
84       <tbody>
85         <row>
86           <entry><para><emphasis role="bold">Note -</emphasis><anchor xml:id="dbdoclet.50438291_pgfId-1294899" xreflabel=""/>Lustre programming interface man pages are found in the lustre/doc folder.</para></entry>
87         </row>
88       </tbody>
89     </tgroup>
90   </informaltable>
91   <section remap="h2">
92     <title><anchor xml:id="dbdoclet.50438291_pgfId-1293216" xreflabel=""/></title>
93     <section remap="h2">
94       <title>33.1 <anchor xml:id="dbdoclet.50438291_32926" xreflabel=""/>User/Group <anchor xml:id="dbdoclet.50438291_marker-1293215" xreflabel=""/>Cache Upcall</title>
95       <para><anchor xml:id="dbdoclet.50438291_pgfId-1293217" xreflabel=""/>This section describes user and group upcall.</para>
96       <informaltable frame="none">
97         <tgroup cols="1">
98           <colspec colname="c1" colwidth="100*"/>
99           <tbody>
100             <row>
101               <entry><para><emphasis role="bold">Note -</emphasis><anchor xml:id="dbdoclet.50438291_pgfId-1293379" xreflabel=""/>For information on a universal UID/GID, see <link xl:href="InstallingLustre.html#50438261_19503">Environmental Requirements</link>.</para></entry>
102             </row>
103           </tbody>
104         </tgroup>
105       </informaltable>
106       <section remap="h3">
107         <title><anchor xml:id="dbdoclet.50438291_pgfId-1293218" xreflabel=""/>33.1.1 Name</title>
108         <para><anchor xml:id="dbdoclet.50438291_pgfId-1293219" xreflabel=""/>Use /proc/fs/lustre/mdt/${FSNAME}-MDT{xxxx}/identity_upcall to look up a given user’s group membership.</para>
109       </section>
110       <section remap="h3">
111         <title><anchor xml:id="dbdoclet.50438291_pgfId-1293220" xreflabel=""/>33.1.2 Description</title>
112         <para><anchor xml:id="dbdoclet.50438291_pgfId-1293221" xreflabel=""/>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 <link xl:href="LustreProgrammingInterfaces.html#50438291_33759">Data Structures</link>) and write it to the /proc/fs/lustre/mdt/${FSNAME}-MDT{xxxx}/identity_info pseudo-file.</para>
113         <para><anchor xml:id="dbdoclet.50438291_pgfId-1293225" xreflabel=""/>For a sample upcall program, see lustre/utils/l_getgroups.c in the Lustre source distribution.</para>
114         <section remap="h4">
115           <title><anchor xml:id="dbdoclet.50438291_pgfId-1293226" xreflabel=""/>33.1.2.1 Primary and Secondary Groups</title>
116           <para><anchor xml:id="dbdoclet.50438291_pgfId-1293227" xreflabel=""/>The mechanism for the primary/secondary group is as follows:</para>
117           <itemizedlist><listitem>
118               <para><anchor xml:id="dbdoclet.50438291_pgfId-1293228" xreflabel=""/> The MDS issues an upcall (set per MDS) to map the numeric UID to the supplementary group(s).</para>
119             </listitem>
120 <listitem>
121               <para> </para>
122             </listitem>
123 <listitem>
124               <para><anchor xml:id="dbdoclet.50438291_pgfId-1293229" xreflabel=""/> 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).</para>
125             </listitem>
126 <listitem>
127               <para> </para>
128             </listitem>
129 <listitem>
130               <para><anchor xml:id="dbdoclet.50438291_pgfId-1293230" xreflabel=""/> 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.</para>
131             </listitem>
132 <listitem>
133               <para> </para>
134             </listitem>
135 <listitem>
136               <para><anchor xml:id="dbdoclet.50438291_pgfId-1293231" xreflabel=""/> The default group upcall is set by mkfs.lustre. Use tunefs.lustre --param or echo{path}&gt;/proc/fs/lustre/mds/{mdsname}/group_upcall</para>
137             </listitem>
138 <listitem>
139               <para> </para>
140             </listitem>
141 <listitem>
142               <para><anchor xml:id="dbdoclet.50438291_pgfId-1294341" xreflabel=""/> 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</para>
143             </listitem>
144 <listitem>
145               <para> </para>
146             </listitem>
147 </itemizedlist>
148           <screen><anchor xml:id="dbdoclet.50438291_pgfId-1294527" xreflabel=""/>/** permission file format is like this: * {nid} {uid} {perms} * * &apos;*&apos; nid \
149 means any nid* &apos;*&apos; uid means any uid* the valid values for perms are:* setu\
150 id/setgid/setgrp/rmtacl -- enable corresponding perm* nosetuid/nosetgid/nos\
151 etgrp/normtacl -- disable corresponding perm* they can be listed together, \
152 seperated by &apos;,&apos;,* when perm and noperm are in the same line (item), noperm\
153  is preferential,* when they are in different lines (items), the latter is \
154 preferential,* &apos;*&apos; nid is as default perm, and is not preferential.*/
155 </screen>
156           <para><anchor xml:id="dbdoclet.50438291_pgfId-1294343" xreflabel=""/>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.</para>
157           <itemizedlist><listitem>
158               <para><anchor xml:id="dbdoclet.50438291_pgfId-1294268" xreflabel=""/> 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 &quot;failure&quot; 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.</para>
159             </listitem>
160 <listitem>
161               <para> </para>
162             </listitem>
163 </itemizedlist>
164         </section>
165       </section>
166       <section remap="h3">
167         <title><anchor xml:id="dbdoclet.50438291_pgfId-1293233" xreflabel=""/>33.1.3 Parameters</title>
168         <itemizedlist><listitem>
169             <para><anchor xml:id="dbdoclet.50438291_pgfId-1293234" xreflabel=""/> Name of the MDS service</para>
170           </listitem>
171 <listitem>
172             <para> </para>
173           </listitem>
174 <listitem>
175             <para><anchor xml:id="dbdoclet.50438291_pgfId-1293235" xreflabel=""/> Numeric UID</para>
176           </listitem>
177 <listitem>
178             <para> </para>
179           </listitem>
180 </itemizedlist>
181       </section>
182       <section remap="h3">
183         <title><anchor xml:id="dbdoclet.50438291_pgfId-1293237" xreflabel=""/>33.1.4 <anchor xml:id="dbdoclet.50438291_33759" xreflabel=""/>Data Structures</title>
184         <screen><anchor xml:id="dbdoclet.50438291_pgfId-1293240" xreflabel=""/>struct identity_downcall_data {
185 <anchor xml:id="dbdoclet.50438291_pgfId-1293241" xreflabel=""/>   __u32           idd_magic;
186 <anchor xml:id="dbdoclet.50438291_pgfId-1293242" xreflabel=""/>   __u32           idd_err;
187 <anchor xml:id="dbdoclet.50438291_pgfId-1293243" xreflabel=""/>   __u32           idd_uid;
188 <anchor xml:id="dbdoclet.50438291_pgfId-1293244" xreflabel=""/>   __u32           idd_gid;
189 <anchor xml:id="dbdoclet.50438291_pgfId-1293245" xreflabel=""/>   __u32           idd_nperms;
190 <anchor xml:id="dbdoclet.50438291_pgfId-1294332" xreflabel=""/>   struct perm_downcall_data idd_perms[N_PERMS_MAX];
191 <anchor xml:id="dbdoclet.50438291_pgfId-1294322" xreflabel=""/>   __u32           idd_ngroups;
192 <anchor xml:id="dbdoclet.50438291_pgfId-1293246" xreflabel=""/>   __u32           idd_groups[0];
193 <anchor xml:id="dbdoclet.50438291_pgfId-1293247" xreflabel=""/>};
194 </screen>
195       </section>
196     </section>
197     <section remap="h2">
198       <title>33.2 l_getgroups<anchor xml:id="dbdoclet.50438291_73963" xreflabel=""/><anchor xml:id="dbdoclet.50438291_marker-1294565" xreflabel=""/> Utility</title>
199       <para><anchor xml:id="dbdoclet.50438291_pgfId-1294567" xreflabel=""/>The l_getgroups utility handles Lustre user/group cache upcall.</para>
200       <section remap="h5">
201         <title><anchor xml:id="dbdoclet.50438291_pgfId-1294568" xreflabel=""/>Synopsis</title>
202         <screen><anchor xml:id="dbdoclet.50438291_pgfId-1294569" xreflabel=""/>l_getgroups [-v] [-d|mdsname] uid]
203 <anchor xml:id="dbdoclet.50438291_pgfId-1294570" xreflabel=""/>l_getgroups [-v] -s
204 </screen>
205       </section>
206       <section remap="h5">
207         <title><anchor xml:id="dbdoclet.50438291_pgfId-1294571" xreflabel=""/>Description</title>
208         <para><anchor xml:id="dbdoclet.50438291_pgfId-1294572" xreflabel=""/>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.</para>
209         <para><anchor xml:id="dbdoclet.50438291_pgfId-1294573" xreflabel=""/>l_getgroups is the reference implementation of the user/group cache upcall.</para>
210       </section>
211       <section remap="h5">
212         <title><anchor xml:id="dbdoclet.50438291_pgfId-1294574" xreflabel=""/>Files</title>
213         <para><anchor xml:id="dbdoclet.50438291_pgfId-1294575" xreflabel=""/>/proc/fs/lustre/mds/mds-service/group_upcall</para>
214         <!--
215 Begin SiteCatalyst code version: G.5.
216 -->
217         <!--
218 End SiteCatalyst code version: G.5.
219 -->
220           <informaltable frame="none">
221           <tgroup cols="3">
222             <colspec colname="c1" colwidth="33*"/>
223             <colspec colname="c2" colwidth="33*"/>
224             <colspec colname="c3" colwidth="33*"/>
225             
226             
227             
228             <tbody>
229               <row>
230                 <entry align="left"><para>Lustre 2.0 Operations Manual</para></entry>
231                 <entry align="right"><para>821-2076-10</para></entry>
232                 <entry align="right" valign="top"><para><link xl:href="index.html"><inlinemediaobject><imageobject role="html">
233                           <imagedata contentdepth="26" contentwidth="30" fileref="./shared/toc01.gif" scalefit="1"/>
234                         </imageobject>
235 <imageobject role="fo">
236                           <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/toc01.gif" scalefit="1" width="100%"/>
237                         </imageobject>
238 </inlinemediaobject></link><link xl:href="UserUtilities_HTML.html"><inlinemediaobject><imageobject role="html">
239                           <imagedata contentdepth="26" contentwidth="30" fileref="./shared/prev01.gif" scalefit="1"/>
240                         </imageobject>
241 <imageobject role="fo">
242                           <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/prev01.gif" scalefit="1" width="100%"/>
243                         </imageobject>
244 </inlinemediaobject></link><link xl:href="SettingLustreProperties_HTML.html"><inlinemediaobject><imageobject role="html">
245                           <imagedata contentdepth="26" contentwidth="30" fileref="./shared/next01.gif" scalefit="1"/>
246                         </imageobject>
247 <imageobject role="fo">
248                           <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/next01.gif" scalefit="1" width="100%"/>
249                         </imageobject>
250 </inlinemediaobject></link><link xl:href="ix.html"><inlinemediaobject><imageobject role="html">
251                           <imagedata contentdepth="26" contentwidth="30" fileref="./shared/index01.gif" scalefit="1"/>
252                         </imageobject>
253 <imageobject role="fo">
254                           <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/index01.gif" scalefit="1" width="100%"/>
255                         </imageobject>
256 </inlinemediaobject></link></para></entry>
257               </row>
258             </tbody>
259           </tgroup>
260         </informaltable>
261         <para><link xl:href=""/></para>
262         <para><link xl:href="copyright.html">Copyright</link> © 2011, Oracle and/or its affiliates. All rights reserved.</para>
263       </section>
264     </section>
265   </section>
266 </article>