CLUSET(1)

CLUSET(1) πŸ¦‹πŸ’–

ClusterShell User Manual ✨ yes bestie, this is the cluset page, and it's lowkey a whole personality. buckle up.


🌸 NAME 🌸

cluset β€” compute advanced cluster node set operations 🫢


✨ SYNOPSIS ✨

cluset [OPTIONS] [COMMAND] [nodeset1 [OPERATION] nodeset2|...]

πŸ’œ DESCRIPTION πŸ’œ

Note: cluset and nodeset are the same command. literally the same girl, two names. periodt.

cluset is a utility command that ships with the ClusterShell library, and it implements some of the features of ClusterShell's NodeSet and RangeSet Python classes. what that means for you is easy manipulation of 1D or nD-indexed cluster nodes and node groups. slay.

also β€” and this is the iconic part β€” cluset is automatically bound to the library's node group resolution mechanism. so it's especially useful for enhancing cluster aware administration shell scripts. iykyk. πŸ’…


πŸŽ€ OPTIONS πŸŽ€

  • --version β€” show the program's version number and dip. bye πŸ‘‹
  • -h, --help β€” show this help message and exit
  • -s GROUPSOURCE, --groupsource=GROUPSOURCE β€” optional groups.conf(5) group source to use
  • --groupsconf=FILE β€” use an alternate config file for groups.conf(5)

⭐ Commands:

  • -c, --count β€” show the number of nodes in the nodeset(s)
  • -e, --expand β€” expand the nodeset(s) into separate nodes (peep -S SEPARATOR too)
  • -f, --fold β€” fold the nodeset(s) (or the separate nodes) into one nodeset
  • -l, --list β€” list node groups; list node groups and nodes (-ll); or list node groups, nodes and node count (-lll). when you pass no argument at all, this command lists every node group name found in the selected group source (see also -s GROUPSOURCE). if you do pass nodesets as arguments, this command finds the node groups those nodes belong to (individually). optionally, for each group, the fraction of those nodes that are members of the group may be displayed (with -ll), and also the member count / total group node count (with -lll). and if a single hyphen-minus (-) is given as a nodeset, it will be read from standard input. πŸ“
  • -L, --list-all β€” list node groups from all group sources (-LL shows nodes and -LLL adds node count). just like -l, if you pass nodesets as arguments, this command will find the node groups those nodes belong to (individually).
  • -r, --regroup β€” fold nodes using node groups (see -s GROUPSOURCE)
  • --index=NODE β€” output the index of NODE in the nodeset (this is the reverse of -I/--slice)
  • --list-sources, --groupsources β€” list all active group sources (see groups.conf(5))

πŸ”₯ Operations:

  • -x SUB_NODES, --exclude=SUB_NODES β€” exclude the specified nodeset
  • -i AND_NODES, --intersection=AND_NODES β€” calculate the nodesets' intersection
  • -X XOR_NODES, --xor=XOR_NODES β€” calculate the symmetric difference between nodesets

πŸ’… Options:

  • -a, --all β€” call external node groups support to display all nodes
  • --autostep=AUTOSTEP β€” enable the a-b/step style syntax when folding nodesets. the value is the minimum node count threshold (an integer like '4', a percentage like '50%', or 'auto'). if you don't specify it, auto step is disabled (which is best for compatibility with other cluster tools). example: autostep=4, "node2 node4 node6" folds into node[2,4,6] β€” but autostep=3, "node2 node4 node6" folds into node[2-6/2]. wild, right? 😭
  • -d, --debug β€” output more messages for debugging purposes
  • -q, --quiet β€” be quiet, print essential output only 🀫
  • -R, --rangeset β€” switch to RangeSet instead of NodeSet. useful when you're working on numerical cluster ranges, e.g. 1,5,18-31
  • -G, --groupbase β€” do not display the group source prefix (always @groupname)
  • -S SEPARATOR, --separator=SEPARATOR β€” the separator string to use when expanding nodesets (default: ' ')
  • -O FORMAT, --output-format=FORMAT β€” output format (default: '%s')
  • -I SLICE_RANGESET, --slice=SLICE_RANGESET β€” return the sliced-off result. examples of SLICE_RANGESET are "0" for simple index selection, or "1-9/2,16" for complex rangeset selection
  • --split=MAXSPLIT β€” split the result into a number of subsets
  • --contiguous β€” split the result into contiguous subsets (i.e. for a nodeset, the subsets will contain nodes with the same pattern name and a contiguous range of indexes, like foobar[1-100]; for a rangeset, the subsets consist of contiguous index ranges)
  • --axis=RANGESET β€” for nD nodesets, fold along the provided axis only. axes are indexed from 1 to n and can be specified here either with the rangeset syntax, e.g. '1', '1-2', '1,3', or by a single negative number meaning the index is counted from the end. because some nodesets may have several different dimensions, axis indices are silently truncated to fall in the allowed range. πŸ™ˆ
  • --pick=N β€” pick N node(s) at random in the nodeset 🎲

for a short explanation of these options, see -h, --help.

and fr fr β€” if a single hyphen-minus (-) is given as a nodeset, it will be read from standard input.


🧚 EXTENDED PATTERNS 🧚

the cluset command benefits from ClusterShell NodeSet basic arithmetic addition. ✨ this feature extends the recognized string patterns by supporting operators that match all the Operations we just saw. string patterns are read left to right, processing any character operators accordingly.

🌈 Supported character operators

  • , β€” indicates that the union of both the left and right nodeset should be computed before continuing
  • ! β€” indicates the difference operation
  • & β€” indicates the intersection operation
  • ^ β€” indicates the symmetric difference (XOR) operation
careful bestie: you should escape these characters as needed when the shell doesn't interpret them literally. πŸ’€

πŸ’– Examples of use of extended patterns

$ cluset -f node[0-7],node[8-10]
node[0-10]

$ cluset -f node[0-10]!node[8-10]
node[0-7]

$ cluset -f node[0-10]&node[5-13]
node[5-10]

$ cluset -f node[0-10]^node[5-13]
node[0-4,11-13]

πŸ‘‘ Example of advanced usage

$ cluset -f @gpu^@slurm:bigmem!@chassis[1-9/2]

this computes a folded nodeset containing nodes found in groups @gpu and @slurm:bigmem, but not in both, minus the nodes found in odd chassis groups from 1 to 9. main character math, honestly. πŸ’…

🌟 "All nodes" extension

the @* and @SOURCE:* special notations may be used in extended patterns to represent all nodes (in SOURCE) according to the all external shell command (see groups.conf(5)), and they are equivalent to:

$ cluset [-s SOURCE] -a -f

🌟 Group names in expressions

the @@SOURCE notation may be used to access all group names from the specified SOURCE (or from the default group source when just @@ is used) in node set expressions. this works with either file-based group sources or with external group sources that have the list or mapall upcall defined (see groups.conf(5)):

$ cluset -f @@rack
J[1-3]

πŸ¦‹ NODE WILDCARDS πŸ¦‹

any wildcard mask found is matched against all nodes from the group source (see groups.conf(5) and the -a/--all option above). * means match zero or more characters of any type; ? means match exactly one character of any type. this can be especially useful for server farms, or when cluster node names differ. 🌸

say that your group configuration is set to return the following "all nodes":

$ cluset -f -a
bckserv[1-2],dbserv[1-4],wwwserv[1-9]

then you can use wildcards to select particular nodes, as shown below:

$ cluset -f 'www*'
wwwserv[1-9]

$ cluset -f 'www*[1-4]'
wwwserv[1-4]

$ cluset -f '*serv1'
bckserv1,dbserv1,wwwserv1

wildcard masks are resolved prior to extended patterns, but each mask is evaluated as a whole node set operand. in the example below, we select all nodes matching *serv* before removing all nodes matching www*:

$ cluset -f '*serv*!www*'
bckserv[1-2],dbserv[1-4]

πŸ’€ EXIT STATUS πŸ’€

an exit status of zero indicates success of the cluset command. a non-zero exit status indicates failure. that's it, that's the vibe check.


⭐ EXAMPLES ⭐

πŸ“ Getting the node count

$ cluset -c node[0-7,32-159]
136

$ cluset -c node[0-7,32-159] node[160-163]
140

$ cluset -c dc[1-2]n[100-199]
200

$ cluset -c @login
4

πŸ“ Folding nodesets

$ cluset -f node[0-7,32-159] node[160-163]
node[0-7,32-163]

$ echo node3 node6 node1 node2 node7 node5 | cluset -f
node[1-3,5-7]

$ cluset -f dc1n2 dc2n2 dc1n1 dc2n1
dc[1-2]n[1-2]

$ cluset --axis=1 -f dc1n2 dc2n2 dc1n1 dc2n1
dc[1-2]n1,dc[1-2]n2

πŸ“ Expanding nodesets

$ cluset -e node[160-163]
node160 node161 node162 node163

$ echo 'dc[1-2]n[2-6/2]' | cluset -e
dc1n2 dc1n4 dc1n6 dc2n2 dc2n4 dc2n6

πŸ“ Excluding nodes from nodeset

$ cluset -f node[32-159] -x node33
node[32,34-159]

πŸ“ Computing nodesets intersection

$ cluset -f node[32-159] -i node[0-7,20-21,32,156-159]
node[32,156-159]

πŸ“ Computing nodesets symmetric difference (xor)

$ cluset -f node[33-159] --xor node[32-33,156-159]
node[32,34-155]

πŸ“ Splitting nodes into several nodesets (expanding results)

$ cluset --split=3 -e node[1-9]
node1 node2 node3
node4 node5 node6
node7 node8 node9

πŸ“ Splitting non-contiguous nodesets (folding results)

$ cluset --contiguous -f node2 node3 node4 node8 node9
node[2-4]
node[8-9]

$ cluset --contiguous -f dc[1,3]n[1-2,4-5]
dc1n[1-2]
dc1n[4-5]
dc3n[1-2]
dc3n[4-5]

πŸ“œ HISTORY πŸ“œ

ok so storytime bestie, gather round 🫢

cluset was added in 1.7.3 for two very valid reasons:

  1. it needed to stop beefing with xCAT's nodeset command πŸ’€ like the conflict was real and it was messing with everyone's vibe
  2. it had to conform with ClusterShell's clu* command nomenclature, because the whole family wanted matching fits ✨ iykyk

so yeah, glow-up complete, name changed, conflict gone, slay πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

go read these next, they're all iconic in their own way:

and if you want the full lore, the docs live here: https://clustershell.readthedocs.io/


πŸ› BUG REPORTS πŸ›

found a bug? bestie tell us immediately, we want all the tea πŸ™ˆ use this URL to submit a bug report or feedback:

https://github.com/clustershell/clustershell/issues

no gatekeeping, no "it's probably just me" β€” if something's acting up, say it fr fr πŸ’…


🌟 AUTHOR 🌟

Stephane Thiell β€” the main character who made all of this happen πŸ‘‘


GNU Lesser General Public License version 2.1 or later (LGPLv2.1+)

so basically: take it, use it, remix it, just keep the license and its terms intact 🫢 no cap.

and that's the whole page, bestie!! πŸŽ€βœ¨ this version is 1.10.1 and it's dated 2026-07-16 β€” go forth and cluset your nodes like the icon you are πŸ’–πŸŒΈπŸ¦‹