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