[LU-1707] Add llapi_* function to return the OST/MDT count for a path. Created: 03/Aug/12  Updated: 14/Jul/20

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Richard Henwood (Inactive) Assignee: WC Triage
Resolution: Unresolved Votes: 0
Labels: llnl

Issue Links:
Related
is related to LU-2182 Add llapi_file_get_layout() function ... Closed
is related to LU-5969 Create an LGPL version of liblustreapi Open
Rank (Obsolete): 10514

 Description   

It would be valuable to programmatically discover the number of OSTs that are available. An llapi_* function would be a suitable place for this call.

Use Case

When writing HDF5 files one typically configures the number of writers as a fraction of the number of OSTs for best performance.

Currently this information is only available by writing a file with stripe count set to -1 and then counting the number of stripes present. A programmatic interface to the OST count would simplify this task.



 Comments   
Comment by Richard Henwood (Inactive) [ 24/Aug/12 ]

The current method is:

  1. Set a directory to stripe over the all OSTs lfs setstripe -c -1 ./
  2. Write a file into the directory.
  3. Read the number of stripes the file has lfs getstripe -q. Count using string parsing.
  4. Delete the file, and the directory.
Comment by Richard Henwood (Inactive) [ 24/Aug/12 ]

The number of OST's on the system is available using the command:

# lfs osts /mnt/lustre/
OBDS::
0: lustre-OST0000_UUID ACTIVE
1: lustre-OST0001_UUID ACTIVE
Comment by Richard Henwood (Inactive) [ 24/Aug/12 ]

It seems like the function in lustreapi.h is

int llapi_ostlist(char *path, struct find_param *param);

The documentation is, sparse. I'll try and rustle up a usage example.

Comment by Andy Nelson [ 06/Dec/13 ]

Just noticed this ticket/thread. I also need this functionality from within my code
and Ned has recommended the undocumented function "llapi_get_obd_count" to get the
required info in another thread. The problem/difficulty with it is apparently that it
requires ioctl functionality to work, which is problematic on machines like sequoia.
The current status right now is that it has a work around to avoid the ioctl, but
I don't know how generally effective that workaround is.

In any case, I'm glad it is more than just me that needs this...things are always
more likely to get fixed when multiple wheels are squeaking

Andy

Comment by John Hammond [ 07/Dec/13 ]

Do we really want to know how many OSTs are available or rather do we want to know what is the maximum stripe count we can get on a file? I suspect it is the latter. If so we should add a function whose name reflects this (say llapi_get_max_stripe_count(int fd/const char *path/...).

Second, in the lustre source not all OBDs are OSTs, so if we want the OST count then the function should be llapi_get_ost_count().

Comment by Andy Nelson [ 07/Dec/13 ]

The thing I want is the maximum number of components I can stripe over from the point of view of my running application.
I need that quantity for what appears to be exactly the same use case as Richard describes above...setting how many
(and which) writers I should have.

So something along the lines of your first suggestion seems the most appropriate for me.

I'm not really clear on the differences, subtle and not so subtle, between the alphabet soup
of ost's, obd's, oss's, mds's mdt's and so on, so I'll leave the second issue to you

Andy

Comment by Richard Henwood (Inactive) [ 09/Dec/13 ]

John: thanks for your thoughts on this.

Can you provide an example when: the # of available OSTs != maximum stripe count?

Comment by John Hammond [ 09/Dec/13 ]

IIRC any system with more than 2000 OSTs will have this property.

Comment by Richard Henwood (Inactive) [ 09/Dec/13 ]

I understand. My interpretation is now that both Andy and myself do want the 'maximum stripe count', as you suggested.

Comment by Christopher Morrone [ 09/Dec/13 ]

An even simpler case: A filesystem has 100 OSTs, but one is marked inactive. The function should return 99 in that case.

Comment by James A Simmons [ 09/Jul/14 ]

While looking at LU-2182 I noticed this ticket. This functionality has been implemented as

int llapi_get_obd_count(char *mnt, int *count, int is_mdt)

If this fits what you are looking for then let us know so this ticket can be closed.

Comment by Andy Nelson [ 09/Jul/14 ]


See my above comment of 4:42 Dec 6, 2013, re llapi_get_obd_count in the context of closing this ticket.

Comment by James A Simmons [ 09/Jul/14 ]

Yep, I also just had this discussion with Ned.a few minutes ago. This overlaps the work I'm doing in LU-5030 so I will get around to implementing this for you. Looks like I will have to focus my time toward LU-5030 first.

Comment by Andreas Dilger [ 09/Sep/14 ]

Ned, does the new llapi_layout_* functionality landed via http://review.whamcloud.com/5302 or is there still work to be done?

Comment by Ned Bass [ 09/Sep/14 ]

The functionality described in the description of this issue is still lacking in the API. A set of new interfaces is needed that implements John's suggestion from this comment.

Comment by Andreas Dilger [ 03/Dec/14 ]

Adding this as a requirement to LU-5969.

Generated at Sat Feb 10 01:18:59 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.