Oracle® Solaris Cluster Data Services Developer's Guide

Exit Print View

Updated: July 2014, E39646-01
 
 

Implementing Monitors and Methods That Execute Exclusively in the Global Zone

Most resource types execute their methods in whatever node appears in the resource group's node list. A few resource types must execute all of their methods in the global zone, even when the resource group is configured in a zone-cluster node. This is necessary for resource types that manage system resources, such as network addresses or disks, which can only be managed from the global zone. These resource types are identified by setting the Global_zone property to TRUE in the resource type registration (RTR) file.


Caution

Caution  - Do not register a resource type for which the Global_zone property is set to TRUE unless the resource type comes from a known and trusted source. Resource types for which this property is set to TRUE circumvent zone isolation and present a risk.


A resource type that declares Global_zone=TRUE might also declare the Global_zone_override resource property. In this case, the value of the Global_zone_override property supersedes the value of the Global_zone property for that resource. The Global_zone_override property is described in more detail in Resource Properties and the r_properties(5) man page.

If the Global_zone resource type property is not set to TRUE, monitors and methods execute in whatever nodes are listed in the resource group's node list.

The scha_control() and scha_resource_setstatus() functions and the scha_control and scha_resource_setstatus commands operate implicitly on the node from which the function or command is run. If the Global_zone resource type property equals TRUE, these functions and commands need to be invoked differently when the resource is configured in a zone cluster.

When the resource is configured in a zone-cluster node, the value of the zonename operand is passed to the resource type method by the –Z option. If your method or monitor invokes one of these functions or commands without the correct handling, it incorrectly operates on the global zone. Your method or monitor should operate on the zone-cluster node in which the resource that is included in the resource group's node list is configured.

    To ensure that your method or monitor code handles these conditions correctly, check that it does the following:

  • Specifies the –Z zonename option in calls to the scha_control and scha_resource_setstatus commands. Use the same value for zonename that the RGM passes to the data service method with the –Z option.

  • Includes calls to the scha_control_zone() function rather than to the scha_control() function. Ensure that your call passes the zonename operand that was passed by the –Z option.

  • Includes calls to the scha_resource_setstatus_zone() function rather than to the scha_resource_setstatus() function. Ensure that your call passes the zonename operand that was passed by the –Z option.

The DSDL functions inherently handle the –Z zonename option.

You can use the DSDL function scds_get_zone_name() to query the name of the zone that is passed to the method in the –Z zonename command-line option. If no –Z zonename is passed, the scds_get_zone_name() function returns NULL.