[ClusterLabs] How to configure lifetime in constraints?

Kristoffer Grönlund kgronlund at suse.com
Wed Mar 21 09:56:43 EDT 2018


xin <XLiang at suse.com> writes:

> Hi:
>
>    I noticed that in latest constraints schema file(constraints-3.0.rng),
>    "element-lifetime" is an option in location/colocation/order, and it 
> linked to rule-2.9.rng.
>
>    I can not find the keyword "lifetime" in upstream document "Pacemaker 
> 1.1 Configuration Explained",
>    then I guess "date_expression" in rules means lifetime.
>
>    So I write this xml section in file cons1.xml:
>    #######################
>    <rsc_location id="loc1" rsc="r1" score="100" node="node1">
>      <rule id="rule1">
>        <date_expression id="date_expr1" operation="date_spec">
>          <date_spec weekdays="5" monthdays="13" moon="4"/>
>        </date_expression>
>      </rule>
>    </rsc_location>
>    #######################

First off, the lifetime element is deprecated IIRC and not necessary.

Second, the required rule is somewhat complicated. I would recommend
using the crmsh "crm resource ban" command to create the constraint with
a lifetime, and then look at the CIB XML to see what the created
constraint looks like.

Cheers,
Kristoffer

-- 
// Kristoffer Grönlund
// kgronlund at suse.com



More information about the Users mailing list