[Pacemaker] Problems with <rule>

Matthew Turnbull matthew.turnbull at messagescan.net
Fri Feb 20 22:02:44 UTC 2009


Hi,

I'm having problems using the <rule> element in a Pacemaker CIB.  First, this is the "resources" section I'm trying to use (line numbers inserted for clarity):


01: <resources>
02:   <clone id="mips-node-clone">
03:     <primitive class="ocf" id="mips-node" provider="heartbeat" type="pingd">
04:       <instance_attributes id="mips-node-vh10-instance_attributes" score="10">
05:         <rule id="mips-node-vh10">
06:           <expression id="mips-node-vh10-expr" attribute="#uname" operation="eq" value="vh10"/>
07:         </rule>
08:         <nvpair id="mips-node-instance_attributes-multiplier" name="multiplier" value="3000"/>
09:       </instance_attributes>
10:       <instance_attributes id="mips-node-instance_attributes">
11:         <nvpair id="mips-node-instance_attributes-name" name="name" value="mips_remain"/>
12:         <nvpair id="mips-node-instance_attributes-multiplier" name="multiplier" value="1000"/>
13:         <nvpair id="mips-node-instance_attributes-host_list" name="host_list" value="127.0.0.1"/>
14:       </instance_attributes>
15:     </primitive>
16:   </clone>
17: </resources>


When I try to import this I get an error (Update does not conform to the configured schema/DTD).  Doing it in shadow mode gives a little more detail:


...
  19     <resources>
  20       <clone id="mips-node-clone">
  21         <primitive class="ocf" id="mips-node" provider="heartbeat" type="pingd">
  22           <instance_attributes id="mips-node-vh10-instance_attributes" score="10">
  23             <rule id="mips-node-vh10">
  24               <expression id="mips-node-vh10-expr" attribute="#uname" operation="eq" value="vh10"/>
  25             </rule>
  26             <nvpair id="mips-node-instance_attributes-multiplier" name="multiplier" value="3000"/>
  27           </instance_attributes>
  28           <instance_attributes id="mips-node-instance_attributes">
  29             <nvpair id="mips-node-instance_attributes-name" name="name" value="mips_remain"/>
  30             <nvpair id="mips-node-instance_attributes-multiplier" name="multiplier" value="1000"/>
  31             <nvpair id="mips-node-instance_attributes-host_list" name="host_list" value="127.0.0.1"/>
  32           </instance_attributes>
  33         </primitive>
  34       </clone>
  35     </resources>
...
Relax-NG validity error : Extra element rule in interleave
/var/run/shadow.1gTYhU:22: element instance_attributes: Relax-NG validity error : Element instance_attributes failed to validate content
Relax-NG validity error : Extra element instance_attributes in interleave
/var/run/shadow.1gTYhU:22: element instance_attributes: Relax-NG validity error : Element primitive failed to validate content
/var/run/shadow.1gTYhU:20: element clone: Relax-NG validity error : Invalid sequence in interleave
/var/run/shadow.1gTYhU:1: element cib: Relax-NG validity error : Element cib failed to validate content
Call failed: Update does not conform to the configured schema/DTD


If I remove lines 5, 6 and 7 from my XML file (the rule) - but still leave in place the separate instance_attributes with a score value - it loads and validates fine.

I've looked at the offending lines and tried so many different things, but so long as any form of <rule> is there, this fails to load.  I've read through the DTD and by the look of it I've got my tags right - but still it doesn't work!

Can anyone see anything I've done wrong here please?

For background, what I'm trying to do is use a pingd clone set pointing at a different attribute (mips_remain) to maintain a "MIPS Remaining" counter for each node.  This snippet above is to create the intial values - default of 1000, but overridden to 3000 on node vh10.

Once this is working, I will run additional single-instance "pingd" resources in my real resource groups, with the multipliers set to a negative value indicating a "MIPS Consumed" value of the resource group.

I hope that will then leave my "mips_remain" attribute as the initial value less the sum of all resources running on a node.  I'll use this score to determine where to start new resources.

And yes, I know there's a nasty flip-flop effect in there once it's up and running - my resource stickiness will ensure this approach is only used for placement when starting resources, and no failback will ever occur!

Many thanks,

Matt.




More information about the Pacemaker mailing list