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