Purpose
Removes a defined resource.
Syntax
To remove one or more resource.
- entered on the command line:
rmrsrc -s "selection_string"
[ -a │ -N { node_file │ "-" }
] [-h] [-TV] resource_class
rmrsrc -r "resource_handle"
[-h] [-TV]
- predefined in an input file:
rmrsrc -f resource_data_input_file -s "selection_string"
[ -a │ -N { node_file │ "-" }
] [-h] [-TV] resource_class
rmrsrc -f resource_data_input_file -r "resource_handle"
[-h] [-TV]
To display the names and datatypes of the command arguments:
rmrsrc -l [-h] resource_class
Description
The rmrsrc command
removes — or "undefines" — the specified resource instance (or instances).
The rmrsrc command makes a request to the
resource monitoring and control (RMC) subsystem to undefine a specific
resource instance. The resource manager of the resource removes the
resource.
The first format of this command requires a resource
class name parameter and a selection string specified using the -s flag.
All resources in the specified resource class that match the specified
selection string are removed. If the selection string identifies more
than one resource to be removed, it is the same as running this command
once for each resource that matches the selection string.
The
second format of this command allows the actual resource handle linked
with a specific resource to be specified as the parameter. It is expected
that this form of the command would be more likely used from within
a script.
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.
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 nodes in the cluster.
The cluster scope is determined by the CT_MANAGEMENT_SCOPE environment
variable. If it is not set, first the management domain scope is chosen
if it exists, then the peer domain scope is chosen if it exists, and
then local scope is chosen, until the scope is valid for the command.
The command will run once for the first valid scope found. For
example, if both a management and peer domain exist, rmrsrc
-a with CT_MANAGEMENT_SCOPE not
set will apply to the management domain. In this case, to apply to
the peer domain, set CT_MANAGEMENT_SCOPE to 2.
- -f resource_data_input_file
- Specifies the name of the file that contains resource argument
information.
- -l
- Lists the command arguments and datatypes. Some resource
managers accept additional arguments that are passed to the remove
request. Use this flag to list any defined command arguments and
the datatypes 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
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 "resource_handle"
- Specifies a resource handle. The resource handle must be specified
using the format: "0xnnnn 0xnnnn 0xnnnnnnnn 0xnnnnnnnn 0xnnnnnnnn 0xnnnnnnnn",
where n is any valid hexadecimal digit.
The resource handle uniquely identifies a particular resource instance
that should be removed.
- -s "selection_string"
- Specifies a 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:
-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 .
- -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
- resource_class
- Specifies the resource class name. The resource instances for
this resource class that match the selection string criteria are removed.
Security
The user needs write permission
for the resource_class specified in rmrsrc to
run rmrsrc. 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.
The command output and all verbose messages are written
to standard output.
Standard Error
All trace messages are written
to standard error.
Examples
- To remove the resource with the Name c175n05 from resource class IBM®.Host, enter:
rmrsrc -s 'Name == "c175n05"' IBM.Host
- To remove the resource linked with resource handle: "0x4017 0x0001
0x00000000 0x0069684c 0x0d52332b3 0xf3f54b45", enter:
rmrsrc -r "0x4017 0x0001 0x00000000 0x0069684c 0x0d52332b3 0xf3f54b45"
- To remove the resources named Test1 from IBM.Foo for
certain nodes in the cluster, using the /tmp/common/node_file file:
# common node file
#
node1.ibm.com main node
node2.ibm.com main node
node4.ibm.com backup node
node6.ibm.com backup node
#
as input, enter: rmrsrc -s 'Name == "Test1"' -N /tmp/common/node_file IBM.Foo
Location
- /usr/sbin/rsct/bin/rmrsrc