Configuration to enable external host and user groups

To enable the use of external host and user groups, you must
  • Define the host group in lsb.hosts, or the user group in lsb.users, and put an exclamation mark (!) in the GROUP_MEMBER column.

  • Create an egroup executable in the directory specified by the environment variable LSF_SERVERDIR in lsf.conf. LSF does not include a default egroup; you should write your own executable to meet the requirements of your site.

  • Run the badmin reconfig command first to reconfigure the cluster, then wait for the cluster to be automatically reconfigured with the updated external user groups.

  • The reconfiguration for external user groups (egroups) is done automatically according to the time interval you specify in EGROUP_UPDATE_INTERVAL.

Define an external host or user group

External host groups are defined in lsb.hosts, and external user groups are defined in lsb.users. Your egroup executable must define the same group names that you use in the lsb.hosts and lsb.users configuration files.

Configuration file

Parameter and syntax

Default behavior

lsb.hosts

GROUP_NAME GROUP_MEMBER

hostgroup_name (!)

  • Enables the use of an egroup executable to retrieve external host group members.

  • The hostgroup_name specified in lsb.hosts must correspond to the group name defined by the egroup executable.

  • You can configure one or more host groups to use the egroup executable.

  • LSF does not support the use of external host groups that contain dynamically added hosts.

lsb.users

GROUP_NAME GROUP_MEMBER

usergroup_name (!)

  • Enables the use of an egroup executable to retrieve external user group members.

  • The usergroup_name specified in lsb.users must correspond to the group name defined by the egroup executable.

  • You can configure one or more user groups to use the egroup executable.

Create an egroup executable

The egroup executable must
  • Be located in LSF_SERVERDIR and follow these naming conventions:

    Operating system

    Naming convention

    UNIX

    LSF_SERVERDIR/egroup

    Windows

    LSF_SERVERDIR\egroup.exe

    or

    LSF_SERVERDIR\egroup.bat

  • Run when invoked by the commands egroup –m hostgroup_name and egroup –u usergroup_name. When mbatchd finds an exclamation mark (!) in the GROUP_MEMBER column of lsb.hosts or lsb.users, mbatchd runs the egroup command to invoke your egroup executable.

  • Output a space-delimited list of group members (hosts, users, or both) to stdout.

  • Retrieve a list of static hosts only. You cannot use the egroup executable to retrieve hosts that have been dynamically added to the cluster.

The following example shows a simple egroup script that retrieves both host and user group members:

#!/bin/sh
if [ "$1" = "-m" ]; then #host group
    if [ "$2" = "linux_grp" ]; then #Linux hostgroup
        echo "linux01 linux 02 linux03 linux04"
    elif [ "$2" = "sol_grp" ]; then #Solaris hostgroup
        echo "Sol02 Sol02 Sol03 Sol04"
    fi
else #user group
   if [ "$2" = "srv_grp" ]; then #srvgrp user group
       echo "userA userB userC userD"
   elif [ "$2" = "dev_grp" ]; then #devgrp user group
       echo "user1 user2 user3 user4"
   fi
fi