You should be able to use "-C N" to overstripe a file without specifying the OST indexes with "-o ...".
For handling this via llapi_layout commands, I believe it is necessary to set llapi_layout_pattern_set(LLAPI_LAYOUT_OVERSTRIPING) flag on the component, and then specify a stripe count > OSTCOUNT. I see this isn't documented in the llapi_layout_pattern_set(3) man page (along with LLAPI_LAYOUT_FOREIGN), so please file a Jira ticket for this (and ideally also submit a patch to the man page). The flag will be cleared if the stripe count <= OSTCOUNT, for improved compatibility with older clients that do not understand overstriping (though that is unlikely these days). The patch https://review.whamcloud.com/54192 ("LU-16938 utils: setstripe overstripe multiple OST count") along with a few follow-on fixes in Lustre 2.16+ also allows specifying: lfs setstripe -C -N ... FILE|DIR (or llapi equivalent) to create 'N' stripes per OST for the file, instead of having to know the exact OST count, if that is more convenient. Cheers, Andreas > On Dec 20, 2025, at 18:52, Wei-Keng Liao via lustre-discuss > <[email protected]> wrote: > > When setting the overstriping for a new file, is it possible to let > the MDS to choose the OST indices? > > I was able to use lfs command to set an overstiping for a new file. > For example, to overstripe a file over 4 OSTs with 2 stripe per OST, > I am using this command: > > % lfs setstripe -c 4 -C 8 -o 10-13,10-13 $SCRATCH/dummy > > % lfs getstripe $SCRATCH/dummy | grep lmm > lmm_stripe_count: 8 > lmm_stripe_size: 1048576 > lmm_pattern: raid0,overstriped > lmm_layout_gen: 0 > lmm_stripe_offset: 10 > lmm_pool: original > > My understanding is when without overstriping, the default is that > the OSTs are selected by Lustre MDS based on some policy (maybe OST > usage). I wonder if this can also apply to overstriping, i.e. using > lfs command options '-c' and '-C' without option '-o'. > > I am also wondering how this can be achieved using the Lustre user > C APIs, when making calls to llapi_layout_ost_index_set(). > > > Wei-keng > > _______________________________________________ > lustre-discuss mailing list > [email protected] > http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org _______________________________________________ lustre-discuss mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org
