Skip to content

3.6 Sensys Logical Grouping

lrrajesh edited this page Sep 14, 2016 · 1 revision

Logical Grouping

Sensys provide a service which allows one to associate to a tag (group) any sequence of members. Where it is enabled, this tag can then be used as a shortcut for that member list.

Logical grouping can be used by the following services provided by the Sensys octl facility:

= resource
= diag
= sensor

For example, within the octl sensor service, in order to tell that a logical grouping is to be used instead of a node regex, one must specify the tag prepended by the $ character. For instance, assuming that abc is the tag to which we asscociated three nodes: n1,n2 and n3:

    abc <--> n1,n2,n3

Then one would use $abc in order to tell the octl sensor service that all three nodes (n1,n2,n3) are to be used. In the interactive mode, single quotes need to be put in order to recognize the $ to present Shell expansion, like '$'.

In octl, we offer a command line tool, namely "grouping", to allow users to specify logical groups. In total, there are three ways to specify the logical groups: octl batch mode, octl interactive mode and modifying the storage file directly. The batch and interactive mode both uses the same commands:


[octl] grouping add <tag> <regex>

[octl] grouping remove <tag> <regex>

[octl] grouping list <tag> <regex>

The above example shows to use octl grouping in the batch mode: [octl]. The <tag> is any valid text string, representing a group name; if white spaces are in , use quotes in order to prevent automatic splitting. <regex> is an Sensys regex.

Both the remove and list command support a wildcard represented by the character *. Replacing <tag> by * indicates that all <tag> are to be selected; similarly for <regex>. Again, in the interactive mode, single quotes need to be put in order to present shell expansion to . Currently, the remove command of logical grouping does not support partial success. It is either totally success, or failed. For example, one operation is that we remove some nodes from all the groups(). If there are nodes that do not exist in some groups, then the whole remove operation will fail and no nodes will be removed from any group.

The output from grouping list will be in the same format as the one used by the storage file. Note that the form in which the data is stored in the file will always end up being the form used by the logical grouping facility, and not necessarily the one a user used when the user built the logical file.

The third way to specify a logical grouping is to edit directly the storage file used. The default location of the logical group can be found at:

    <user install directory>/etc/orcm-default-config.xml

Remember that orcm-default-config.xml will contain other sections like workflows, ipmi etc. too

In addition, the user may want to put all the logical groups in a specific file. Logical group allows users to specify their own logical group file with -l or --omca logical_group_config_file parameter. For example:

In batch mode
    octl -l my_file
    octl --omca logical_group_config_file my_file

Interactive mode
    octl -l my_file grouping add group1 node1
    octl --omca logical_group_config_file my_file grouping add group1 node1

When the orcmd starts, it first reads the logical group file (if the file is not in the default location, use -l or --omca logical_group_configure_file to specify) and loads all the groups in memory. Therefore, all the groups should be defined before starting orcmd. After starting orcmd, the modifications of the logical group do not take effects.

The logicalgroup contents are stored in a XML file in limited ASCII format. The format is as follows:

= The acceptable text characters are ASCII characters inclusively from ASCII 33 to ASCII 126.
= The character # (ASCII 35), if it is the first character of a line, causes the line to be ignored.
= <group> is an element with a name attribute and members element in it.
= name attribute is a text string with acceptable ASCII characters.
= <memebrs> element is a comma separated list of regex specifying nodes:
    node[2:1-100],node201
= Duplicated members are removed from one group.

A sample logical group section in orcm-default-config.xml is as follows

    <logicalgroup>
        <group name="rack">
            <members>rack1,rack2,rack[1:3-4]</members>
        </group>
    </logicalgroup>

The following example imitates what on can do for setting up a file holding tags for a small cluster. First, assuming that the storage file does not already exist, one could perform the following commands:

./octl grouping add Cluster cluster1
./octl grouping add Row row1
./octl grouping add Rack rack[1:1-2]
./octl grouping add CN node[1:1-4]
./octl grouping add Row1 rack[1:1-2]
./octl grouping add Rack1 node[1:1-2]
./octl grouping add Rack2 node[1:3-4]

Using the command

./octl grouping list '*' '*'

can be used to confirm what we have added to logical groups. Note the use of single quotes in order to prevent Shell expansion for the interactive mode. Listing for Rack1 yields

./octl grouping list Rack1 '*'
group name=Rack1
member list=node1,node2

Having confirm that then one could use this grouping to get the sensor inventory:

./octl sensor get inventory '$'Rack1

which will output the inventory for nodes "node1" and "node2".

In addition, logical group supports nested group parsing. For example, with the above logical groups, if the user wants to list the sensor inventory for all the nodes (node1, node2, node3, node4) in the row1, he/she can simply do:

./octl sensor get inventory '$'Row

which will be parsed all the way from row to rack to compute nodes.

Clone this wiki locally