[Linux-HA] Dependencies between resources

Thurston Nabe thurston at angelpoints.com
Fri Aug 4 12:29:10 MDT 2006


Hello All,
 
I'm trying to solve the following configuration scenario:
using crm (Heartbeat 2.0.5)
Resource A (attempt to always keep running on a single node, has a
monitor action)
Resource B (attempt to always keep running on a single node, has a
monitor action)
 
IP address (should migrate when applicable)
 
"applicable" is:
1.  IP address monitor fails
2.  And this is the tricky part, if IP address is "running" on the same
node that Resource A is running on, AND Resource A's monitor action
fails
3.  And this is the tricky part, if IP address is "running" on the same
node that Resource B is running on, AND Resource B's monitor action
fails
 
Now this is very much like "group" behavior, but the anomaly is I don't
want the Resource (A or B) to "migrate", just the IP address
Essentially, I'd like to define a constraint like this:
<rsc_location rsc="IP-address">
   <rule score="-INFINITY" boolean_op="and">
       <expression attribute="#uname"  operation="eq" value="Resource
A's machine"/>
       <expression "evaluate somehow that Resource A's monitor action
failed"/> 
   </rule>
   <rule score="-INFINITY" boolean_op="and">
       <expression attribute="#uname"  operation="eq" value="Resource
B's machine"/>
       <expression "evaluate somehow that Resource B's monitor action
failed"/> 
   </rule>
</rsc_location>
My English interpretation of the preceding rules is:
never run IP-address on machine A (the uname expression) if Resource A
"just failed"
and same for the second rule (transposing B for A)
Assuming that would work, I don't know how to express <expression
"evaluate somehow that Resource X's monitor action failed"/>
 
in a way, as I mentioned before, this is what defining a group does,
i.e. it will attempt to migrate one resource if another resource's
monitor action failed.  That's what I want, but I don't want all of a
group's resources to migrate, in this case just the IP-address to
migrate.
I've looked at rsc_order, rsc_colocation, etc. and none of them quite
seem to do what I want.
 
Maybe it's the responsibility of the Resource A (B) monitor actions to
set the value of an instance attribute once they detect failure?  How is
that done in a shell script? Execute cibadmin, crm_attribute, changing
the value of the OCF_RESKEY_XXX environment variable? And then
referencing that attribute in a rule's expression?
 
Any help would be appreciated
 
 


More information about the Linux-HA mailing list