<div dir="ltr">&gt; <span style="font-size:12.8px">I think stickiness will do what you want here. Set a stickiness higher</span><br style="font-size:12.8px"><span style="font-size:12.8px">&gt; than the original node&#39;s preference, and the resource will want to stay</span><br style="font-size:12.8px"><span style="font-size:12.8px">&gt; where it is.</span><div><span style="font-size:12.8px"><br></span><div><span style="font-size:12.8px">Not sure I understand this. Stickiness will ensure that resources don&#39;t move back when original node comes back up, isn&#39;t it?</span></div></div><div><span style="font-size:12.8px">But in my case, I want the newly standby node to become the backup node for all other nodes. i.e. it should now be able to run all my resource groups albeit with a lower score. How do I achieve that? </span></div><div><span style="font-size:12.8px">Also can you answer, how to get the values of node that goes active and the node that goes down inside the OCF agent?  Do I need to use notification or some simpler alternative is available?</span></div><div><span style="font-size:12.8px">Thanks.</span></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 8, 2016 at 9:30 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"><div class="HOEnZb"><div class="h5">On 01/08/2016 06:55 AM, Nikhil Utane wrote:<br>
&gt; Would like to validate my final config.<br>
&gt;<br>
&gt; As I mentioned earlier, I will be having (upto) 5 active servers and 1<br>
&gt; standby server.<br>
&gt; The standby server should take up the role of active that went down. Each<br>
&gt; active has some unique configuration that needs to be preserved.<br>
&gt;<br>
&gt; 1) So I will create total 5 groups. Each group has a &quot;heartbeat::IPaddr2<br>
&gt; resource (for virtual IP) and my custom resource.<br>
&gt; 2) The virtual IP needs to be read inside my custom OCF agent, so I will<br>
&gt; make use of attribute reference and point to the value of IPaddr2 inside my<br>
&gt; custom resource to avoid duplication.<br>
&gt; 3) I will then configure location constraint to run the group resource on 5<br>
&gt; active nodes with higher score and lesser score on standby.<br>
&gt; For e.g.<br>
&gt; Group              Node            Score<br>
&gt; ---------------------------------------------<br>
&gt; MyGroup1        node1           500<br>
&gt; MyGroup1        node6           0<br>
&gt;<br>
&gt; MyGroup2        node2           500<br>
&gt; MyGroup2        node6           0<br>
&gt; ..<br>
&gt; MyGroup5        node5           500<br>
&gt; MyGroup5        node6           0<br>
&gt;<br>
&gt; 4) Now if say node1 were to go down, then stop action on node1 will first<br>
&gt; get called. Haven&#39;t decided if I need to do anything specific here.<br>
<br>
</div></div>To clarify, if node1 goes down intentionally (e.g. standby or stop),<br>
then all resources on it will be stopped first. But if node1 becomes<br>
unavailable (e.g. crash or communication outage), it will get fenced.<br>
<span class=""><br>
&gt; 5) But when the start action of node 6 gets called, then using crm command<br>
&gt; line interface, I will modify the above config to swap node 1 and node 6.<br>
&gt; i.e.<br>
&gt; MyGroup1        node6           500<br>
&gt; MyGroup1        node1           0<br>
&gt;<br>
&gt; MyGroup2        node2           500<br>
&gt; MyGroup2        node1           0<br>
&gt;<br>
&gt; 6) To do the above, I need the newly active and newly standby node names to<br>
&gt; be passed to my start action. What&#39;s the best way to get this information<br>
&gt; inside my OCF agent?<br>
<br>
</span>Modifying the configuration from within an agent is dangerous -- too<br>
much potential for feedback loops between pacemaker and the agent.<br>
<br>
I think stickiness will do what you want here. Set a stickiness higher<br>
than the original node&#39;s preference, and the resource will want to stay<br>
where it is.<br>
<span class=""><br>
&gt; 7) Apart from node name, there will be other information which I plan to<br>
&gt; pass by making use of node attributes. What&#39;s the best way to get this<br>
&gt; information inside my OCF agent? Use crm command to query?<br>
<br>
</span>Any of the command-line interfaces for doing so should be fine, but I&#39;d<br>
recommend using one of the lower-level tools (crm_attribute or<br>
attrd_updater) so you don&#39;t have a dependency on a higher-level tool<br>
that may not always be installed.<br>
<div class="HOEnZb"><div class="h5"><br>
&gt; Thank You.<br>
&gt;<br>
&gt; On Tue, Dec 22, 2015 at 9:44 PM, Nikhil Utane &lt;<a href="mailto:nikhil.subscribed@gmail.com">nikhil.subscribed@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;<br>
&gt;&gt; Thanks to you Ken for giving all the pointers.<br>
&gt;&gt; Yes, I can use service start/stop which should be a lot simpler. Thanks<br>
&gt;&gt; again. :)<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Dec 22, 2015 at 9:29 PM, Ken Gaillot &lt;<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; On 12/22/2015 12:17 AM, Nikhil Utane wrote:<br>
&gt;&gt;&gt;&gt; I have prepared a write-up explaining my requirements and current<br>
&gt;&gt;&gt; solution<br>
&gt;&gt;&gt;&gt; that I am proposing based on my understanding so far.<br>
&gt;&gt;&gt;&gt; Kindly let me know if what I am proposing is good or there is a better<br>
&gt;&gt;&gt; way<br>
&gt;&gt;&gt;&gt; to achieve the same.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt; <a href="https://drive.google.com/file/d/0B0zPvL-Tp-JSTEJpcUFTanhsNzQ/view?usp=sharing" rel="noreferrer" target="_blank">https://drive.google.com/file/d/0B0zPvL-Tp-JSTEJpcUFTanhsNzQ/view?usp=sharing</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Let me know if you face any issue in accessing the above link. Thanks.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; This looks great. Very well thought-out.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; One comment:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; &quot;8. In the event of any failover, the standby node will get notified<br>
&gt;&gt;&gt; through an event and it will execute a script that will read the<br>
&gt;&gt;&gt; configuration specific to the node that went down (again using<br>
&gt;&gt;&gt; crm_attribute) and become active.&quot;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; It may not be necessary to use the notifications for this. Pacemaker<br>
&gt;&gt;&gt; will call your resource agent with the &quot;start&quot; action on the standby<br>
&gt;&gt;&gt; node, after ensuring it is stopped on the previous node. Hopefully the<br>
&gt;&gt;&gt; resource agent&#39;s start action has (or can have, with configuration<br>
&gt;&gt;&gt; options) all the information you need.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; If you do end up needing notifications, be aware that the feature will<br>
&gt;&gt;&gt; be disabled by default in the 1.1.14 release, because changes in syntax<br>
&gt;&gt;&gt; are expected in further development. You can define a compile-time<br>
&gt;&gt;&gt; constant to enable them.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br></div>