Attribute Groups and Dynamic Groups#

The scyld-install script creates a default attribute group called DefaultAttribs. That group can be modified or replaced, although all nodes are always joined to the default group. The cluster administrator can create additional attribute groups, e.g.,:

scyld-attribctl create name=dept_geophysics
scyld-attribctl create name=dept_atmospherics
scyld-attribctl create name=gpu

and then assign or remove one or more groups to specific nodes, e.g.,:

scyld-nodectl -i n[0-7] join dept_geophysics
scyld-nodectl -i n[8-11] join dept_atmospherics
scyld-nodectl -i n[0-3,7-9] join gpu
scyld-nodectl -i n7 leave gpu

These group assignments can be viewed either by specific nodes:

scyld-nodectl -i n0 ls -l
scyld-nodectl -i n[4-7] ls -l

or as a table:

[admin]$ scyld-nodectl --fields groups --table ls -l
Nodes |                       groups
------+-----------------------------
   n0 |   ['dept_geophysics', 'gpu']
   n1 |   ['dept_geophysics', 'gpu']
   n2 |   ['dept_geophysics', 'gpu']
   n3 |   ['dept_geophysics', 'gpu']
   n4 |          ['dept_geophysics']
   n5 |          ['dept_geophysics']
   n6 |          ['dept_geophysics']
   n7 |          ['dept_geophysics']
   n8 | ['dept_atmospherics', 'gpu']
   n9 | ['dept_atmospherics', 'gpu']
  n10 |        ['dept_atmospherics']
  n11 |        ['dept_atmospherics']
  n12 |                           []
  n13 |                           []
  n14 |                           []
  n15 |                           []

Commands that accept group lists can reference nodes by their group name(s) (expressed with a % prefix) instead of their node names, e.g.,:

scyld-nodectl -i %dept_atmospherics
scyld-nodectl -i %gpu
scyld-nodectl -i %dept_geophysics status -L

Both the Kubernetes scyld-kube --init command and the Job Scheduler ${jobsched}-scyld.setup init, reconfigure, and update-nodes actions accept --ids %<GROUP> as well as --ids <NODES>. For details, see Kubernetes.

In addition to attribute groups, the ICE ClusterWare™ platform also supports admin-defined dynamic groups using a query language that allows for simple compound expressions. These expressions can reference individual attributes, group membership, hardware fields, or status fields. For example, suppose we define attribute groups "dc1" and "dc2":

scyld-attribctl create name=dc1 description='Data center located in rear of building 1'
scyld-attribctl create name=dc2 description='Data center in building 2'

and then add nodes to appropriate groups:

scyld-nodectl -i n[0-31]  join dc1
scyld-nodectl -i n[32-63] join dc2

and for each node, identify its rack number in an attribute:

scyld-nodectl -i n[0-15]  set rack=1
scyld-nodectl -i n[16-31] set rack=2
scyld-nodectl -i n[32-47] set rack=1
scyld-nodectl -i n[48-63] set rack=2

Note that all attribute values are saved as strings, not integers, so that subsequent selector expressions must enclose these values in double-quotes.

Now you can query a list of nodes in a particular rack of a particular building using a --selector (or -s) expression, and perform an action on the results of that selection:

scyld-nodectl -s 'in dc1 and attributes[rack] == "2"' status
# or use 'a' as the abbreviation of 'attributes'
scyld-nodectl -s 'in dc1 and a[rack] == "2"' set _boot_config=TestBoot

# Show the nodes that have 32 CPUs.
# These hardware _cpu_count values are integers, not strings, and are
#  not enclosed in double-quotes.
scyld-nodectl -s 'hardware[cpu_count] == 32' ls
# or use 'h' as the abbreviation of 'hardware'
scyld-nodectl -s 'h[cpu_count] == 32' ls

# Show the nodes that do not have 32 CPUs
scyld-nodectl -s 'h[cpu_count] != 32' ls

You can also create a dynamic group of a specific selector for later use:

scyld-clusterctl dyngroups create name=b1_rack1 selector='in dc1 and a[rack] == "1"'
scyld-clusterctl dyngroups create name=b1_rack2 selector='in dc1 and a[rack] == "2"'

# Show the nodes in building 1, rack 2
scyld-nodectl -i %b1_rack2 ls

# Show only those %b1_rack2 nodes with 32 CPUs
scyld-nodectl -i %b1_rack2 -s 'h[cpu_count] == 32' ls

You can list the dynamic groups using scyld-clusterctl:

# Show the list of dynamic groups
[admin1@headnode1 ~]$ scyld-clusterctl dyngroups ls
Dynamic Groups
  b1_rack1
  b1_rack2

And show details of one or more dynamic group. For example:

# Show the selector associated with a specific dynamic group
[admin1@headnode1 ~]$ scyld-clusterctl dyngroups -i b1_rack1 ls -l
Dynamic Groups
  b1_rack1
    name: b1_rack1
    selector: in dc1 and a[rack] == "1"

# Or show the selector associated with a specific dynamic group in full detail
[admin1@headnode1 ~]$ scyld-clusterctl dyngroups -i b1_rack1 ls -L
Dynamic Groups
  b1_rack1
    name: b1_rack1
    parsed: ((in "dc1") and (attributes["rack"] == "1"))
    selector: in dc1 and a[rack] == "1"

The parsed line in the above output can be useful when debugging queries to confirm how ClusterWare parsed the provided query text.