chrsrc Command

Purpose

Changes the persistent attribute values of a resource or a resource class.

Syntax

To change the persistent attribute values of a resource, using data that is...
  • entered on the command line:

    chrsrc -s "selection_string" [ -a-N { node_file"-" } ] [-v] [-h] [-TV] resource_class attr=value

    chrsrc -r [-v] [-h] [-TV] resource_handle attr=value

  • predefined in an input file:

    chrsrc -f resource_data_input_file -s "selection_string" [-a-N { node_file"-" } ] [-v] [-h] [-TV] resource_class

    chrsrc -f resource_data_input_file -r [-v] [-h] [-TV] resource_handle

To change the persistent attribute values of a resource class, using data that is...
  • entered on the command line:

    chrsrc { -c-C domain_name… } [-v [-a] [-h] [-TV] resource_class attr=value

  • predefined in an input file:

    chrsrc -f resource_data_input_file { -c-C domain_name… } [-v] [-a] [-h] [-TV] resource_class

Description

The chrsrc command changes the persistent attribute values of a resource or a resource class. By default, this command changes the persistent attribute values of a resource. Use the -r flag to change only the persistent attribute values of the resource that is linked with resource_handle. Use the -s flag to change the persistent attribute values of all of the resources that match selection_string. To change the persistent attributes of a resource class, use the -c flag.

Instead of specifying multiple node names in selection_string, you can use the -N node_file flag to indicate that the node names are in a file. Use -N "-" to read the node names from standard input.

The chrsrc command cannot change dynamic attributes, nor can it change persistent attributes that are designated as read_only. To verify that all of the attribute names that are specified on the command line or in resource_data_input_file are defined as persistent attributes and are not designated as read_only, use the -v flag. When the chrsrc command is run with the -v flag, the specified attributes are not changed, but are instead merely verified to be persistent and not designated as read_only. Once you run chrsrc -v to verify that the attributes that are specified on the command line or in resource_data_input_file are valid, you can issue the chrsrc command without the -v flag to actually change the attribute values. Note, however, that just because an attribute "passes" when chrsrc -v is run does not ensure that the attribute can be changed. The underlying resource manager that controls the specified resource determines which attributes can be changed by the chrsrc command. After chrsrc is run without the -v flag, an error message will indicate whether any specified attribute could not be changed.

If Cluster Systems Management (CSM) is installed on your system, you can use CSM defined node groups as node name values to refer to more than one node. For information about working with CSM node groups and using the CSM nodegrp command, see the CSM: Administration Guide and the CSM: Command and Technical Reference.

Flags

-a
Specifies that this command applies to all of the nodes in the cluster. The CT_MANAGEMENT_SCOPE environment variable determines the scope of the cluster. If CT_MANAGEMENT_SCOPE is not set, management domain scope is chosen first (if a management domain exists), peer domain scope is chosen next (if a peer domain exists), and then local scope is chosen, until the scope is valid for the command. The command runs once for the first valid scope it finds. For example, if a management domain and a peer domain both exist and CT_MANAGEMENT_SCOPE is not set, this command applies to the management domain. If you want this command to apply to the peer domain, set CT_MANAGEMENT_SCOPE to 2.
-c
Changes the persistent attribute values for resource_class.
-C domain_name…
Changes the class attributes of a globalized resource class on one or more RSCT peer domains that are defined on the management server. Globalized classes are used in peer domains and management domains for resource classes that contain information about the domain.

To change class attributes of a globalized resource class on all peer domains defined on the management server, use the -c flag with the -a flag instead of -C.

-f resource_data_input_file
Specifies the name of the file that contains resource attribute information.
-N { node_file "-" }
Specifies that node names are read from a file or from standard input. Use -N node_file to indicate that the node names are in a file.
  • There is one node name per line in node_file
  • A number sign (#) in column 1 indicates that the line is a comment
  • Any blank characters to the left of a node name are ignored
  • Any characters to the right of a node name are ignored
Use -N "-" to read the node names from standard input.

The CT_MANAGEMENT_SCOPE environment variable determines the scope of the cluster. If CT_MANAGEMENT_SCOPE is not set, management domain scope is chosen first (if a management domain exists), peer domain scope is chosen next (if a peer domain exists), and then local scope is chosen, until the scope is valid for the command. The command runs once for the first valid scope it finds. For example, if a management domain and a peer domain both exist and CT_MANAGEMENT_SCOPE is not set, this command applies to the management domain. If you want this command to apply to the peer domain, set CT_MANAGEMENT_SCOPE to 2.

-r
Changes the persistent attribute values for the specific resource that matches resource_handle.
-s "selection_string"
Changes the persistent attribute values for all of the resources that match selection_string. selection_string must be enclosed within either double or single quotation marks. If selection_string contains double quotation marks, enclose it in single quotation marks, for example:
-s 'Name == "testing"'
-s 'Name ?= "test"'

Only persistent attributes can be listed in a selection string. For information on how to specify selection strings, see the RSCT: Administration Guide.

-v
Verifies that all of the attribute names specified on the command line or in the input file are defined as persistent attributes and are not designated as read_only. The chrsrc command does not change any persistent attribute values when you use this flag.
-h
Writes the command's usage statement to standard output.
-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.

Parameters

attr=value
Specifies one or more pairs of attributes and their associated values. attr is any defined persistent attribute name. Use the lsrsrcdef command to display a list of the defined persistent attributes and their datatypes for the specified resource. The value specified must be the appropriate datatype for the associated attribute. For example, if NodeNumber is defined as a Uint32 datatype, enter a positive numeric value.

Do not specify this parameter if you run chrsrc with the -f flag.

resource_class
Specifies a resource class name. Use the lsrsrcdef command to display a list of defined resource class names.
resource_handle
Specifies a resource handle that is linked with the resource that you want to change. Use the lsrsrc command to display a list of valid resource handles. The resource handle must be enclosed within double quotation marks, for example:
"0x4017 0x0001 0x00000000 0x0069684c 0x0d4715b0 0xe9635f69"

Security

The user needs write permission for the resource_class specified in chrsrc to run chrsrc. Permissions are specified in the access control list (ACL) file on the contacted system. See the RSCT: Administration Guide for information about the ACL file and how to modify it.

Exit Status

0
The command has run successfully.
1
An error occurred with RMC.
2
An error occurred with the command-line interface (CLI) script.
3
An incorrect flag was specified on the command line.
4
An incorrect parameter was specified on the command line.
5
An error occurred with RMC that was based on incorrect command-line input.
6
No resources were found that match the selection string.

Environment Variables

CT_CONTACT
When the CT_CONTACT environment variable is set to a host name or IP address, the command contacts the resource monitoring and control (RMC) daemon on the specified host. If the environment variable is not set, the command contacts the RMC daemon on the local system where the command is being run. The resource class or resources that are displayed or modified by the command are located on the system to which the connection is established.
CT_IP_AUTHENT
When the CT_IP_AUTHENT environment variable exists, the RMC daemon uses IP-based network authentication to contact the RMC daemon on the system that is specified by the IP address to which the CT_CONTACT environment variable is set. CT_IP_AUTHENT only has meaning if CT_CONTACT is set to an IP address; it does not rely on the domain name system (DNS) service.
CT_MANAGEMENT_SCOPE
Determines the management scope that is used for the session with the RMC daemon to monitor and control the resources and resource classes. The management scope determines the set of possible target nodes where the resources and resource classes can be monitored and controlled. The valid values are:
0
Specifies local scope.
1
Specifies local scope.
2
Specifies peer domain scope.
3
Specifies management domain scope.

If this environment variable is not set, local scope is used.

Implementation Specifics

This command is part of the Reliable Scalable Cluster Technology (RSCT) fileset for AIX®.

Standard Output

When the -h flag is specified, this command's usage statement is written to standard output. All verbose messages are written to standard output.

Standard Error

All trace messages are written to standard error.

Examples

  1. To change the Int32, Uint32 and SD persistent resource attributes in resource class IBM.Foo for the resources that have a Name equal to c175n05, enter:
    chrsrc -s 'Name == "c175n05"' IBM.Foo \
    Int32=-9999 Uint32=9999\
    SD='["testing 1 2 3",1,{2,4,6}]'
  2. To change the Int32, Uint32 and SD resource attributes in resource class IBM.Foo for the resource that has a Name starting with c175n, using resource_data_input_file with the following contents:
    PersistentResourceAttributes::
    resource 1: 
         Int32  = -9999
         Uint32 = 9999
         SD     = ["testing 1 2 3",1,{2,4,6}]
    enter:
    chrsrc -f /tmp/IBM.Foo.chrsrc \ 
    -s 'Name ?= "c175n"' IBM.Foo
  3. To change the Name persistent resource attribute for the resource that has a resource handle equal to "0x0001 0x4005 0x35ae868c 0x00000000 0xfeef2948 0x0d80b827", enter:
    chrsrc -r "0x0001 0x4005 0x35ae868c 0x00000000 0xfeef2948 0x0d80b827" Name="c175n05"
        
  4. To change the Int32, Uint32 and SD persistent resource attributes in resource class IBM.Foo for the resources that have a Name equal to Test_Name on nodes node1.linwood.com and node2.linwood.com in the cluster, using the /u/joe/common_nodes file:
    # common node file
    #
    node1.linwood.com      main node
    node2.linwood.com      backup node
    #
    as input, enter:
    chrsrc -s 'Name == "Test_Name"' -N /u/joe/common_nodes IBM.Foo \
    Int32=-9999 Uint32=9999 \
    SD='["testing 1 2 3",1,{2,4,6}]'

Location

/usr/sbin/rsct/bin/chrsrc