<div dir="ltr"><pre>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).<br>running:<br>pcs resource update drbd adJust_Master_score="0 10 1000 10000"<br><br>Outputs the error:<br>Error: resource option(s): 'adJust_Master_score', are not recognized for resource type: 'ocf:linbit:drbd' (use --force to override)<br><br>but running:<br>pcs resource update drbd adjust_master_score="0 10 1000 10000"<br><br>results in no errors.<br><br>The CIB differences are below as well<br><br>The CIB with the RA modified but not the resource in pacemaker which exhibits the expected behaviour:<br><br>grep -B 3 -A 3 adjust_master /var/lib/pacemaker/cib/cib.xml<br><br>Nothing shows up in the cib.<br><br>With the resource agent unmodified, but the resource in pacemaker has the adjust_master_score attribute. This does no not exhibit the expected behaviour:<br><br>grep -B 3 -A 3 adjust_master /var/lib/pacemaker/cib/cib.xml<br><br> <primitive class="ocf" id="drbd" provider="linbit" type="drbd"><br> <instance_attributes id="drbd-instance_attributes"><br> <nvpair id="drbd-instance_attributes-drbd_resource" name="drbd_resource" value="drbd"/><br> <nvpair id="drbd-instance_attributes-adjust_master_score" name="adjust_master_score" value="0 10 1000 10000"/><br> </instance_attributes><br><br>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.<br><br></pre><pre>Environment for the RA (with the Resource Agent unmodified, but the resource attribute adjust_master_score set)<br></pre><pre>/bin/env | grep adjust_master_score<br>OCF_RESKEY_adjust_master_score=0 10 1000 10000<br><br></pre><pre>Environment with the resource agent modified and no adjust_master_score attribute on the resource (This produces the expected behaviour):<br>/bin/env | grep adjust_master_score<br></pre><pre>(empty)<br><br></pre><pre>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<br></pre><pre><br>From: Lars Ellenberg <<a href="mailto:lars.ellenberg@linbit.com">lars.ellenberg@linbit.com</a>>
Precedence: list
MIME-Version: 1.0
To: <a href="mailto:drbd-user@lists.linbit.com">drbd-user@lists.linbit.com</a>
References: <<a href="mailto:1422480449.1538.10.camel@securelink.com">1422480449.1538.10.camel@securelink.com</a>>
In-Reply-To: <<a href="mailto:1422480449.1538.10.camel@securelink.com">1422480449.1538.10.camel@securelink.com</a>>
Date: Thu, 29 Jan 2015 23:44:54 +0100
Message-ID: <20150129224454.GB24472@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
: <a href="http://www.LINBIT.com">http://www.LINBIT.com</a> | Your Way to High Availability
: DRBD, Linux-HA and Pacemaker support and consulting
</pre></div>