<div dir="ltr">Maybe I am doing something wrong, but I cannot set "status" section node attributes to a shadow cib, cluster applies them immediately.<div>To try it out I do in a console:</div><div><br></div><div> crm_shadow --create test<br></div><div> crm_attribute --type nodes --node node-0 --name my-attribute --update 1 --lifetime=reboot<br></div><div><br></div><div>And this attribute is set to the live cluster configuration immediately.</div><div>What am I doing wrong?</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 Tue, Nov 22, 2016 at 11:33 PM, Kostiantyn Ponomarenko <span dir="ltr"><<a href="mailto:konstantin.ponomarenko@gmail.com" target="_blank">konstantin.ponomarenko@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ken,<div>Thank you for the explanation.</div><div>I will try this low-level way of shadow cib creation tomorrow.</div><div>PS: I will sleep much better with this excellent news/idea. =)</div></div><div class="gmail_extra"><br clear="all"><div><div class="m_-3954014330065360309gmail_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 22, 2016 at 10:53 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>On 11/22/2016 04:39 AM, Kostiantyn Ponomarenko wrote:<br>
</span><span>> 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>
</span>Forgot to mention -- the shadow CIB is probably the best way to do this.<br>
I don't know if there's a way to do it in crmsh, but you can use it with<br>
the low-level commands crm_shadow and crm_attribute --lifetime=reboot.<br>
<span><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" target="_blank">Ulrich.Windl@rz.uni-regensbur<wbr>g.de</a><br>
</span>> <mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de" target="_blank">Ulrich.Windl@rz.uni-re<wbr>gensburg.de</a>>> wrote:<br>
><br>
> >>> Ken Gaillot <<a href="mailto:kgaillot@redhat.com" target="_blank">kgaillot@redhat.com</a> <mailto:<a href="mailto:kgaillot@redhat.com" target="_blank">kgaillot@redhat.com</a>>><br>
<span>> schrieb am 18.11.2016 um 16:17 in Nachricht<br>
> <<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com" target="_blank">d6f449da-64f8-12ad-00be-e772<wbr>d8e382ca@redhat.com</a><br>
</span>> <mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com" target="_blank">d6f449da-64f8-12ad-00<wbr>be-e772d8e382ca@redhat.com</a>>>:<br>
<div class="m_-3954014330065360309HOEnZb"><div class="m_-3954014330065360309h5">> > On 11/18/2016 08:55 AM, Kostiantyn Ponomarenko wrote:<br>
> >> Hi folks,<br>
> >><br>
> >> Is there a way to set a node attribute to the "status" section for few<br>
> >> nodes at the same time?<br>
> >><br>
> >> In my case there is a node attribute which allows some resources to<br>
> >> start in the cluster if it is set.<br>
> >> If I set this node attribute for say two nodes in a way - one and then<br>
> >> another, than these resources are not distributed equally between these<br>
> >> two nodes. That because Pacemaker picks the first node to with this<br>
> >> attribute is set and immediately starts all allowed 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 to add to<br>
> > attrd_updater and/or crm_attribute.<br>
><br>
> With crm (shell) you don't have transactions for node attributes,<br>
> but for the configuration. So if you add a location restriction<br>
> preventing any resources on your nodes, then enable the nodes, and<br>
> then delete the location restrictions in one 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 build transactions<br>
> to node status changes? The problem I see is this: For configuration<br>
> you always have transactions (requiring "commit), but for nodes you<br>
> traditionally have non (effects are immediate). So you'd need a<br>
> thing like "start transaction" which requires a "commit" or some<br>
> kind of abort later.<br>
><br>
> I also don't know whether a "shadow CIB" would help for the original<br>
> problem.<br>
><br>
> Ulrich<br>
><br>
> ><br>
> > You can probably hack it with a dampening value of a few seconds. If<br>
> > your rule checks for a particular value of the attribute, set all the<br>
> > nodes to a different value first, which will write that value and<br>
> start<br>
> > the dampening timer. Then set all the attributes to the desired value,<br>
> > and they will get written out together when the timer expires.<br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>