Product SiteDocumentation Site

8.4. Resource Expressions

An rsc_expression is a rule condition based on a resource agent’s properties. This rule is only valid within an rsc_defaults or op_defaults context. None of the matching attributes of class, provider, and type are required. If one is omitted, all values of that attribute will match. For instance, omitting type means every type will match.

Table 8.7. Attributes of an rsc_expression Element

FieldDescription
id
A unique name for the expression (required)
class
The standard name to be matched against resource agents
provider
If given, the vendor to be matched against resource agents. This only makes sense for agents using the OCF spec.
type
The name of the resource agent to be matched

8.4.1. Example Resource-Based Expressions

A small sample of how resource-based expressions can be used:

Example 8.8. True for all ocf:heartbeat:IPaddr2 resources

<rule id="rule1" score="INFINITY">
    <rsc_expression id="rule_expr1" class="ocf" provider="heartbeat" type="IPaddr2"/>
</rule>

Example 8.9. Provider doesn’t apply to non-OCF resources

<rule id="rule2" score="INFINITY">
    <rsc_expression id="rule_expr2" class="stonith" type="fence_xvm"/>
</rule>