<div dir="ltr">Andrew,<div> Will you let me know if using the rule (assuming this rule works) <span style="font-family:arial,sans-serif;font-size:13px">pcs -f $CLUSTER_CREATE_LOG constraint location vha-$uuid rule score=-INFINITY \#uname ne vsanqa11 and \#uname ne vsanqa12 might help in resolving unexpected demote ?</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Regards,</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"> Kiran</span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 30, 2014 at 11:58 AM, K Mehta <span dir="ltr">&lt;<a href="mailto:kiranmehta1981@gmail.com" target="_blank">kiranmehta1981@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">any update ?</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">
On Thu, May 29, 2014 at 9:08 AM, K Mehta <span dir="ltr">&lt;<a href="mailto:kiranmehta1981@gmail.com" target="_blank">kiranmehta1981@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">In which pcs version is this issue fixed ?<div><div><br><br>On Wednesday, May 28, 2014, K Mehta &lt;<a href="mailto:kiranmehta1981@gmail.com" target="_blank">kiranmehta1981@gmail.com</a>&gt; wrote:<br>

&gt; Chris,<br>&gt; Here is the required information<br>
&gt; [root@vsanqa11 ~]# rpm -qa | grep pcs ; rpm -qa | grep pacemaker ; uname -a ; cat /etc/redhat-release<br>&gt; pcs-0.9.90-2.el6.centos.2.noarch<br>&gt; pacemaker-cli-1.1.10-14.el6_5.3.x86_64<br>&gt; pacemaker-libs-1.1.10-14.el6_5.3.x86_64<br>


&gt; pacemaker-1.1.10-14.el6_5.3.x86_64<br>&gt; pacemaker-cluster-libs-1.1.10-14.el6_5.3.x86_64<br>&gt; Linux vsanqa11 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux<br>&gt; CentOS release 6.3 (Final)<br>


&gt;<br>&gt; Regards,<br>&gt;  Kiran<br>&gt;<br>&gt; On Wed, May 28, 2014 at 2:47 AM, Chris Feist &lt;<a href="mailto:cfeist@redhat.com" target="_blank">cfeist@redhat.com</a>&gt; wrote:<br>&gt;<br>&gt; On 05/27/14 05:38, K Mehta wrote:<br>


&gt;<br>&gt; One more question.<br>&gt; With crmsh, it was easy to add constraint to avoid a resource from running only<br>&gt; a subset(say vsanqa11 and vsanqa12) of nodes using the following command<br>&gt;<br>&gt; crm configure location ms-${uuid}-nodes ms-$uuid rule -inf: \#uname ne vsanqa11<br>


&gt; and \#uname ne  vsanqa12<br>&gt; [root@vsanqa11 ~]# pcs constraint show --full<br>&gt; Location Constraints:<br>&gt;    Resource: ms-c6933988-9e5c-419e-8fdf-744100d76ad6<br>&gt;      Constraint: ms-c6933988-9e5c-419e-8fdf-744100d76ad6-nodes<br>


&gt;        Rule: score=-INFINITY<br>&gt;   (id:ms-c6933988-9e5c-419e-8fdf-744100d76ad6-nodes-rule)<br>&gt;          Expression: #uname ne vsanqa11<br>&gt;   (id:ms-c6933988-9e5c-419e-8fdf-744100d76ad6-nodes-expression)<br>


&gt;          Expression: #uname ne vsanqa12<br>&gt;   (id:ms-c6933988-9e5c-419e-8fdf-744100d76ad6-nodes-expression-0)<br>&gt; Ordering Constraints:<br>&gt; Colocation Constraints:<br>&gt;<br>&gt; So, both expression are part of the same rule as expected.<br>


&gt;<br>&gt;<br>&gt;<br>&gt; With pcs, I am not sure how to use avoid constraints if I need a resource to run<br>&gt; on vsanqa11 and vsanqa12 and not on any other node.<br>&gt; So I tried adding location constraint as follows:<br>


&gt; pcs -f $CLUSTER_CREATE_LOG constraint location vha-$uuid rule score=-INFINITY<br>&gt; \#uname ne vsanqa11 and \#uname ne vsanqa12<br>&gt; Even though no error is thrown, the condition after &quot;and&quot; is silently dropped as<br>


&gt; shown below<br>&gt;<br>&gt; [root@vsanqa11 ~]# pcs constraint show --full<br>&gt; Location Constraints:<br>&gt;    Resource: ms-c6933988-9e5c-419e-8fdf-744100d76ad6<br>&gt;      Constraint: location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6<br>


&gt;        Rule: score=-INFINITY<br>&gt;   (id:location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6-rule)<br>&gt;          Expression: #uname ne vsanqa11<br>&gt;   (id:location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6-rule-expr)<br>


&gt; Ordering Constraints:<br>&gt; Colocation Constraints:<br>&gt;<br>&gt;<br>&gt; Then I tried the following<br>&gt; pcs -f $CLUSTER_CREATE_LOG constraint location vha-$uuid rule score=-INFINITY<br>&gt; \#uname ne vsanqa11<br>


&gt; pcs -f $CLUSTER_CREATE_LOG constraint location vha-$uuid rule score=-INFINITY<br>&gt; \#uname ne vsanqa12<br>&gt;<br>&gt; but running these two commands did not help either. Expressions were added to<br>&gt; separate rules.<br>


&gt;<br>&gt; [root@vsanqa11 ~]# pcs constraint show --full<br>&gt; Location Constraints:<br>&gt;    Resource: ms-c6933988-9e5c-419e-8fdf-744100d76ad6<br>&gt;      Constraint: location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6-1<br>


&gt;        Rule: score=-INFINITY<br>&gt;   (id:location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6-1-rule)<br>&gt;          Expression: #uname ne vsanqa12<br>&gt;   (id:location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6-1-rule-expr)<br>


&gt;      Constraint: location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6<br>&gt;        Rule: score=-INFINITY<br>&gt;   (id:location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6-rule)<br>&gt;          Expression: #uname ne vsanqa11<br>


&gt;   (id:location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6-rule-expr)<br>&gt; Ordering Constraints:<br>&gt; Colocation Constraints:<br>&gt;<br>&gt;<br>&gt; Also, tried using multistate resource name<br>&gt; [root@vsanqa11 ~]# pcs constraint location<br>


&gt; ms-c6933988-9e5c-419e-8fdf-744100d76ad6 rule score=-INFINITY \#uname ne vsanqa11<br>&gt; Error: &#39;ms-c6933988-9e5c-419e-8fdf-744100d76ad6&#39; is not a resource<br>&gt;<br>&gt;<br>&gt; Can anyone let me correct command for this ?<br>


&gt;<br>&gt; Which version of pcs are you using (and what distribution)?  This has been fixed upstream.  (Below is a test from my system using the upstream pcs).<br>&gt;<br>&gt; [root@rh7-1 pcs]# pcs constraint location D1 rule score=-INFINITY \#uname ne vsanqa11 and \#uname ne vsanqa12<br>


&gt; [root@rh7-1 pcs]# pcs constraint<br>&gt; Location Constraints:<br>&gt;   Resource: D1<br>&gt;     Constraint: location-D1<br>&gt;       Rule: score=-INFINITY boolean-op=and<br>&gt;         Expression: #uname ne vsanqa11<br>


&gt;         Expression: #uname ne vsanqa12<br>&gt;<br>&gt; Thanks,<br>&gt; Chris<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; On Tue, May 27, 2014 at 11:01 AM, Andrew Beekhof &lt;<a href="mailto:andrew@beekhof.net" target="_blank">andrew@beekhof.net</a><br>


&gt; &lt;mailto:
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>