chrel
Name
chrel - Changes one or more managed relationships between resources.
Synopsis
chrel [-h] [-i] [-u a | d | r] -s "Selection_string" [-c relation_name] [-p relationship] [-o condition][-W New_Target_Class[:Resource_name[:Node][,New_Target_Class[:Resource_name[:Node][,…]]]]] [-w "New_Target_string"] [-T] [-V]
chrel [-h] [-i] [-u a | d | r] [-c relation_name] [-p relationship] [-o condition] [-W New_Target_Class[:Resource_name[:Node][,New_Target_Class[:Resource_name[:Node][,…]]]]] [-w "New_Target_string"] [-T] [-V] Managed_Relation
chrel [-h] [-i] [-u a | d | r] [-c relation_name] [-p relationship] [-o condition] [-W New_Target_Class[:Resource_name[:Node][,New_Target_Class [:Resource_name[: Node][,…]]]]] [-w "New_Target_string"] -S Source_Class[:Resource_name[:Node]] [-s "Source_string"] [-G Target_Class[:Resource_name[:Node][,Target_Class[:Resource_name[:Node][,…]]]] [-g "Target_string"] [-P Current_relationship] [-O Current_condition] [-T] [-V]
Description
The chrel command modifies a managed relationship between resources. The managed relationship is between a source resource and one or more target resources. The source resource must be a managed resource, which is either a member of a resource group or a resource group. The target resource does not have to be in a resource group. Managed relationships and their attributes can be specified on the command prompt as the syntax indicates. The attribute value must be of the same data type that is defined for the resource attribute. Use the lsrsrcdef command to verify the data type and attribute field for each attribute.
Options
- -u a | d | r|
- Update targets.
- a
- Add the specified new target resources to the relationship defined for the source resources.
- d
- Delete the specified new target resources from the relationship that is defined for the source resources.
- r
- Replaces (overwrites) the relationship that is defined for the source resource with the specified new target resources.
- -o condition
- Specifies the new condition to be used when a Location relationship
(Collocated, AntiCollocated, Affinity, or AntiAffinity) or a StartAfter
relationship (IfPossible condition only) is defined. The value can
be the numeric value or the word (not case-sensitive):
- 0x0000 or
NoCondition
- Specifies unconditional location relationship.
- 0x0001 or
IfOnline
- Specifies that the target resource is online.
- 0x0002 or
IfOffline
- Specifies that the target resource is offline, failed offline, or unknown.
- 0x0003 or
IfNotOnline
- Specifies that the target resource is not online.
- 0x0004 or
IfNotOffline
- Specifies that the target resource is not offline or failed offline.
- 0x0005 or
IfPossible
- Used with the StartAfter relationship. Specifies that the target resource group can be bypassed if it cannot be bound, in which case it ends up in Sacrificed state and the StartAfter relationship is ignored.
- 0x0000 or
- -O condition
- Specifies the condition value to query all the defined relationship
to find a match with an existing condition. The value can be the numeric
value or the word (not case-sensitive):
- 0x0000 or
NoCondition
- Specifies unconditional location relationship.
- 0x0001 or
IfOnline
- Specifies that the target resource is online.
- 0x0002 or
IfOffline
- Specifies that the target resource is offline, failed offline, or unknown.
- 0x0003 or
IfNotOnline
- Specifies that the target resource is not online.
- 0x0004 or
IfNotOffline
- Specifies that the target resource is not offline or failed offline.
- 0x0005 or
IfPossible
- Used with the StartAfter relationship. Specifies that the target resource group can be bypassed if it cannot be bound, in which case it ends up in Sacrificed state and the StartAfter relationship is ignored.
- 0x0000 or
- -g Target_string
- The Target_string is applied to all resources of the resource class
that is specified by the -G option, to determine the targets
of the relationship.
If the -g option is used to specify a target selection string, Resource_name and Node must not be specified for the -G option.
- -G Target_class:[Resource_name[:Node]]
-
Specifies the target resources to add, delete, or replace with the relationship. The target resource or resources is used with the source and any other specified query to find a match from all of the defined relationships. A target resource is identified by the resource's class (Target_class), the resource name (Resource_name), and, optionally, the node Node on which the resource is located. Target_class, Resource_name, and Node must be separated by colons. Multiple target resources can be specified and are separated by commas. The colons are required, but omitting Target_class or Resource_name causes the previously specified class or name to be used when multiple target resources are specified.
If the -g option is used to specify a target selection string, Resource_name and Node must not be specified for the -G option.
- -h
- Writes the command's usage statement to standard output.
- -i
- Interactive. Prompt before you change relationships.
- -c relation_name
- Specifies the new name for the specified managed relationship. The change-of-name can be applied only to one relationship. If a name change is required, Queries and Selection strings should match with only one relationship.
- -p relationship
- Specifies the new managed relationship to apply. The value can
be the numeric value or the word (not case-sensitive):
- 0x0001 or
Collocated
- Specifies that the source and the target resources are to be on the same node.
- 0x0002 or
AntiCollocated
- Specifies that the source and the target resources are to be on different nodes.
- 0x0003 or
Affinity
- Specifies that the source resource and its specified affinity resource are to be on the same node, if possible.
- 0x0004 or
AntiAffinity
- Specifies that the source resource and its specified affinity resource are to be on different nodes, if possible.
- 0x0005 or
IsStartable
- Specifies that the source and its target resources are startable.
- 0x0006 or
StartAfter
- Specifies that the source is to be started after the target resources.
- 0x0007 or
DependsOn
- Specifies that the target resources must be online before the
source resource is started.
- A DependsOn relationship also includes an implicit collocation between the source and target
resources (see the description of
Collocated relationship
in Collocated relationship. - If a target resource fails, the source resource is also stopped.
- A DependsOn relationship also includes an implicit collocation between the source and target
resources (see the description of
- 0x0008 or
DependsOnAny
- Specifies that the target must be online before the source resource is started. It is identical to the DependsOn relationship except that it does not provide the collocated constraint for the start sequence. Therefore, the source and target resources cannot be started on the same node.
- 0x0009 or
StopAfter
- Specifies that the source resource cannot be stopped until after the target resource brought offline.
- 0x000A or
ForcedDownBy
- Specifies that the source resource must be forced offline if either the target resource goes offline unexpectedly or the target resource itself is forced offline.
- 0x0001 or
- -P relationship
- Specifies the managed relationship value that is used to query all the defined relationships to
find a match. The value can be a numeric value or the word (not case-sensitive):
- 0x0001 or
Collocated
- Specifies that the source and the target resources are to be on the same node.
- 0x0002 or
AntiCollocated
- Specifies that the source and the target resources are to be on different nodes.
- 0x0003 or
Affinity
- Specifies that the source resource and its specified affinity resource are to be on the same node, if possible.
- 0x0004 or
AntiAffinity
- Specifies that the source resource and its specified affinity resource are to be on different nodes, if possible.
- 0x0005 or
IsStartable
- Specifies that the source and its target resources are startable.
- 0x0006 or
StartAfter
- Specifies that the source is to be started after the target resources.
- 0x0007 or
DependsOn
- Specifies that the target resources must be online before the source resource
is started.
- A DependsOn relationship also includes an implicit collocation between the
source and target resources. See the description of
Collocated relationship
in Collocated relationship. - If a target resource fails, the source resource is also stopped.
- A DependsOn relationship also includes an implicit collocation between the
source and target resources. See the description of
- 0x0008 or
DependsOnAny
- Specifies that the target must be online before the source resource is started. It is identical to the DependsOn relationship except that it does not provide the collocated constraint for the start sequence. Therefore, the source and target resources cannot be started on the same node.
- 0x0009 or
StopAfter
- Specifies that the source resource cannot be stopped until after the target resource is brought offline.
- 0x000A or
ForcedDownBy
- Specifies that the source resource must be forced offline if either the target resource goes offline unexpectedly or the target resource itself is forced offline.
- 0x0001 or
- -w New_Target_string
- Specifies the target selection string for the resources to add, delete, or replace with the
relationship. New_Target_string is applied to all resources
of the resource class that is specified by the -G option to
determine the targets of the relationship.
If the -g option is used to specify a target selection string, Resource_name and Node must not be specified for the -G option.
- -W New_Target_Class: Resource_name[: Node]
- New Target resources. These resources are added, deleted, or replaced as required to or from the
current list of target resources for the matching relationships. A target 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_name
and Node must be separated by a colon. Multiple target
resources can be specified and are separated by a comma. The colons are required but
omitting the Resource_class or
Resource_name causes the previously specified class or
name to be used, when multiple target resources are specified.
If the -g option is used to specify a target selection string, Resource_name and Node must not be specified for -G.
- -s Selection_string
-
Specifies the source selection string of the relationship to change. Selection_string is applied to all resources of the resource class that is specified by the -S option to determine the source of the relationship. The result of the selection can contain one or more resources.
If the -s option is used to specify a source selection string, Resource_name and Node must not be specified for the -S option.
- -S Source_class:[Resource_name[:Node]]
-
Specifies the source resource of the relationship to change. A source resource is identified by the resource class (Resource_class) of the resource, the resource name (Resource_name), and, optionally, the node (Node) at which the resource is located. The result of the selection can contain one or more resources.
If the -s option is used to specify a source selection string, Resource_name and Node must not be specified for the -S option.
- -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
- Managed_Relation
- Name of the managed relationship to be changed. Using the -c option, even the name of the relationship can be modified.
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 line input.
- 6
- Resource specified 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
- To add a relationship for a resource
tester
that belongs to resource classIBM.Application
with target resources from resource classIBM.Application
, whoseResourceType
is set to zero, enter:chrel -u a -S IBM.Application:tester -W IBM.Application -w "ResourceType==0" -G IBM.Application -g "ResourceType==1"
- To modify a relationship for a source resource
narten
that belongs to resource classIBM.Application
to add resourcestr0
anden0
of resource classIBM.NetworkInterface
, enter:chrel -u a -S IBM.Application:narten -W IBM.NetworkInterface:tr0,:en0
Files
- /usr/sbin/rsct/bin/chrel
- Location of the chrel command.
See Also
The addrgmbr, chequ, chrg, chrgmbr, lsrg, mkequ, mkrel, mkrg, rmequ, rmrel, rmrg, rmrgmbr commands.
The rmccli general information file.