[DRBD-user] "adjust_master_score" attribute is ignored for pacemaker drbd resource (Lars Ellenberg)

Joel Burleson-Davis joel at securelink.com
Fri Jan 30 17:13:49 CET 2015

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.

I was under the impression that pacemaker checks attributes against
the resource agent, and only applies them if they are valid (So it
seems like it's not a typo).
pcs resource update drbd adJust_Master_score="0 10 1000 10000"

Outputs the error:
Error: resource option(s): 'adJust_Master_score', are not recognized
for resource type: 'ocf:linbit:drbd' (use --force to override)

but running:
pcs resource update drbd adjust_master_score="0 10 1000 10000"

results in no errors.

The CIB differences are below as well

The CIB with the RA modified but not the resource in pacemaker which
exhibits the expected behaviour:

grep -B 3 -A 3 adjust_master /var/lib/pacemaker/cib/cib.xml

Nothing shows up in the cib.

With the resource agent unmodified, but the resource in pacemaker has
the adjust_master_score attribute. This does no not exhibit the
expected behaviour:

grep -B 3 -A 3 adjust_master /var/lib/pacemaker/cib/cib.xml

    <primitive class="ocf" id="drbd" provider="linbit" type="drbd">
          <instance_attributes id="drbd-instance_attributes">
            <nvpair id="drbd-instance_attributes-drbd_resource"
name="drbd_resource" value="drbd"/>
            <nvpair id="drbd-instance_attributes-adjust_master_score"
name="adjust_master_score" value="0 10 1000 10000"/>

So the CIB seems to update fine, but the behaviour is different
between the two. The goal is to not attempt to promote a drbd node who
is in a Consistent/Unknown state, which as I understand it a major
reason the adjust_master_score attribute was created.

Environment for the RA (with the Resource Agent unmodified, but the
resource attribute adjust_master_score set)

/bin/env | grep adjust_master_score
OCF_RESKEY_adjust_master_score=0 10 1000 10000

Environment with the resource agent modified and no
adjust_master_score attribute on the resource (This produces the
expected behaviour):
/bin/env | grep adjust_master_score


So it turns out if I change the variable adjust_master_score_default
in the resource agent at /usr/lib/ocf/linbit/drbd, the setting does
not show up in the environmental variables or the cib but works
appropriately. However, with the unmodified resource agent, and the
adjust_master_score attribute set on the resource, the attribute shows
up in the environmental variables and in the cib, however, it doesn't
produce the expected behaviour. r

From: Lars Ellenberg <lars.ellenberg at linbit.com>
Precedence: list
MIME-Version: 1.0
To: drbd-user at lists.linbit.com
References: <1422480449.1538.10.camel at securelink.com>
In-Reply-To: <1422480449.1538.10.camel at securelink.com>
Date: Thu, 29 Jan 2015 23:44:54 +0100
Message-ID: <20150129224454.GB24472 at soda.linbit>
Content-Type: text/plain; charset=us-ascii
Subject: Re: [DRBD-user] "adjust_master_score" attribute is ignored for
 pacemaker drbd resource
Message: 1

On Wed, Jan 28, 2015 at 03:27:29PM -0600, Joel N. Burleson-Davis wrote:
> I have a need to use the "adjust_master_score" parameter in a pacemaker
> cluster that uses DRBD. Interestingly, if I set the
> adjust_master_property on the resource itself i.e 'pcs resource update
> drbd adjust_master_score="0 10 1000 10000"', the attribute seems to be
> ignored and it doesn;t produce the expected behavior. However, if I
> modify the resource agent itself
> under /usr/lib/ocf/resource.d/linbit/drbd and change the line
> OCF_RESKEY_adjust_master_score_default="5 10 1000 10000" to
> OCF_RESKEY_adjust_master_score_default="0 10 1000 10000", it works just
> as you'd expect. Is this a known issue with the adjust_master_score
> attribute? Anyone have any ideas why it is being ignored?

You likely simply had a typo in your cib.
Did you check the cib, or the logs?
Did you check what environment is actually passed to the agent?

: Lars Ellenberg
: http://www.LINBIT.com | Your Way to High Availability
: DRBD, Linux-HA  and  Pacemaker support and consulting
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/drbd-user/attachments/20150130/278cd5dc/attachment.htm>

More information about the drbd-user mailing list