<div dir="ltr">&gt;&gt; <span style="font-size:12.8px">Moreover, when you delete this attribute the actual remove will be delayed by that &quot;--delay&quot; which was used when the attribute was set.</span><div><span style="font-size:12.8px">I wasn&#39;t clear here. The behavior described in this line happens only when &quot;dampening&quot; has worked out during the attribute set-up.</span></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Thank you,<div>Kostia</div></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Nov 30, 2016 at 7:31 PM, Kostiantyn Ponomarenko <span dir="ltr">&lt;<a href="mailto:konstantin.ponomarenko@gmail.com" target="_blank">konstantin.ponomarenko@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Ken,<div><br></div><div>I didn&#39;t look into the logs, but I experimented with it for a while.</div><div>Here is what I found.</div><div><br></div><div>It worked for you because this attribute - &quot;my-attr&quot; - has not ever been set before in that cluster.</div><div><br></div><div>So if you set an attribute, then remove it, and then set it with &quot;--delay&quot;, like:</div><div><br></div><div>    # attrd_updater -N node-0 -n my-attr --update false --delay 20</div><div><br></div><div>, this delay (dampening) won&#39;t work.</div><div>Moreover, when you delete this attribute the actual remove will be delayed by that &quot;--delay&quot; which was used when the attribute was set.</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="m_-4404032309519204886gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Thank you,<div>Kostia</div></div></div></div></div></div><div><div class="h5">
<br><div class="gmail_quote">On Tue, Nov 29, 2016 at 1:08 AM, Ken Gaillot <span dir="ltr">&lt;<a href="mailto:kgaillot@redhat.com" target="_blank">kgaillot@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 11/24/2016 05:24 AM, Kostiantyn Ponomarenko wrote:<br>
&gt; Attribute dampening doesn&#39;t work for me also.<br>
&gt; To test that I have a script:<br>
&gt;<br>
&gt;     attrd_updater -N node-0 -n my-attr --update false --delay 20<br>
&gt;     sleep 3<br>
&gt;     attrd_updater -N node-0 -n my-attr --update true<br>
&gt;     sleep 7<br>
&gt;     attrd_updater -N node-1 -n my-attr --update true<br>
<br>
</span>This sequence works for me -- the attributes are not written to the live<br>
CIB until the end of the delay, when both are written at the same time.<br>
<br>
The remaining issue must be with the policy engine. You could look at<br>
the detail log on the DC when these changes were made; you should see<br>
info-level messages with the CIB change with both values together (lines<br>
with &quot;cib_perform_op:   ++&quot; and the attribute values), then &quot;Transition<br>
aborted&quot; with &quot;Transient attribute change&quot;, then a bunch of &quot;pengine:&quot;<br>
lines saying what the cluster wants to do with each resource.<br>
<br>
There should be some information about the scores used to place the<br>
resources.<br>
<span><br>
&gt;<br>
&gt; All my resources have this rule in Pacemaker config:<br>
&gt;<br>
&gt;     crm configure location res1-location-rule res1 \<br>
&gt;         rule 0: my-attr eq true \<br>
&gt;         rule -inf: my-attr ne true<br>
&gt;<br>
&gt; On a working two-node cluster I remove &quot;my-attr&quot; from both nodes.<br>
&gt; Then run my script. And all resources start on node-0.<br>
&gt; Am I doing something wrong?<br>
&gt; Or maybe my understanding of an attribute dampening is not correct?<br>
&gt;<br>
&gt; My Pacemaker version is 1.1.13. (heh, not the last one, but it is what<br>
&gt; it is ...)<br>
&gt;<br>
&gt; Thank you,<br>
&gt; Kostia<br>
&gt;<br>
&gt; On Wed, Nov 23, 2016 at 7:27 PM, Kostiantyn Ponomarenko<br>
&gt; &lt;<a href="mailto:konstantin.ponomarenko@gmail.com" target="_blank">konstantin.ponomarenko@gmail.<wbr>com</a><br>
</span><span>&gt; &lt;mailto:<a href="mailto:konstantin.ponomarenko@gmail.com" target="_blank">konstantin.ponomarenko<wbr>@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Maybe I am doing something wrong, but I cannot set &quot;status&quot; section<br>
&gt;     node attributes to a shadow cib, cluster applies them immediately.<br>
&gt;     To try it out I do in a console:<br>
&gt;<br>
&gt;         crm_shadow --create test<br>
&gt;         crm_attribute --type nodes --node node-0 --name my-attribute<br>
&gt;     --update 1 --lifetime=reboot<br>
&gt;<br>
&gt;     And this attribute is set to the live cluster configuration immediately.<br>
&gt;     What am I doing wrong?<br>
&gt;<br>
&gt;     Thank you,<br>
&gt;     Kostia<br>
&gt;<br>
&gt;     On Tue, Nov 22, 2016 at 11:33 PM, Kostiantyn Ponomarenko<br>
&gt;     &lt;<a href="mailto:konstantin.ponomarenko@gmail.com" target="_blank">konstantin.ponomarenko@<wbr>gmail.com</a><br>
</span><span>&gt;     &lt;mailto:<a href="mailto:konstantin.ponomarenko@gmail.com" target="_blank">konstantin.ponomarenk<wbr>o@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;         Ken,<br>
&gt;         Thank you for the explanation.<br>
&gt;         I will try this low-level way of shadow cib creation tomorrow.<br>
&gt;         PS: I will sleep much better with this excellent news/idea. =)<br>
&gt;<br>
&gt;         Thank you,<br>
&gt;         Kostia<br>
&gt;<br>
&gt;         On Tue, Nov 22, 2016 at 10:53 PM, Ken Gaillot<br>
</span><span>&gt;         &lt;<a href="mailto:kgaillot@redhat.com" target="_blank">kgaillot@redhat.com</a> &lt;mailto:<a href="mailto:kgaillot@redhat.com" target="_blank">kgaillot@redhat.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;             On 11/22/2016 04:39 AM, Kostiantyn Ponomarenko wrote:<br>
&gt;             &gt; Using &quot;shadow cib&quot; in crmsh looks like a good idea, but it doesn&#39;t work<br>
&gt;             &gt; with node attributes set into &quot;status&quot; section of Pacemaker config.<br>
&gt;             &gt; I wonder it it is possible to make it work that way.<br>
&gt;<br>
&gt;             Forgot to mention -- the shadow CIB is probably the best way<br>
&gt;             to do this.<br>
&gt;             I don&#39;t know if there&#39;s a way to do it in crmsh, but you can<br>
&gt;             use it with<br>
&gt;             the low-level commands crm_shadow and crm_attribute<br>
&gt;             --lifetime=reboot.<br>
&gt;<br>
&gt;             &gt; Ken,<br>
&gt;             &gt;&gt;&gt; start dampening timer<br>
&gt;             &gt; Could you please elaborate more on this. I don&#39;t get how I can set this<br>
&gt;             &gt; timer.<br>
&gt;             &gt; Do I need to set this timer for each node?<br>
&gt;             &gt;<br>
&gt;             &gt;<br>
&gt;             &gt; Thank you,<br>
&gt;             &gt; Kostia<br>
&gt;             &gt;<br>
&gt;             &gt; On Mon, Nov 21, 2016 at 9:30 AM, Ulrich Windl<br>
&gt;             &gt; &lt;<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de" target="_blank">Ulrich.Windl@rz.uni-regensbur<wbr>g.de</a><br>
&gt;             &lt;mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de" target="_blank">Ulrich.Windl@rz.uni-r<wbr>egensburg.de</a>&gt;<br>
</span>&gt;             &gt; &lt;mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de" target="_blank">Ulrich.Windl@rz.uni-re<wbr>gensburg.de</a><br>
<span>&gt;             &lt;mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de" target="_blank">Ulrich.Windl@rz.uni-r<wbr>egensburg.de</a>&gt;&gt;&gt; wrote:<br>
&gt;             &gt;<br>
&gt;             &gt;     &gt;&gt;&gt; Ken Gaillot &lt;<a href="mailto:kgaillot@redhat.com" target="_blank">kgaillot@redhat.com</a><br>
</span>&gt;             &lt;mailto:<a href="mailto:kgaillot@redhat.com" target="_blank">kgaillot@redhat.com</a>&gt; &lt;mailto:<a href="mailto:kgaillot@redhat.com" target="_blank">kgaillot@redhat.com</a><br>
<span>&gt;             &lt;mailto:<a href="mailto:kgaillot@redhat.com" target="_blank">kgaillot@redhat.com</a>&gt;&gt;<wbr>&gt;<br>
&gt;             &gt;     schrieb am 18.11.2016 um 16:17 in Nachricht<br>
&gt;             &gt;     &lt;<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com" target="_blank">d6f449da-64f8-12ad-00be-e772<wbr>d8e382ca@redhat.com</a><br>
&gt;             &lt;mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com" target="_blank">d6f449da-64f8-12ad-00<wbr>be-e772d8e382ca@redhat.com</a>&gt;<br>
&gt;             &gt;<br>
</span>&gt;              &lt;mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com" target="_blank">d6f449da-64f8-12ad-00b<wbr>e-e772d8e382ca@redhat.com</a><br>
<div class="m_-4404032309519204886HOEnZb"><div class="m_-4404032309519204886h5">&gt;             &lt;mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com" target="_blank">d6f449da-64f8-12ad-00<wbr>be-e772d8e382ca@redhat.com</a>&gt;&gt;&gt;:<br>
&gt;             &gt;     &gt; On 11/18/2016 08:55 AM, Kostiantyn Ponomarenko wrote:<br>
&gt;             &gt;     &gt;&gt; Hi folks,<br>
&gt;             &gt;     &gt;&gt;<br>
&gt;             &gt;     &gt;&gt; Is there a way to set a node attribute to the<br>
&gt;             &quot;status&quot; section for few<br>
&gt;             &gt;     &gt;&gt; nodes at the same time?<br>
&gt;             &gt;     &gt;&gt;<br>
&gt;             &gt;     &gt;&gt; In my case there is a node attribute which allows<br>
&gt;             some resources to<br>
&gt;             &gt;     &gt;&gt; start in the cluster if it is set.<br>
&gt;             &gt;     &gt;&gt; If I set this node attribute for say two nodes in a<br>
&gt;             way - one and then<br>
&gt;             &gt;     &gt;&gt; another, than these resources are not distributed<br>
&gt;             equally between these<br>
&gt;             &gt;     &gt;&gt; two nodes. That because Pacemaker picks the first<br>
&gt;             node to with this<br>
&gt;             &gt;     &gt;&gt; attribute is set and immediately starts all allowed<br>
&gt;             resources on it. And<br>
&gt;             &gt;     &gt;&gt; this is not the behavior i would like to get.<br>
&gt;             &gt;     &gt;&gt;<br>
&gt;             &gt;     &gt;&gt; Thank you,<br>
&gt;             &gt;     &gt;&gt; Kostia<br>
&gt;             &gt;     &gt;<br>
&gt;             &gt;     &gt; Not that I know of, but it would be a good feature<br>
&gt;             to add to<br>
&gt;             &gt;     &gt; attrd_updater and/or crm_attribute.<br>
&gt;             &gt;<br>
&gt;             &gt;     With crm (shell) you don&#39;t have transactions for node<br>
&gt;             attributes,<br>
&gt;             &gt;     but for the configuration. So if you add a location<br>
&gt;             restriction<br>
&gt;             &gt;     preventing any resources on your nodes, then enable<br>
&gt;             the nodes, and<br>
&gt;             &gt;     then delete the location restrictions in one<br>
&gt;             transaction, you might<br>
&gt;             &gt;     get what you want. It&#39;s not elegant, but itt ill do.<br>
&gt;             &gt;<br>
&gt;             &gt;     To the crm shell maintainer: Is is difficult to build<br>
&gt;             transactions<br>
&gt;             &gt;     to node status changes? The problem I see is this: For<br>
&gt;             configuration<br>
&gt;             &gt;     you always have transactions (requiring &quot;commit), but<br>
&gt;             for nodes you<br>
&gt;             &gt;     traditionally have non (effects are immediate). So<br>
&gt;             you&#39;d need a<br>
&gt;             &gt;     thing like &quot;start transaction&quot; which requires a<br>
&gt;             &quot;commit&quot; or some<br>
&gt;             &gt;     kind of abort later.<br>
&gt;             &gt;<br>
&gt;             &gt;     I also don&#39;t know whether a &quot;shadow CIB&quot; would help<br>
&gt;             for the original<br>
&gt;             &gt;     problem.<br>
&gt;             &gt;<br>
&gt;             &gt;     Ulrich<br>
&gt;             &gt;<br>
&gt;             &gt;     &gt;<br>
&gt;             &gt;     &gt; You can probably hack it with a dampening value of a<br>
&gt;             few seconds. If<br>
&gt;             &gt;     &gt; your rule checks for a particular value of the<br>
&gt;             attribute, set all the<br>
&gt;             &gt;     &gt; nodes to a different value first, which will write<br>
&gt;             that value and<br>
&gt;             &gt;     start<br>
&gt;             &gt;     &gt; the dampening timer. Then set all the attributes to<br>
&gt;             the desired value,<br>
&gt;             &gt;     &gt; and they will get written out together when the<br>
&gt;             timer expires.<br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>