false
, the cluster treats the constraint as if it was not there. When the rule evaluates to true
, the node’s preference for running the resource is updated with the score associated with the rule.
Esempio 8.8. Impedisci a myApacheRsc di essere eseguita su c001n03
<rsc_location id="dont-run-apache-on-c001n03" rsc="myApacheRsc" score="-INFINITY" node="c001n03"/>
Esempio 8.9. Impedisci a myApacheRsc di essere eseguita su c001n03 - versione estesa
<rsc_location id="dont-run-apache-on-c001n03" rsc="myApacheRsc"> <rule id="dont-run-apache-rule" score="-INFINITY"> <expression id="dont-run-apache-expr" attribute="#uname" operation="eq" value="c00n03"/> </rule> </rsc_location>
Esempio 8.10. Una sezione nodi di esempio da utilizzare con score-attribute
<nodes> <node id="uuid1" uname="c001n01" type="normal"> <instance_attributes id="uuid1-custom_attrs"> <nvpair id="uuid1-cpu_mips" name="cpu_mips" value="1234"/> </instance_attributes> </node> <node id="uuid2" uname="c001n02" type="normal"> <instance_attributes id="uuid2-custom_attrs"> <nvpair id="uuid2-cpu_mips" name="cpu_mips" value="5678"/> </instance_attributes> </node> </nodes>
<rule id="need-more-power-rule" score="-INFINITY"> <expression id=" need-more-power-expr" attribute="cpu_mips" operation="lt" value="3000"/> </rule>
score-attribute
instead of score
, each node matched by the rule has its score adjusted differently, according to its value for the named node attribute. Thus, in the previous example, if a rule used score-attribute="cpu_mips"
, c001n01
would have its preference to run the resource increased by 1234
whereas c001n02
would have its preference increased by 5678
.