<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi John,
<div class=""><br class="">
</div>
<div class="">The initial string in the OSC name is the filesystem name and the long hexadecimal number at the end is the client ID. The client ID is specific to the mount point that “owns” the OSC, and typically changes each time the filesystem is mounted.
 It is there to differentiate devices  when the same filesystem is mounted multiple times. </div>
<div class=""><br class="">
</div>
<div class="">You can retrieve both of the values by passing the mount directory to llapi_get_name(). This function returns a string with filesystem name and client ID in the format “FSNAME-ID". You can split the string on the ‘-‘ to extract those values, and
 then use them construct the right name for the current OSC being used for that file on that particular mountpoint.</div>
<div class=""><br class="">
</div>
<div class="">Note, like the client ID, the OSC name is specific to that mount point. The actual OST name is just FSNAME-OST####. </div>
<div class=""><br class="">
</div>
<div class="">robert</div>
<div class=""><br class="">
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On Jul 18, 2016, at 15:22 , John Bauer <<a href="mailto:bauerj@iodoctors.com" class="">bauerj@iodoctors.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div bgcolor="#FFFFFF" text="#000000" class="">
<p class="">I will restate the problem I am having with Lustre.  <br class="">
</p>
<p class="">With my I/O instrumentation library, I want to use <b class=""><font face="Courier New, Courier, monospace" class="">llapi_file_get_stripe</font></b>() to find the OSTs that a file of interest is striped on and then monitor only those OST's using
 files in the directory /proc/fs/lustre/osc.  This needs to be done programmatically, and in a general sense, with potentially only a relative path name.</p>
<p class=""><font face="Courier New, Courier, monospace" class=""><b class="">llapi_file_get stripe</b>() yields<br class="">
lmm_stripe_count:   1<br class="">
lmm_stripe_size:    1048576<br class="">
lmm_pattern:        1<br class="">
lmm_layout_gen:     0<br class="">
lmm_stripe_offset:  12</font></p>
<p class=""><font face="Courier New, Courier, monospace" class="">lmm_oi.oi_fid      
<font color="#ff0000" class=""><b class="">0x</b><b class="">194aa</b></font></font></p>
<p class=""><font face="Courier New, Courier, monospace" class="">        <b class="">
obdidx</b>           objid           objid           group<br class="">
            <b class="">12</b>        31515860      0x1e0e4d4                0</font><br class="">
</p>
<p class="">If I use <b class="">obdidx=12=0xc </b>to find the OST in directory /proc/fs/lustre/osc, I get multiple OSTs as there are multiple file systems with an ost of index 12 ( note that obdidx is decimal and entries in
<b class="">/proc/fs/lustre/osc</b> are hexadecimal, so we are looking for OST000c ).</p>
<p class="">%<font face="Courier New, Courier, monospace" class=""> ls -ld /proc/fs/lustre/osc/*OST000c*<br class="">
dr-xr-xr-x 2 root root 0 Jul 18 14:31 /proc/fs/lustre/osc/nbp1-OST000c-osc-ffff88090509f000<br class="">
dr-xr-xr-x 2 root root 0 Jul 18 14:31 /proc/fs/lustre/osc/nbp2-OST000c-osc-ffff881038061c00<br class="">
dr-xr-xr-x 2 root root 0 Jul 18 14:31 /proc/fs/lustre/osc/nbp6-OST000c-osc-ffff88084c405400<br class="">
dr-xr-xr-x 2 root root 0 Jul 18 14:31 /proc/fs/lustre/osc/nbp7-OST000c-osc-ffff8807a8e1d400<br class="">
dr-xr-xr-x 2 root root 0 Jul 18 14:31 /proc/fs/lustre/osc/nbp8-OST000c-osc-ffff88078339b800<br class="">
dr-xr-xr-x 2 root root 0 Jul 18 14:31 /proc/fs/lustre/osc/nbp9-OST000c-osc-ffff8807833a5400</font><br class="">
</p>
<p class="">So I need to figure out which directory entry applies to the OST of my file of interest.</p>
<p class="">I looked at the inode for clues.  I did an stat() of the file to get</p>
<pre class="">dev_t     st_dev=0xcc5d43c2
ino_t     st_ino=0x2000311ed0194aa</pre>
<p class="">I notice the <b class="">lov_user_md->oi_fid=<font color="#ff0000" class="">0x0194aa</font>,</b>  populated by
<b class="">llapi_file_get_stripe</b>(), is reflected in the lower part of <b class="">
<a href="http://stat.st" class="">stat.st</a>_ino=0x<font color="#3366ff" class="">2000311ed</font><font color="#ff0000" class="">0194aa</font></b>.  My question is, "Does the remainder of st_ino,
<b class=""><font color="#3366ff" class="">2000311ed</font></b>, give me any clue as to which OST I should use out of
<b class="">/proc/fs/lustre/osc</b>?"  The same question applies to the OST's objid=<font face="Courier
        New, Courier, monospace" class="">0x1e0e4d4<font face="Helvetica, Arial,
          sans-serif" class=""> and the file's st_dev=<font face="Courier New,
            Courier, monospace" class="">0xcc5d43c2</font>.</font></font></p>
<p class=""><font face="Courier New, Courier, monospace" class=""><font face="Helvetica, Arial, sans-serif" class="">Because I know a priori that the file is in the lov nbp2, I know I need to find
</font></font><font face="Courier New, Courier, monospace" class="">/proc/fs/lustre/osc/</font><b class=""><font face="Courier New, Courier, monospace" class="">nbp2-OST000c-osc-ffff881038061c00.</font></b><font face="Helvetica, Arial, sans-serif" class=""><b class=""> 
</b>What does the <br class="">
<font face="Courier New, Courier, monospace" class=""><b class="">ffff881038061c00
</b></font>represent?</font><font face="Courier New, Courier,
        monospace" class=""><font face="Helvetica, Arial, sans-serif" class="">  It is the same value for all OST's in a given lov, so I am guessing it is lov related.</font></font><b class=""><font face="Courier New,
          Courier, monospace" class=""><br class="">
</font></b></p>
<font face="Helvetica, Arial, sans-serif" class=""><font face="Helvetica,
        Arial, sans-serif" class="">There are over 1200 OST on the node, so I want to minimize the number that I instrument.<br class="">
</font>Any information that would shed some light on this would be greatly appreciated. 
<br class="">
John</font><br class="">
<pre class="moz-signature" cols="72">-- 
I/O Doctors, LLC
507-766-0378
<a class="moz-txt-link-abbreviated" href="mailto:bauerj@iodoctors.com">bauerj@iodoctors.com</a></pre>
</div>
_______________________________________________<br class="">
lustre-discuss mailing list<br class="">
<a href="mailto:lustre-discuss@lists.lustre.org" class="">lustre-discuss@lists.lustre.org</a><br class="">
http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>