stoprsrc Command
Purpose
Stops a resource (that is, takes it offline).
Syntax
To stop one or more resources, using data entered on the command line:
stoprsrc -s "selection_string" [ -N { node_file │ "-" } ] [-h] [-TV] resource_class [arg=value...]
stoprsrc -r [-h] [-TV] resource_handle [arg=value...]
To stop one or more resources using command arguments that are predefined in an input file:
stoprsrc -f resource_data_input_file -s "selection_string" [ -N { node_file │ "-" } ] [-h] [-TV] resource_class
stoprsrc -f resource_data_input_file -r [-h] [-TV] resource_handle
To list the names and data types of the command arguments:
stoprsrc -l [-h] resource_class
Description
The stoprsrc command requests that the resource monitoring and control (RMC) subsystem take one or more resources offline. The request is performed by the appropriate resource manager.
To stop one or more resources, use the -s flag to take offline all of the resources that match the specified selection string.
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.
To stop one specific resource, use the -r flag to specify the resource handle that represents that specific resource.
Use the -l flag to determine whether the specified resource class accepts any additional command arguments.
If Cluster Systems Management (CSM) is installed on your system, yYou 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.
lsrsrc -s 'Name == "/filesys1"' -t IBM.FileSystem Name OpState
Parameters
- resource_class
- Specifies the name of the resource class that contains the resources that you want to take offline.
- resource_handle
- Specifies the resource handle that corresponds to the resource
you want to take offline. Use the lsrsrc command
to obtain a list of valid resource handles. The resource handle must
be enclosed within double quotation marks, for example:
"0x4017 0x0001 0x00000000 0x0069684c 0x0d4715b0 0xe9635f69"
- arg=value...
- Specifies one or more pairs of command argument names and values.
- arg
- Specifies the argument name.
- value
- Specifies the value for this argument. The value datatype must match the definition of the argument datatype.
Use stoprsrc -l to get a list of the command argument names and datatypes for the specific resource class.
Flags
- -f resource_data_input_file
- Specifies the name of the file that contains resource argument
information. The contents of the file would look like this:
PersistentResourceArguments:: argument1 = value1 argument2 = value2
- -l
- Lists the command arguments and data types. Some resource managers accept additional arguments that are passed to the offline request. Use this flag to list any defined command arguments and the data types of the command argument values.
- -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
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.
- -s "selection_string"
- Specifies the selection string. All selection strings 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:
Only persistent attributes can be listed in a selection string.-s 'Name == "testing"' -s 'Name ?= "test"'
- -h
- Writes the command usage statement to standard output.
- -T
- Writes the command trace messages to standard error. For your software service organization use only.
- -V
- Writes the command verbose messages (if there are any available) to standard output.
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 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.
Standard output
When the -h flag is specified, this command usage statement is written to standard output. When the -V flag is specified, this command verbose messages (if there are any available) are written to standard output.
Standard error
All trace messages are written to standard error.
Exit status
- 0
- The command ran 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 specified selection string.
Security
You need write permission for the resource_class specified in stoprsrc to run stoprsrc. Permissions are specified in the access control list (ACL) file on the contacted system. See the Administering RSCT guide for information about the ACL file and how to modify it.
Implementation specifics
This command is part of the rsct.core.rmc fileset for the AIX® operating system.
Location
- /opt/rsct/bin/stoprsrc
Examples
- Suppose nodeA is online and ent0 (on nodeA)
is also online. To take ent0 offline on nodeA,
run this command on nodeA:
stoprsrc -s 'Name == "ent0"' IBM.EthernetDevice
- Suppose nodeA and nodeB are
online, ent0 (on nodeA)
is also online, and you are currently logged on to nodeB.
To take ent0 offline on nodeA,
run this command on nodeB:
stoprsrc -s 'NodeName == "A" AND Name == "ent0"' IBM.EthernetDevice
- Suppose nodeA and nodeB are
online and file system /filesys1 is defined
and mounted on nodeB. To take /filesys1 offline
on nodeB, run this command on nodeA:
stoprsrc -s 'NodeName == "B" AND Name == "/filesys1"' IBM.FileSystem
- Suppose the resource handle for ent0 on nodeA is:
To take ent0 offline on nodeA, run this command on nodeA:0x406b 0x0001 0x00000000 0x0069564c 0x0dc1f272 0xb9de145e
stoprsrc -r "0x406b 0x0001 0x00000000 0x0069564c 0x0dc1f272 0xb9de145e"