addrgmbr

Name

addrgmbr - Adds one or more resources to a resource group.

Synopsis

addrgmbr [-h] [-f data_input_file] [-T] [-V]

addrgmbr [-h] -s [-m T | F] [-p A | O[,Failback] [-T] [-V] -g Resource_group Resource_class:"selection_string" [Resource_class:"selection_string" [...]]

addrgmbr [-h] [-m T | F] [-p A |O[,Failback] [-T] [-V] -g Resource_group Resource_class:Resource_name[:Node][, Resource_name[:Node][, ...]] [Resource_class:Resource_name[:Node][,Resource_name[:Node][, ...]] [...]]

addrgmbr [-r 0 | AutomaticRecovery | 1 | LockOnResFailure | 2 | LockOnAnyFailure]

Description

The addrgmbr command adds one or more new resources to a resource group. If a data_input_file and the -f option is not specified, then either a selection string or a resource name must be specified when this command is used. A resource name or selection string must be specified with the resource class to which it belongs. A fixed resource must include the resource class and the node name at which it is located. A member resource cannot be included in more than one resource group at the same time. A member resource cannot be in a resource group and in an equivalency at the same time. Each member of the resource group must exist as an RMC resource before it is added to a resource group. A resource group member can be defined only on an online node in a cluster.

You can add multiple resources to a resource group if they are offline and if the nominal state of the resource group is offline. If the OpState of a resource to be added is online, the addition of that resource would cause an immediate stop of that resource. If the resource is stopping, the addition of another resource is rejected.

Member resources and their attribute flags can be specified on the command prompt as the syntax indicates or from a file when used with the -f option. The value must be the same data type that is defined for this resource attribute. Use the lsrsrcdef command to verify the data type and attribute field for each attribute.

Options

-f data_input_file
Name of the file, which contains member resource attribute information.
-g Resource_group
The unique name of the resource group, to which the member resources are to be added. This represents the MemberOf attribute of the managed resource.
-h
Help. Writes the command's usage statement to standard output.
-m T|F
Mandatory Attribute. Specifies whether this managed resource is required in the resource group.
T
TRUE (the Default). These managed resources are required by the resource group.
F
FALSE. These managed resources are not required by the resource group.
-p A|O[,Failback]
Specifies the method to be used when a node is selected to place the resource on. The value can be:
A
Any.
O
Ordered. Default value.
Failback
Optional. Occurrence as comma-separated value. In combination with O (Ordered) only.
-s
Specifies that a selection string is used instead of the resource name.
-T
Writes the command's trace messages to standard error. For your software-service organization's use only.
-V
Writes the command's verbose messages to standard output.
-r 0 | AutomaticRecovery | 1 | LockOnResFailure | 2 | LockOnAnyFailure
Specifies the RecoveryPolicy attribute that defines how the group member is recovered from a failure. The value can be:
0 | AutomaticRecovery
Automatically recover from the failure. Default value.
1 | LockOnResFailure
Process a lock request on the resource group if the member fails. Automatically recover the member if the node, which hosts the member fails.
2 | LockOnAnyFailure
Process a lock request on the resource group if the member or the hosting node fails.

Parameters

Resource_class:"selection_string"

Specifies the selection string. The -s option determines this parameter. Each selection string must be preceded by a resource class. The specified selection string is applied to its corresponding Resource_class attributes to determine which resources are to be made members of the Resource_group. The selection_string and its resource class must be separated by the colon or ": " delimiter.

The selection string must be enclosed within either double or single quotation marks. If the selection string contains double quotation marks, enclose the entire selection string in single quotation marks. For example:
-s IBM.Application:'Name == "testing"'
-s IBM.Application:'Name ?= "test"'
-s IBM.Application:'Name like "%"' ( For all resources)
Resource_class:Resource_name[:Node]
Member resources specify one or more member resources that are to be acted on. Resources belonging to different resource classes can also be specified by using this syntax. Member resources, which belong to different classes must be separated by spaces. A member resource is identified by the resource's class Resource_class, the resource's name Resource_name, and optionally the node Node the resource is on. The Resource_class, Resource, and Node must be separated by a colon. Resource_class is the name of the resource class the member resource belongs to. Resource is the name of the actual member resource in its class. The node must be included when it tries to act on a fixed member resource. The node and its resource must be separated by the colon or ":" delimiter. Multiple resources, which belong to the same resource class can also be specified and are separated by a comma:Resource_class:Resource[:Node][,Resource[:Node][,...]] The member resources must exist in the resource group for the requested action to take place.

Exit Status

0
The command ran successfully.
1
Error occurred with RMC.
2
Error occurred with CLI script.
3
Incorrect flag on command prompt.
4
Incorrect parameter on command prompt.
5
Error occurred with RMC that was based on faulty command prompt input.
6
The specified resource was not found.
7
Resource exists.

Security

This command requires root authority, or a user ID with appropriate permissions. For more information, see Setting up non-root user Ids for the command line interface.

Examples

  1. To create member resources, which use the data input file, proceed as follows:
    1. To generate a template to aid in the defining of these resources in a file, enter the command:
      lsrsrcdef -i IBM.ManagedResource >/tmp/MgdR.rdef
    2. Edit the file /tmp/MgdR.rdef with your preferred file editor: (Enter values for all of the attributes, substituting an appropriate value for the type, or leave it blank if you want the default value.)
    3. Run the addrgmbr command with the file as follows:
      addrgmbr -f  /tmp/MgdR.rdef

    Sample data ínput file for addrgmbr:

    You can enter values for all of the attributes and thus change the value shown below, or remove the line with the attribute if you want the default value.

    PersistentResourceAttributes::
    resource 1:
    ManagedResource = IBM.Application:App1 
    MemberOf = "charmC" 
    resource 2: 
    ManagedResource = IBM.Application:Res2:saopt02 
    MemberOf = "charmC" 
    Mandatory = false
  2. To add a floating resource testerA belonging to resource class IBM.Application, as member to a resource group resA, enter:
    addrgmbr -g resA IBM.Application:testerA
  3. To add the floating resource testerA and testerB belonging to resource class IBM.Application, and the fixed resource ip1 of class IBM.ServiceIP, locating at node node1, as members to a resource group resA, enter:
    addrgmbr -g resA IBM.Application:testerA,testerB IBM.ServiceIP:ip1:node1
  4. To add selected member resources of the resource class IBM.Application, to a resource group resA as a mandatory resource, enter:
    addrgmbr -m T -g resA IBM.Application:testerA,resA

    Sample data input file:

    PersistentResourceAttributes::
    resource 1:
    ManagedResource = "0x001b 0xffff 0x35c05b13 0x00000000
         0x9a6ee5e0 0x0de8934c"
    MemberOf = "charmC"
    resource 2:
    ManagedResource = "0x001b 0xffff 0x35c05b13 0x00000000
         0xb4d7e1b0 0x0def4ba2"
    MemberOf = "charmC"
    Mandatory = 0
    NominalState = 0

Files

/usr/sbin/rsct/bin/addrgmbr
Location of the addrgmbr command.
data_input_file

See Also

The samctrl, chrel, chrg, chrgmbr, lsrg, mkrg, mkrel, rmrel, rmrg, rmrgmbr commands.

The rmccli general information file.

The Resource_Data_Input file