Go to main content

Reference for Oracle Solaris Cluster 4.4

Exit Print View

Updated: August 2018
 
 

clresource (8CL)

Name

clresource, clrs - manage resources for Oracle Solaris Cluster data services

Synopsis

/usr/cluster/bin/clresource subcommand [-?]
/usr/cluster/bin/clresource -V
/usr/cluster/bin/clresource subcommand [options] -v [resource]…
/usr/cluster/bin/clresource clear [-f errorflag] [-g [resource-group[,…]] 
[-t [resource-type[,…]] -n node[,…]] [-Z {zone-cluster-name | global}] 
{+ | resource…}
/usr/cluster/bin/clresource create -g resource-group -t resource-type 
[-d] [-p "property-name[{node-specifier,…}]"=value] 
[-x "extension-property[{node-specifier[,…]}]"=value] [-y standard-property=value] 
[-Z {zone-cluster-name | global}] 
resource
/usr/cluster/bin/clresource create -i {- | clconfiguration} -t resource-type 
[-a] [-d] [-g [resource-group[,…]] [-p "property-name[{node-specifier,…}]"=value] 
[-x "extension-property[{node-specifier[,…]}]"=value] 
[-y standard-property=value] {+ | resource…}
/usr/cluster/bin/clresource delete [-F] [-g [resource-group[,…]] 
[-t [resource-type[,…]] [-Z {zone-cluster-name | global}] 
{+ | resource…}
/usr/cluster/bin/clresource disable [-R] [-g [resource-group[,…]] 
[-t [resource-type[,…]] [-n node[,…]] 
[-Z {zone-cluster-name | global}] {+ | resource…}
/usr/cluster/bin/clresource enable [-R] [-g [resource-group[,…]] 
[-t [resource-type[,…]] [ -n node[,…]] 
[-Z {zone-cluster-name | global}] {+ | resource…}
/usr/cluster/bin/clresource export [-o {- | configfile}] 
 [+ | resource…]
/usr/cluster/bin/clresource list [-g [resource-group[,…]] 
[-t [resource-type[,…]] [-Z {zone-cluster-name[,…] | global | all}] 
[+ | resource…]
/usr/cluster/bin/clresource list-props [-l listtype] 
[-g [resource-group,]…] [-p "property-name[{node-specifier[,…]}]"[,…]] 
[-t [resource-type[,…]] [-x "extension-property[{node-specifier[,…]}]"…] 
[-y "standard-property[{node-specifier,…}]"[,…]] 
[-Z {zone-cluster-name[,…] | global | all}] [+ | resource…]
/usr/cluster/bin/clresource monitor [-g [resource-group[,…]] 
[-t [resource-type[,…]] [ -n node[,…]] 
[-Z {zone-cluster-name | global}] {+ | resource…}
/usr/cluster/bin/clresource set [-g [resource-group[,…]] 
[-p "property-name[{node-specifier,…}]"=value] 
[-t [resource-type[,…]] [-x "extension-property[{node-specifier,…}]"=value] 
[-y standard-property [+= | -=]value] [-Z {zone-cluster-name | global}] 
{+ | resource…}
/usr/cluster/bin/clresource show [-g [resource-group[,…]] 
[-p "property-name[{node-specifier[,…]}]"[,…]] [-t [resource-type[,…]] 
[-x "extension-property[{node-specifier,…}]"[,…]] 
[-y "standard-property[{node-specifier,…}]"[,…]] 
[-Z {zone-cluster-name[,…] | global | all}] 
[+ | resource…]
/usr/cluster/bin/clresource status [-g [resource-group[,…]] 
[-s [state[,…]] [-t [resource-type[,…]] [ -n node[,…]] 
[-Z {zone-cluster-name[,…] | global | all}] [+ | resource…]
/usr/cluster/bin/clresource unmonitor [-g [resource-group[,…]] 
[-t [resource-type[,…]] [ -n node[,…]] 
[-Z {zone-cluster-name | global}] {+ | resource…}

Description

The clresource command manages resources for Oracle Solaris Cluster data services. The clrs command is the short form of the clresource command. The clresource command and the clrs command are identical. You can use either form of the command.

The general form of this command is as follows:

clresource [subcommand] [options] [operands]

You can omit subcommand only if options specifies the –? option or the –V option.

Each option of this command has a long form and a short form. Both forms of each option are provided with the description of the option in the OPTIONS section of this man page.

Using This Command in a Zone Cluster

You can use the clresource command with all subcommands.

From the global cluster only, you can also use the –Z option with all subcommands except export to specify the name of a particular zone cluster to which you want to restrict an operation. And, you can also attach the zone-cluster name to a resource name (zone-cluster-name:resource) for all subcommands except export to restrict an operation to a particular zone cluster.

You can access all zone cluster information from a global-cluster node, but a particular zone cluster is not aware of other zone clusters. If you do not restrict an operation to a particular zone cluster, the subcommand you use operates in the current cluster only.

A resource in a zone cluster can have a dependency on a resource in another zone cluster or on a resource on the global cluster. Also, a resource from the global cluster can have a dependency on a resource in any of the zone clusters on that global cluster. The inter-cluster dependencies can be set only from the global cluster.

You can use the following command to specify the inter-cluster dependencies:

# clresource set \
-p resource_dependencies=target-zc:target-rs source-zc:source-rs

For example, if you need to specify a dependency from resource R1 in zone cluster ZC1 to a resource R2 in zone cluster ZC2, use the following command:

# clresource set -p resource_dependencies=ZC2:R2 ZC1:R1

If you need to specify a dependency of zone cluster ZC1 resource R1 on global-cluster resource R2, use the following command:

# clresource set -p resource_dependencies=global:R2 ZC1:R1

The existing resource dependencies (Strong, Weak, Restart, and Offline-Restart) are supported.

Resource State and Status

The resource state and resource status are maintained on a per-node basis. A given resource has a distinct state on each cluster node and a distinct status on each cluster node.

Resource Group Manager (RGM) sets the resource state on each node, based on which methods have been invoked on the resource. For example, after the STOP method has run successfully on a resource on a given node, the resource's state will be OFFLINE on that node. If the STOP method exits nonzero or times out, then the state of the resource is Stop_failed.

Possible resource states include the following:

  • Online

  • Offline

  • Start_failed

  • Stop_failed

  • Monitor_failed

  • Online_not_monitored

  • Starting

  • Stopping

  • Not_online


Note -  State names, such as Offline and Start_failed, are not case sensitive. You can use any combination of uppercase and lowercase letters when you specify state names.

In addition to resource state, the RGM also maintains a resource status that can be set by the resource itself by using the API. The field Status Message actually consists of two components: status keyword and status message. Status message is optionally set by the resource and is an arbitrary text string that is printed after the status keyword.

Descriptions of possible values for a resource's status are as follows:

DEGRADED

The resource is online, but its performance or availability might be compromised in some way.

FAULTED

The resource has encountered an error that prevents it from functioning.

OFFLINE

The resource is offline.

ONLINE

The resource is online and providing service.

UNKNOWN

The current status is unknown or is in transition.

Sub Commands

The following subcommands are supported:

clear

Clears an error flag that is associated with the resources that are specified as operands to the command. This subcommand accepts the plus sign (+) as an operand to specify that the error flag is cleared for all resources.

You can use this subcommand in the global cluster or in a zone cluster.

From a global-cluster node, you can use the –Z option to specify the name of a zone cluster on which to perform this operation. The –Z option is not valid when the command is run from a zone-cluster node.

The following options filter the list of operands to limit the resources on which an error flag is cleared:

–g resource-group

Clears only the resources in the list of operands that are members of the resource groups in resource-group.

–n node

Clears the resources on the specified node or nodes. If you do not provide an –n option, the command clears resources on all nodes.

–t resource-type

Clears only the resources in the list of operands that are instances of the resource types in resource-type.

–Z {zone-cluster-name | global}

Clears only the resources in the particular cluster or clusters that you specify.

To clear the resources in a zone cluster from the global cluster, specify the zone cluster by using the –Z option.

By default, the clear subcommand clears the STOP_FAILED error flag. To specify explicitly the error flag that is to be cleared, use the –f option. The only error flag that the –f option accepts is the STOP_FAILED error flag.

Users other than the root role require solaris.cluster.admin authorization to use this subcommand.

create

Creates the resources that are specified as operands to the command.

You can use this subcommand in the global cluster or in a zone cluster.

From a global-cluster node, you can use the –Z option to specify the name of a zone cluster on which to perform this operation. The –Z option is not valid when the command is run from a zone-cluster node.

To create a resource in the specific zone cluster from the global cluster, you can use the –Z option to specify the name of the zone cluster.

When you use create with the –i option to specify a configuration file, the subcommand accepts the plus sign (+) as an operand. When you use the + operand, all resources in the configuration file that do not exist are created.

When you run create with the –i option in a zone cluster,  for all the resources that need to be created, remove any inter cluster dependency in the configuration file. For these resources, Inter-cluster dependencies need be re-configured in the global cluster after the resources  are created.

By default, resources are created in the enabled state with monitoring enabled. However, a resource is brought online and is monitored only after the resource's resource group is brought online. To create resources in the disabled state, specify the –d option.

Use the following options to set property values when creating a resource:

–p property-name=value

Sets standard or extension properties, as long as their names are unique.

–x extension-property=value

Sets extension properties.

–ystandard-property=value

Sets standard properties.

node-specifier is an optional qualifier to the –p and –x options. It indicates that the properties on only the specified node or nodes are to be set when the resource is created. The specified properties on other nodes in the cluster are not set. If you do not include node-specifier, the specified properties on all nodes in the cluster are set. Examples of the syntax of node-specifier include the following:

-x "myprop{phys-schost-1}"

The braces ({ }) indicate that you want to set the specified property on only node phys-schost-1. For most shells, braces must be quoted.

You can use the following syntax to set a property on two nodes:

-x "myprop{phys-schost-1,phys-schost-2}"

Users other than the root role require solaris.cluster.modify authorization to use this subcommand.

See also the description of the delete subcommand.

delete

Deletes the resources that are specified as operands to the command. This subcommand accepts the plus sign (+) as an operand to specify that all resources are deleted.

You can use this subcommand in the global cluster or in a zone cluster.

From a global-cluster node, you can use the –Z option to specify the name of a zone cluster on which to perform this operation. The –Z option is not valid when the command is run from a zone-cluster node.

This subcommand deletes multiple resources in the order that is required to satisfy dependencies between the resources. The subcommand disregards the order in which you specify resources on the command line.

When you delete multiple resources at the same time, the command is carried out in several steps. If the command is interrupted, for example, if a node fails, some resources might be left in an invalid configuration. To correct the problem and finish deleting the resources, reissue the same command on a healthy node.

The following options filter the list of operands to limit the resources that are deleted:

–g resource-group

Deletes only the resources in the list of operands that are members of the resource groups in resource-group.

–t resource-type

Deletes only the resources in the list of operands that are instances of the resource types in resource-type.

–Z {zone-cluster-name | global}

Deletes only the resources in the particular cluster or clusters that you specify.

To delete the resources in a zone cluster from the global cluster, specify the zone cluster by using the –Z option.

By default, a resource is deleted only if the following conditions are met:

  • The resource must be disabled.

  • All dependencies on the resource must be eliminated.

To force deletion of the specified resources, specify the –F option. Use this option with caution, because it has the following effects:

  • All specified resources are deleted, even resources that are not disabled.

  • All specified resources are removed from resource-dependency settings of other resources.

These effects might cause a loss of service in the cluster. Dependent resources that are not deleted might also be left in an invalid state or in an error state.

Users other than the root role require solaris.cluster.modify authorization to use this subcommand.

See also the description of the create subcommand.

disable

Disables the resources that are specified as operands to the command. This subcommand accepts the plus sign (+) as an operand to specify that all resources are disabled.

You can use this subcommand in the global cluster or in a zone cluster.

From a global-cluster node, you can use the –Z option to specify the name of a zone cluster on which to perform this operation. The –Z option is not valid when the command is run from a zone-cluster node.

The following options filter the list of operands to limit the resources that are disabled:

–g resource-group

Disables only the resources in the list of operands that are members of the resource groups in resource-group.

–n node

You can use –n node to disable resources on one or more nodes.

–t resource-type

Disables only the resources in the list of operands that are instances of the resource types in resource-type.

–Z {zone-cluster-name | global}

Disables only the resources in the particular cluster or clusters that you specify.

To delete the resources in a zone cluster from the global cluster, specify the zone cluster by using the –Z option.

The –R option disables any resources that depend on the resources that are specified as operands to the command. These resources are disabled even if the resources are not specified as operands to the command. The –g option and the –t option do not apply to resources that are to be disabled solely to satisfy resource dependencies.

This subcommand does not affect the monitoring status of the resource. If the resource was monitored when enabled, it is still monitored after the disable. If the resource is subsequently re-enabled, the resource is also monitored.

This subcommand disables resources in the order that is required to satisfy dependencies between the resources. The subcommand disregards the order in which resources are specified at the command line.

Users other than the root role require solaris.cluster.admin authorization to use this subcommand.

See also the description of the enable subcommand.

enable

Enables the resources that are specified as operands to the command. This subcommand accepts the plus sign (+) as an operand to specify that all resources are enabled.

You can use this subcommand in the global cluster or in a zone cluster.

From a global-cluster node, you can use the –Z option to specify the name of a zone cluster on which to perform this operation. The –Z option is not valid when the command is run from a zone-cluster node.

The following options filter the list of operands to limit the resources that are enabled:

–g resource-group

Enables only the resources in the list of operands that are members of the resource groups in resource-group.

–n node

You can use –n node to enable resources on one or more nodes.

–t resource-type

Enables only the resources in the list of operands that are instances of the resource types in resource-type.

–Z {zone-cluster-name | global}

Enables only the resources in the particular cluster or clusters that you specify.

To enable the resources in a zone cluster from the global cluster, specify the zone cluster by using the –Z option.

To ensure that all required resource dependencies are satisfied, specify the –R option. The –R option enables any resources on which the resources that are specified as operands to the command depend. These resources are enabled, even if the resources are not specified as operands to the command. The –g option and the –t option do not apply to resources that are to be enabled solely to satisfy resource dependencies.

Resources are enabled in the order that is required to satisfy dependencies between the resources. The subcommand disregards the order in which resources are specified at the command line.

Users other than the root role require solaris.cluster.admin authorization to use this subcommand.

See also the description of the disable subcommand.

export

Exports the cluster resource configuration in the format that is described by the clconfiguration (7CL) man page.

Users other than the root role require solaris.cluster.read authorization to use this subcommand.

list

Displays a list of the resources that are specified as operands to the command. By default, all resources are displayed.

You can use this subcommand in the global cluster or in a zone cluster.

From a global-cluster node, you can use the –Z option to specify the name of a zone cluster on which to perform this operation. The –Z option is not valid when the command is run from a zone-cluster node.

The following options filter the list of operands to limit the resources that are displayed:

–g resource-group

Displays only the resources in the list of operands that are members of the resource groups in resource-group.

–t resource-type

Displays only the resources that are instances of the resource types in resource-type.

–Z {zone-cluster-name | global | all}

Displays only the resources in the particular cluster or clusters that you specify. To display the resources in a zone cluster from the global cluster, specify the zone cluster by using the –Z option.

This subcommand accepts the plus sign (+) as an operand to specify that all the resource configuration is displayed. You can restrict the displayed information to specific resource groups or resource types by specifying a –g option or –t option. If no operands are supplied, all resources in the specified resource groups or that are instances of the specified resource types are displayed.

If you specify the –v option, the resource group and resource type of each resource in the list are also displayed.

Users other than the root role require solaris.cluster.read authorization to use this subcommand.

list-props

Displays a list of the properties of the resources that are specified as operands to the command.

You can use this subcommand in the global cluster or in a zone cluster.

From a global-cluster node, you can use the –Z option to specify the name of a zone cluster on which to perform this operation. The –Z option is not valid when the command is run from a zone-cluster node.

The following options filter the list of operands to limit the resources whose properties are displayed:

–g resource-group

Displays the properties only of the resources in the list of operands that are members of the resource groups in resource-group.

–t resource-type

Displays the properties only of the resources in the list of operands that are instances of the resource types in resource-type.

–Z {zone-cluster-name | global | all}

Lists the properties of resources in the particular cluster or clusters that you specify.

To list the resources in a zone cluster from the global cluster, specify the zone cluster by using the –Z option.

The –l option specifies the type of resource properties that are to be displayed:

–l all

Specifies that standard properties and extension properties are displayed.

–l extension

Specifies that only extension properties are displayed. By default, only extension properties are displayed.

–l standard

Specifies that only standard properties are displayed.

If you do not specify the –l option, only extension properties are displayed. To display standard properties, specify the properties explicitly by using the –p option or the –y option.

The following options limit the set of resource properties that is to be displayed:

–p property-name

Displays only the properties that are specified in property-name. You can specify standard properties and extension properties in property-name.

–x extension-property

Displays only the extension properties on one or more nodes that are specified in extension-property.

–y standard-property

Displays only the standard properties that are specified in standard-property.

node-specifier is an optional qualifier to the –p, –x, and –y options. It indicates that the properties on only the specified node or nodes, are to be displayed. The specified properties on other nodes in the cluster are not displayed. If you do not include node-specifier, the specified properties on all nodes in the cluster are displayed. Examples of the syntax of node-specifier include the following:

-x "myprop{phys-schost-1}"

The braces ({ }) indicate that you want to display the specified property on only node phys-schost-1. For most shells, braces must be quoted.

You can use the following syntax to display a property on two nodes:

-x "myprop{phys-schost-1,phys-schost-2}"

If you specify the –v option, the description of each property is also displayed.

This subcommand accepts the plus sign (+) as an operand to specify that all resource properties are displayed. If no operands are supplied, properties of all resources in the specified resource groups or that are instances of the specified resource types are displayed.

Users other than the root role require solaris.cluster.read authorization to use this subcommand.

monitor

Turns on monitoring for the resources that are specified as operands to the command. This subcommand accepts the plus sign (+) as an operand to specify that monitoring is turned on for all resources.

You can use this subcommand in the global cluster or in a zone cluster.

From a global-cluster node, you can use the –Z option to specify the name of a zone cluster on which to perform this operation. The –Z option is not valid when the command is run from a zone-cluster node.

The following options filter the list of operands to limit the resources for which monitoring is turned on:

–g resource-group

Turns on monitoring only for the resources in the list of operands that are members of the resource groups in resource-group.

–n node

Turns on monitoring for only those resources that are online on one or more nodes.

–t resource-type

Turns on monitoring only for the resources in the list of operands that are instances of the resource types in resource-type.

–Z {zone-cluster-name | global}

Turns on monitoring only for the resources in the particular cluster or clusters that you specify.

To turn on the resources in a zone cluster from the global cluster, specify the zone cluster by using the –Z option.

If monitoring is turned on for a resource, the resource is monitored only if the following conditions are met:

  • The resource is enabled.

  • The resource group that contains the resource is online on at least one cluster node.


Note -  When you turn on monitoring for a resource, you do not enable the resource.

Users other than the root role require solaris.cluster.admin authorization to use this subcommand.

See also the description of the unmonitor subcommand.

set

Sets specified properties of the resources that are specified as operands to the command. This subcommand accepts the plus sign (+) as an operand to specify that the specified properties of all resources are modified.

You can use this subcommand in the global cluster or in a zone cluster.

From a global-cluster node, you can use the –Z option to specify the name of a zone cluster on which to perform this operation. The –Z option is not valid when the command is run from a zone-cluster node.

The following options filter the list of operands to limit the resources for which properties are modified:

–g resource-group

Modifies properties of only the resources in the list of operands that are members of the resource groups in resource-group.

–t resource-type

Modifies properties of only the resources in the list of operands that are instances of the resource types in resource-type.

–Z {zone-cluster-name | global}

Sets the properties only for resources in the particular cluster or clusters that you specify.

To set the properties of resources in a zone cluster from the global cluster, specify the zone cluster by using the –Z option.

Users other than the root role require solaris.cluster.modify authorization to use this subcommand.

Use the following options to set property values:

–p property-name=value

Sets standard or extension properties, as long as their names are unique.

–x extension-property=value

Sets extension properties.

–y standard-property=value

Sets standard properties.

node-specifier is an optional qualifier to the –p and –x options for updating a per-node extension property. It indicates that the property is to be set on only the specified node or nodes. The specified property is not set on other nodes in the cluster. If you do not include node-specifier, the specified properties on all nodes in the cluster are set. Examples of the syntax of node-specifier include the following:

-x "myprop{phys-schost-1}"

The braces ({ }) indicate that you want to set the specified property on only node phys-schost-1. For most shells, braces must be quoted.

You can use the following syntax to set a property on two nodes:

-x "myprop{phys-schost-1,phys-schost-2}"
show

Displays the configuration of the resources that are specified as operands to the command. By default, the configuration of all resources is displayed.

You can use this subcommand in the global cluster or in a zone cluster.

From a global-cluster node, you can use the –Z option to specify the name of a zone cluster on which to perform this operation. The –Z option is not valid when the command is run from a zone-cluster node.

The following options filter the list of operands to limit the list of resources for which the configuration is displayed:

–g resource-group

Displays the configuration of only the resources in the list of operands that are members of the resource groups in resource-group.

–t resource-type

Displays the configuration of only the resources in the list of operands that are instances of the resource types in resource-type.

–Z {zone-cluster-name | global | all}

Displays only the resources in the particular cluster or clusters that you specify.

To display the resources in a zone cluster from the global cluster, specify the zone cluster by using the –Z option.

The following options limit the set of resource properties that are displayed:

–p property-name

Displays only the properties that are specified in property-name. You can specify standard properties and extension properties in property-name.

–x extension-property

Displays only the extension properties on one or more nodes that are specified in extension-property.

–y standard-property

Displays only the standard properties that are specified in standard-property.

node-specifier is an optional qualifier to the –p, –x, and –y options. It indicates that the properties on only the specified node or nodes, are to be displayed. The specified properties on other nodes in the cluster are not displayed. If you do not include node-specifier, the specified properties on all nodes in the cluster are displayed. Examples of the syntax of node-specifier include the following:

-x "myprop{phys-schost-1}"

The braces ({ }) indicate that you want to display the specified property on only node phys-schost-1. For most shells, braces must be quoted.

You can use the following syntax to display a property on two nodes:

-x "myprop{phys-schost-1,phys-schost-2}"

This subcommand accepts the plus sign (+) as an operand to specify all resource configuration is to be displayed. You can restrict the displayed information to specific resource groups or resource types by specifying a –g option or –t option. If you do not supply an operand, the subcommand displays the configuration of all specified resources.

Users other than the root role require solaris.cluster.read authorization to use this subcommand.

status

Displays the status of the resources that are specified as operands to the command. By default, the status of all resources is displayed.

You can use this subcommand in the global cluster or in a zone cluster.

From a global-cluster node, you can use the –Z option to specify the name of a zone cluster on which to perform this operation. The –Z option is not valid when the command is run from a zone-cluster node.

The following options filter the list of operands to limit the list of resources for which the status is displayed:

–g resource-group

Displays the status of only the resources in the list of operands that are members of the resource groups in resource-group.

–n node

You can use –n node to display the status of only those resources that are online on one or more nodes. You cannot specify the –n and –s options together.

–s state

Displays the status of only the resources in the list of operands that are in the states in state. You cannot specify the –n and –s options together.

–t resource-type

Displays the status of only the resources in the list of operands that are instances of the resource types in resource-type.

–Z {zone-cluster-name | global | all}

Displays the status of resources in the particular cluster or clusters that you specify.

To display the status of resources in a zone cluster from the global cluster, specify the zone cluster by using the –Z option.

This subcommand accepts the plus sign (+) as an operand to specify that the status of all resources is to be displayed. You can restrict the displayed information to specific resource groups or resource types by specifying a –g option or –t option. If no operands are supplied, the status of all specified resources is displayed.

Users other than the root role require solaris.cluster.read authorization to use this subcommand.

unmonitor

Turns off monitoring for the resources that are specified as operands to the command. This subcommand accepts the plus sign (+) as an operand to specify that monitoring is turned off for all resources.

You can use this subcommand in the global cluster or in a zone cluster.

From a global-cluster node, you can use the –Z option to specify the name of a zone cluster on which to perform this operation. The –Z option is not valid when the command is run from a zone-cluster node.

If you turn off monitoring for a resource that is disabled, the resource is not affected. The resource and its monitor are already offline.


Note -  When you turn off monitoring for a resource, you do not disable the resource. However, when you disable a resource, you do not need to turn off monitoring for the resource. The disabled resource and its monitor are kept offline.

The following options filter the list of operands to limit the resources for which monitoring is turned off:

–g resource-group

Turns off monitoring only for the resources in the list of operands that are members of the resource groups in resource-group.

–n node

Turns off monitoring for only those resources that are online on one or more nodes.

–t resource-type

Turns off monitoring only for the resources in the list of operands that are instances of the resource types in resource-type.

–Z {zone-cluster-name | global}

Turns off monitoring only for resources in the particular cluster or clusters that you specify.

To turn off the monitoring of resources in a zone cluster from the global cluster, specify the zone cluster by using the –Z option.

Users other than the root role require solaris.cluster.admin authorization to use this subcommand.

See also the description of the disable subcommand and the monitor subcommand.

Options

The following options are supported:

–?
–-help

Displays help information. When this option is used, no other processing is performed.

You can specify this option without a subcommand or with a subcommand.

If you specify this option without a subcommand, the list of subcommands for this command is displayed.

If you specify this option with a subcommand, the usage options for the subcommand are displayed.

–a
–-automatic

Automatically performs the following additional operations when resources are being created from a cluster configuration file (clconfiguration(7CL)):

  • Registering resource types

  • Creating resource groups

  • Creating resources on which the resources that are specified in the list of operands depend

The cluster configuration information must contain sufficient information to do all of the following:

  • Enable the resource types to be registered

  • Enable the resource groups to be created

  • Enable the resources to be created

You can specify this option only with the create subcommand. If you specify this option, you must also specify the –i option and provide a configuration file.

–d
–-disable

Disables a resource when the resource is created. You can specify this option only with the create subcommand. By default, resources are created in the enabled state.

Enabling a resource does not guarantee that the resource is brought online. A resource is brought online only after the resource's resource group is brought online on at least one node.

–f errorflag
–-flag=errorflag
–-flag errorflag

Specifies explicitly the error flag that is to be cleared by the clear subcommand. You can specify this option only with the clear subcommand. By default, the clear subcommand clears the STOP_FAILED error flag.

The only error flag that the –f option accepts is the STOP_FAILED error flag.

–F
–-force

Forces the deletion of resources that are not disabled. You can specify this option only with the delete subcommand.

Use this option with caution, because it has the following effects:

  • All specified resources are deleted, even resources that are not disabled.

  • All specified resources are removed from resource-dependency settings of other resources.

These effects might cause a loss of service in the cluster. Dependent resources that are not deleted might also be left in an invalid state or in an error state.

–g resource-group[,…]
–-resourcegroup=resource-group[,…]
–-resourcegroup resource-group[,…]

Specifies a resource group or a list of resource groups.

For subcommands except create, the command acts on only the resources in the list of operands that are members of the specified resource groups. Specify resource groups by using the –g option.

When you specify the –g option with the create subcommand, clresource creates the resource in the specified resource group. You can specify only one resource group when using this option.

–i {- | clconfiguration}
–-input={- | clconfiguration}
–-input {- | clconfiguration}

Specifies configuration information that is to be used for creating or modifying resources. This information must conform to the format that is defined in the clconfiguration(7CL) man page. This information can be contained in a file or supplied through the standard input. To specify the standard input, specify - instead of a file name.

Only the resources that are supplied as operands to the command are created or are modified. Options that are specified in the command override any options that are set in the configuration information. If configuration parameters are missing in the configuration information, you must specify these parameters at the command line.

When you use the –i option with the create subcommand, clresource registers all required resource types and creates all required resource groups. You must supply all information that is required for the registration and configuration. All other configuration data is ignored.

–l listtype
–-listtype=listtype
–-listtype listtype

Specifies the type of resource properties that are to be displayed by the list-props subcommand. You can specify this option only with the list-props subcommand.

You must specify one value from the following list for listtype:

all

Specifies that standard properties and extension properties are displayed.

extension

Specifies displayed only extension properties are displayed. By default, only extension properties are displayed.

standard

Specifies that only standard properties are displayed.

If you do not specify the –l option, only extension properties are displayed. To display standard properties, specify the properties explicitly by using the –p option or the –y option.

–n node[,…]
–-node=node[,…]
–-node node[,…]

Specifies a node or a list of nodes in the target global cluster or zone cluster. You can specify each node as a node name or a node ID.

If the –Z option is specified, then you can specify only zone-cluster hostnames with the –n option and not the global-cluster hostnames. If –Z option is not specified, then you can specify only the global-cluster hostnames with the –n option.

The subcommands with which you can specify this option are as follows:

disable

Disables only the resources in the list of operands that are hosted on the specified nodes.

enable

Enables only the resources in the list of operands that are hosted on the specified nodes.

monitor

Monitors only those resources in the list of operands that are hosted on the specified nodes.

show

Displays the configuration information of only those resources in the list of operands that are hosted on the specified nodes.

status

Reports the status only of resources in the list of operands that are hosted on the specified nodes.

unmonitor

Unmonitors only those resources in the list of operands that are hosted on the specified nodes.

–o {- | clconfiguration}
–-output={- | clconfiguration}
–-output {- | clconfiguration}

Specifies the location where resource configuration information is to be written. This location can be a file or the standard output. To specify the standard output, specify a dash (-) instead of a file name. If you specify the standard output, all other standard output for the command is suppressed. You can specify this option only with the export subcommand.

Configuration information is written only for the resources that are supplied as operands to the command. The information is written in the format that is defined in the clconfiguration(7CL) man page.

–p property-name=value
–p property-name+=array-values
–p property-name-=array-values
–-property=property-name=value
–-property=property-name+=array-values
–-property=property-name-=array-values
–-property property-name=value
–-property property-name+=array-values
–-property property-name-=array-values

Sets the values of a property for resources that are supplied as operands to the command. You can specify the assignment form of this option only with the create subcommand and the set subcommand.

Use the –p option to specify any standard or extension property. If an extension property of a resource type has the same name as a standard property of that resource type, use of the –p option returns an error. In this situation, use the –x option to specify the extension property and the –y option to specify the standard property.

For a description of standard properties, see the r_properties(7) man page.

For a description of a resource type's extension properties, see the documentation for the resource type.

The operators to use with this option are as follows:

=

Sets the property to the specified value. The create subcommand and the set subcommand accept this operator.

+=

Adds a value or values to a string array value. Only the set subcommand accepts this operator. You can specify this operator only for properties that accept lists of string values, for example Resource_dependencies.

-=

Deletes a value or values from a string array value. Only the set subcommand accepts this operator. You can specify this operator only for properties that accept lists of string values, for example Resource_dependencies.

To set a per-node extension property on a subset of cluster nodes, specify the nodes when the property is set. Append the list of nodes in braces to the property name as follows:

name{node}

node is a comma-separated list of node names, or node IDs. For more information about per-node extension properties, see the rt_properties(7) man page.

To set a per-node resource dependency on a subset of cluster nodes, specify each per-node dependency in the following form:

myres1@node1,myres2@node2,myres3@node3

For the gds-rs resource, the following command sets a dependency on resource trancos-3-rs on node ptrancos1 and resource trancos-4-rs on node ptrancos2:

# clresource set \
-p resource_dependencies=trancos-3-rs@ptrancos1,trancos-4-rs@ptrancos2 \
gds-rs

phys-schost-1# clresource show -p resource_dependencies gds-rs
=== Resources ===
Resource: gds-rs
Resource_dependencies: trancos-3-rs@ptrancos1 trancos-4-rs@ptrancos2

To set a resource dependency with local-node scope, specify the LOCAL_NODE qualifier in the following form:

myres1{LOCAL_NODE},myres2{LOCAL_NODE}

For the gds-rs resource, the following command sets a local node dependency on resource trancos-3-rs:

# clresource set \
-p resource_dependencies=trancos-3-rs{LOCAL_NODE} \
gds-rs

phys-schost-1# clresource show -p resource_dependencies gds-rs
=== Resources ===
Resource: gds-rs
Resource_dependencies: trancos-3-rs{LOCAL_NODE}

For more information about per-node resource dependencies and dependency scope qualifiers, see the r_properties(7) man page.

–p property-name[,…]
–-property=property-name[,…]
–-property property-name[,…]

Specifies a list of properties for the list-props subcommand and show subcommand.

Use the –p option to specify any standard or extension property. If an extension property of a resource type has the same name as a standard property of that resource type, use of the –p option returns an error. In this situation, use the –x option to specify the extension property and the –y option to specify the standard property.

For a description of standard properties, see the r_properties(7) man page.

For a description of a resource type's extension properties, see the documentation for the resource type.

Without this option, the list-props subcommand and show subcommand list all or most resource properties, depending on whether the –v option is also specified.

–R
–-recursive

Recursively enables or disables resources to ensure that all required dependencies are satisfied. You can specify this option only with the disable subcommand and the enable subcommand.

The effect of this option with these subcommands is as follows:

disable

Disables any resources that depend on the resources that are specified as operands to the command. The resources are disabled even if the resources are not specified as operands to the command.

enable

Enables any resources on which resources that are specified as operands to the command depend. The resources are enabled even if the resources are not specified as operands to the command.

–s state[,…]
–-state=state[,…]
–-state state[,…]

Specifies a list of states for the list subcommand and status subcommand.

This option limits the output to include only those resources that are in one of the specified states on one or more nodes in the node list.

The possible states are as follows:

  • Online

  • Offline

  • Start_failed

  • Stop_failed

  • Monitor_failed

  • Online_not_monitored

  • Starting

  • Stopping

  • Not_online


Note -  State names, such as Offline and Start_failed, are not case sensitive. You can use any combination of uppercase and lowercase letters when you specify state names.
–t resource-type[,…]
–-type=resource-type[,…]
–-type resource-type[,…]

Specifies a resource type or list of resource types.

For all subcommands that accept this option except create, the command acts only on resources that satisfy both of the following qualifications:

  • The resources are in the list of operands.

  • The resources are instances of the resource types that the –t option specifies.

When you specify the –t option with clresource create, you create a resource of the specified type. You can specify only one resource type.

For a description of the format of resource type names, see Legal RGM Names in Planning and Administering Data Services for Oracle Solaris Cluster 4.4.

–u

If you use the + operand, this option specifies that the command operates on resources whose resource group is suspended.

If you do not specify the –u option when you specify the + operand, the command ignores all resources whose resource group is suspended. The –u option is valid when the + operand is specified with clear, disable, enable, monitor, set, or unmonitor commands.

When you use the + operand with clear, disable, enable, monitor, set, or unmonitor subcommand, the command ignores all resources whose resource groups is suspended unless you also specify the –u option.

–V
–-version

Displays the version of the command.

Do not specify this option with subcommands, operands, or other options. The subcommands, operands, or other options are ignored. The –V option displays only the version of the command. No other operations are performed.

–v
–-verbose

Displays verbose messages to the standard output.

You can specify this option with any form of the command.

Do not specify the –v option with the –o option. The–v option is ignored. The –o option suppresses all other standard output.

–x extension-property=value
–x extension-property+=array-value
–x extension-property-=array-value
–-extension-property=extension-property=value
–-extension-property=extension-property+=array-value
–-extension-property=extension-property-=array-value
–-extension-property extension-property=value
–-extension-property extension-property+=array-value
–-extension-property extension-property-=array-value

Sets or modifies the value of an extension property of resources that are supplied as operands to the command.

In general, use the –p option to specify any standard or extension property. If an extension property of a resource type has the same name as a standard property of that resource type, use of the –p option returns an error. In this situation, use the –x option to specify the extension property and the –y option to specify the standard property.

You can specify the assignment form of this option only with the create subcommand and the set subcommand.

For a description of a resource type's extension properties, see the documentation for the resource type.

The operators to use with this option are as follows:

=

Sets the property to the specified value. The create subcommand and the set subcommand accept this operator.

+=

Adds a value or values to a string array value. Only the set subcommand accepts this operator. You can specify this operator only for properties that accept lists of string values, for example Resource_dependencies.

-=

Removes a value or values from a string array value. Only the set subcommand accepts this operator. You can specify this operator only for properties that accept lists of string values, for example Resource_dependencies.

To set a per-node extension property on a subset of cluster nodes, specify the nodes when the property is set. Append the list of nodes in braces to the property name as follows:

name{node}

node is a comma-separated list of node names, or node IDs. For more information about per-node properties, see the rt_properties(7) man page.

–x extension-property[,…]
–-extension-property=extension-property[,…]
–-extension-property extension-property[,…]

Specifies a list of extension properties for the list-props subcommand and the show subcommand.

For a description of a resource type's extension properties, see the documentation for the resource type.

Use the –p option to specify any standard or extension property. If an extension property of a resource type has the same name as a standard property of that resource type, use of the –p option returns an error. In this situation, use the –x option to specify the extension property and the –y option to specify the standard property.

Without this option, the list-props subcommand and the show subcommand list all or most resource properties, depending on whether the –v option is also specified.

–y standard-property=value
–y standard-property+=array-value
–y standard-property-=array-value
–-standard-property=standard-property=value
–-standard-property=standard-property+=array-value
–-standard-property=standard-property-=array-value
–-standard-property standard-property=value
–-standard-property standard-property+=array-value
–-standard-property standard-property-=array-value

Sets or modifies the value of a standard property of resources that are supplied as operands to the command.

Use the –p option to specify any standard or extension property. If an extension property of a resource type has the same name as a standard property of that resource type, use of the –p option returns an error. In this situation, use the –x option to specify the extension property and the –y option to specify the standard property.

You can specify the assignment form of this option only with the create subcommand and the set subcommand.

For a description of standard properties, see the r_properties(7) man page.

The operators to use with this option are as follows:

=

Sets the property to the specified value. The create subcommand and the set subcommand accept this operator.

+=

Adds a value or values to a string array value. Only the set subcommand accepts this operator. You can specify this operator only for properties that accept lists of string values, for example Resource_dependencies.

-=

Removes a value or values from a string array value. Only the set subcommand accepts this operator. You can specify this operator only for properties that accept lists of string values, for example Resource_dependencies.

–y standard-property[,…]
–-standard-property=standard-property[,…]
–-standard-property standard-property[,…]

Specifies a list of standard properties for the list-props subcommand and show subcommand.

For a description of standard properties, see the r_properties(7) man page.

Use the –p option to specify any standard or extension property. If an extension property of a resource type has the same name as a standard property of that resource type, use of the –p option returns an error. In this situation, use the –x option to specify the extension property and the –y option to specify the standard property.

Without this option, the list-props subcommand and the show subcommand list all or most resource properties, depending on whether the –v option is also specified.

–Z {zone-cluster-name | global | all}
–-zonecluster={zone-cluster-name | global | all}
–-zonecluster {zone-cluster-name | global | all}

Specifies the cluster or clusters in which the resource exists and on which you want to operate.

This option is supported by all subcommands except the export subcommand.

The –Z option is not valid when the command is run from a zone-cluster node.

If you specify this option, you must also specify one argument from the following list:

zone-cluster-name

Specifies that the command with which you use this option is to operate on all specified resources in only the zone cluster named zone-cluster-name.

global

Specifies that the command with which you use this option is to operate on all specified resources in the global cluster only.

all

Specifies that the command with which you use it is to operate on resources in all zone clusters and in the global cluster.

Operands

Only the following operand is supported:

resource

Specifies the resource that is to be managed or the resources that are to be managed. If the subcommand accepts more than one resource, you can use the plus sign (+) to specify all resources.

Exit Status

If the command is successful for all specified operands, it returns zero (CL_NOERR). If an error occurs for an operand, the command processes the next operand in the operand list. The returned exit code always reflects the error that occurred first.

The following exit codes can be returned:

0 CL_NOERR

No error

The command that you issued completed successfully.

1 CL_ENOMEM

Not enough swap space

A cluster node ran out of swap memory or ran out of other operating system resources.

3 CL_EINVAL

Invalid argument

You typed the command incorrectly, or the syntax of the cluster configuration information that you supplied with the –i option was incorrect.

6 CL_EACCESS

Permission denied

The object that you specified is inaccessible. You might need the root role or authorization to issue the command. See the rbac(7) man page for more information.

9 CL_ESTATE

Object is in wrong state

You tried to modify a property, a resource group, or other object that you cannot modify at that particular time or at any time.

10 CL_EMETHOD

Resource method failed

A method of a resource failed. The method failed for one of the following reasons: (1)The validate method failed when you tried to create a resource or modify the properties of a resource. (2) A method other than validate failed when you tried to enable, disable, or delete a resource.

15 CL_EPROP

Invalid property

The property or value that you specified with the –p, –y, or –x option does not exist or is not allowed.

36 CL_ENOENT

No such object

The object that you specified cannot be found for one of the following reasons: (1) The object does not exist. (2) A directory in the path to the configuration file that you attempted to create with the –o option does not exist. (3)The configuration file that you attempted to access with the –i option contains errors.

39 CL_EEXIST

Object exists

The device, device group, cluster interconnect component, node, cluster, resource, resource type, resource group, or private string that you specified already exists.

41 CL_ETYPE

Invalid type

The type that you specified with the –t or –p option does not exist.

These exit values are compatible with the return codes that are described in the scha_calls(3HA) man page.

Examples

Example 1 Creating a Resource

This example creates a resource that is named rs-nfs in a resource group that is named rg-failover. The resource is an instance of the SUNW.nfs resource type. The resource is created in the enabled state and with resource monitoring turned on.

# clresource create -g rg-failover -t SUNW.nfs rs-nfs

Either of the following two commands create a resource that is named rs-nfs in a zone cluster ZC in a resource group that is named rg-failover. These commands can be executed from the global-cluster node, or inside the zone cluster ZC. If you execute the command from a zone cluster, explicitly defining the scope of the resource with the zone-cluster name is optional.

# clresource create -g rg-failover -t SUNW.nfs -Z ZC rs-nfs
# clresource create -g rg-failover -t SUNW.nfs ZC:rs-nfs
Example 2 Turning On Monitoring for a Resource

This example turns on monitoring for a resource that is named rs-nfs.

# clresource monitor rs-nfs

When monitoring is turned on for a resource, it remains on until explicitly turned off by using the clresource unmonitor command. Disabling and enabling a resource does not affect whether it is monitored.

Example 3 Enabling Resources

This example enables all resources in resource groups rg-failover and rg-failover2.

# clresource enable -g rg-failover,rg-failover2 +

This command does not affect whether the resources are monitored.

Example 4 Setting a Resource Property

This example sets the r_description property of all instances of the SUNW.nfs resource type to HA-NFS res.

# clresource set -t SUNW.nfs -p r_description="HA-NFS res" +
Example 5 Setting a Per-Node Resource Property

This example sets the per-node property oracle_sid of the resource rs-oracle to different values on different nodes, as follows:

  • On node phys-schost-1 and node phys-schost-2, this property is set to myora1.

  • On node phys-schost-3, this property is set to myora2.

This example assumes that the brace character has a special meaning to the shell that is used. Therefore, each property name to which the node list is appended is enclosed in double quotes.

# clresource set \
-p "oracle_sid{phys-schost-1,phys-schost-2}"=myora1 \
-p "oracle_sid{phys-schost-3}"=myora2 \
rs-oracle
Example 6 Setting a Per-Node Resource Dependency

This example sets a per-node resource dependency of gds-rs so that it is dependent on two different logical host resources.

# clresource set \
-p resource_dependencies=node-3-rs@pnode1,node-4-rs@pnode2 \
gds-rs
# clresource show -p resource_dependencies gds-rs
Resource: gds-rs
Standard Properties:
Resource_dependencies: node-3-rs@pnode1,node-4-rs@pnode2
Example 7 Adding a Value to a String-Array Property

This example adds the value rs-oracle to the string-array property resource_dependencies of the resource rs-myapp. Existing values in this string-array property are unchanged.

# clresource set -p resource_dependencies+=rs-oracle rs-myapp
# clresource show -p resource_dependencies rs-myapp
Resource: rs-myapp
Standard Properties:
Resource_dependencies: rs-nfs rs-oracle
Example 8 Deleting a Resource

This example deletes a resource that is named rs-nfs.

# clresource delete rs-nfs
Example 9 Updating an Entire Cluster Configuration

This example updates an entire cluster configuration by performing the following sequence of operations:

  1. Bringing offline all resource groups in the cluster, deleting all resources, and deleting all resource groups

  2. Unregistering all resource types

  3. Creating all resources that are specified in the configuration file /net/server/export/mycluster.xml, registering their resource types, and creating all required resource groups

# clresourcegroup delete --force +
# clresourcetype unregister +
# clresource -i /net/server/export/mycluster.xml -a +
Example 10 Listing Resources

This example lists all resources.

# clresource list
logicalhost1
rs-nfs-1
rs-nfs-2
logicalhost2
rs-apache-1
Example 11 Listing Resources With Groups and Types

This example lists all resources with their resource groups and resource types.

# clresource list -v

Resource Name      Resource Group    Resource Type
-------------      --------------    -------------
logicalhost1       rg-failover-1     SUNW.LogicalHostname
rs-nfs-1           rg-failover-1     SUNW.nfs
logicalhost2       rg-failover-2     SUNW.LogicalHostname
rs-nfs-2           rg-failover-2     SUNW.nfs
rs-apache-1        rg-failover-1     SUNW.apache
Example 12 Listing Resources of a Specific Type

This example lists all instances of the nfs resource type.

# clresource list -t nfs
rs-nfs-1
rs-nfs-2
Example 13 Listing Extension Properties and Descriptions for a Resource Type

This example lists the extension properties and a description of each extension property for the nfs resource type.

# clresource list-props -t nfs -v
Properties              Descriptions
----------              ------------
Monitor_retry_count     Number of PMF restarts allowed for the fault monitor
Monitor_retry_interval  Time window (minutes) for fault monitor restarts
Rpcbind_nullrpc_timeout Timeout(seconds) to use when probing rpcbind
Nfsd_nullrpc_timeout    Timeout(seconds) to use when probing nfsd
Mountd_nullrpc_timeout  Timeout(seconds) to use when probing mountd
Statd_nullrpc_timeout   Timeout(seconds) to use when probing statd
Lockd_nullrpc_timeout   Timeout(seconds) to use when probing lockd
Rpcbind_nullrpc_reboot  Boolean to indicate if we should reboot system when 
                          null rpc call on rpcbind fails
Nfsd_nullrpc_restart    Boolean to indicate if we should restart nfsd when 
                          null rpc call fails
Mountd_nullrpc_restart  Boolean to indicate if we should restart mountd when 
                          null rpc call fails
Line breaks in the Descriptions column are added to enhance
the readability of this example. Actual output from the command does not

contain these line breaks.
Example 14 Clearing a Start_failed Resource State by Disabling and Enabling a Resource

The Start_failed resource state indicates that a Start or Prenet_start method failed or timed out on a resource, but its resource group came online anyway. The resource group comes online even though the resource has been placed in a faulted state and might not be providing service. This state can occur if the resource's Failover_mode property is set to None or to another value that prevents the failover of the resource group.

Unlike the Stop_failed resource state, the Start_failed resource state does not prevent you or the Oracle Solaris Cluster software from performing actions on the resource group. You do not need to issue the command clear command to clear a Start_failed resource state. You only need to execute a command that restarts the resource.

The following command clears a Start_failed resource state that has occurred on the resource resource-1 by disabling and then re-enabling the resource.

# clresource disable resource-1
# clresource enable resource-1

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
ha-cluster/system/core
Interface Stability
Evolving

See Also

clreslogicalhostname(8CL), scha_calls(3HA), clconfiguration(7CL), attributes(7), r_properties(7), rbac(7), Intro(8CL), clresourcegroup(8CL), clresourcetype(8CL), clressharedaddress(8CL), cluster(8CL)

Planning and Administering Data Services for Oracle Solaris Cluster 4.4

Notes

The root role can run all forms of this command.

Any user can run this command with the following options:

  • –? option

  • –V option

To run this command with subcommands, users other than the root role require authorizations. See the following table.

Subcommand
Authorization
create
solaris.cluster.modify
delete
solaris.cluster.modify
disable
solaris.cluster.admin
enable
solaris.cluster.admin
export
solaris.cluster.read
list
solaris.cluster.read
list-props
solaris.cluster.read
set
solaris.cluster.modify
monitor
solaris.cluster.admin
clear
solaris.cluster.admin
show
solaris.cluster.read
status
solaris.cluster.read
unmonitor
solaris.cluster.admin