Sun Cluster 3.0 Data Services Developers' Guide

Setting Resource and Resource Type Properties

Sun Cluster provides resource type properties that you can use to define the static configuration of a data service. Resource type properties can specify the type of the resource, its version, the version of the API, and so on, as well as specify paths to each of the callback methods. Table A-1 lists all the resource type properties.

You declare the resource type properties in the resource type registration (RTR) file. The RTR file defines the initial configuration of the data service at the time the cluster administrator registers the data service with Sun Cluster. With the exception of Installed_nodes, the cluster administrator cannot configure resource type properties.


Note -

Table A-1, which describes the resource type properties, specifies whether each property is optional, required, or conditional. You do not have to declare optional properties in the RTR file because the system supplies a default value if you omit them. This table also lists the default value for each optional property. If you do not declare a required property in the RTR file, registration of the data service fails.If you do not declare a conditional property in the RTR file, the RGM does not create the property and it is not available to the cluster administrator.


The following example shows resource type property entries in an RTR file.


# Registration information for example resource type
Resource_type = example_RT; 
Vendor_id = SUNW;
Pkglist = SUNWxxx;
RT_Basedir = /opt/SUNWxxx;
START			=	bin/service_start;
STOP			=	bin/service_stop;

Tip -

You must declare the Resource_type property as the first entry in the RTR file. Otherwise, registration of the resource type will fail.


Sun Cluster also provides resource properties, such as Failover_mode, Thorough_probe_interval, and method timeouts, that define the static configuration of the resource. Dynamic resource properties such as Resource_state and Status reflect the active state of a managed resource. In addition to the resource properties, a resource inherits the properties of its resource type. Table A-2 describes the resource properties.

As with resource type properties, you declare resource properties in the RTR file. For resource properties provided by Sun Cluster, so-called system-defined properties, you can change specific attributes in the RTR file. For example, Sun Cluster provides method timeout properties for each of the callback methods, and specifies default values. In the RTR file, you can specify different default values.

You can also define new resource properties in the RTR file--so-called extension properties--using a set of property attributes provided by Sun Cluster. Table A-4 lists the attributes for changing and defining resource properties.

By convention, resource property declarations follow the resource type declarations in the RTR file. Entries begin with an open curly bracket and end with a closed curly bracket. The following example shows resource declarations in a sample RTR file.

...

 

# Resource property declarations appear as a list of bracketed 

# entries after the resource-type declarations. The property  

# name declaration must be the first attribute after the open 

# curly bracket of a resource property entry. 

# Set minimum and default for method timeouts. 

Property = Start_timeout;  

MIN=60;  

DEFAULT=300; 

Property = Stop_timeout;  

MIN=60;  

DEFAULT=300; 

# An extension property that can be set at resource creation 

 

{  

Property = Log_level; 

Extension; 

enum {OFF, TERSE, VERBOSE}; 

DEFAULT = TERSE; 

TUNABLE = AT_CREATION; 

DESCRIPTION = "Controls the detail of message logging"; 

Start_timeout and Stop_timeout are system-defined resource properties. Sun Cluster provides a minimum value (1 second) and a default value (3600 seconds) for all timeouts. This sample RTR file changes these values to 60 seconds minimum and 300 seconds default. The cluster administrator can accept the default value or change the value of the timeout to 60 seconds or greater.


Note -

You must declare conditional system-defined resource properties in the resource type registration file for them to be available for resources of that type. That is, properties that are not declared cannot be set or queried.


The final point about resource properties is that the cluster administrator can configure them under certain conditions. The following table shows the TUNABLE attribute that determines when and if an administrator can configure a resource property.

NONE or FALSE

Never 

TRUE or ANYTIME

Anytime 

AT_CREATION

When the data service is added to a cluster 

WHEN_DISABLED

When the data service is disabled 

You can use other attributes to put limits on the configurability of a property. For example, the Min and Max attributes allow you to set ranges for integer properties. See Table A-4 for a complete list of resource property attributes.