<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"><<a href="mailto:kiranmehta1981@gmail.com" target="_blank">kiranmehta1981@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">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"><<a href="mailto:kiranmehta1981@gmail.com" target="_blank">kiranmehta1981@gmail.com</a>></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 <<a href="mailto:kiranmehta1981@gmail.com" target="_blank">kiranmehta1981@gmail.com</a>> wrote:<br>
> Chris,<br>> Here is the required information<br>
> [root@vsanqa11 ~]# rpm -qa | grep pcs ; rpm -qa | grep pacemaker ; uname -a ; cat /etc/redhat-release<br>> pcs-0.9.90-2.el6.centos.2.noarch<br>> pacemaker-cli-1.1.10-14.el6_5.3.x86_64<br>> pacemaker-libs-1.1.10-14.el6_5.3.x86_64<br>
> pacemaker-1.1.10-14.el6_5.3.x86_64<br>> pacemaker-cluster-libs-1.1.10-14.el6_5.3.x86_64<br>> 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>> CentOS release 6.3 (Final)<br>
><br>> Regards,<br>> Kiran<br>><br>> On Wed, May 28, 2014 at 2:47 AM, Chris Feist <<a href="mailto:cfeist@redhat.com" target="_blank">cfeist@redhat.com</a>> wrote:<br>><br>> On 05/27/14 05:38, K Mehta wrote:<br>
><br>> One more question.<br>> With crmsh, it was easy to add constraint to avoid a resource from running only<br>> a subset(say vsanqa11 and vsanqa12) of nodes using the following command<br>><br>> crm configure location ms-${uuid}-nodes ms-$uuid rule -inf: \#uname ne vsanqa11<br>
> and \#uname ne vsanqa12<br>> [root@vsanqa11 ~]# pcs constraint show --full<br>> Location Constraints:<br>> Resource: ms-c6933988-9e5c-419e-8fdf-744100d76ad6<br>> Constraint: ms-c6933988-9e5c-419e-8fdf-744100d76ad6-nodes<br>
> Rule: score=-INFINITY<br>> (id:ms-c6933988-9e5c-419e-8fdf-744100d76ad6-nodes-rule)<br>> Expression: #uname ne vsanqa11<br>> (id:ms-c6933988-9e5c-419e-8fdf-744100d76ad6-nodes-expression)<br>
> Expression: #uname ne vsanqa12<br>> (id:ms-c6933988-9e5c-419e-8fdf-744100d76ad6-nodes-expression-0)<br>> Ordering Constraints:<br>> Colocation Constraints:<br>><br>> So, both expression are part of the same rule as expected.<br>
><br>><br>><br>> With pcs, I am not sure how to use avoid constraints if I need a resource to run<br>> on vsanqa11 and vsanqa12 and not on any other node.<br>> So I tried adding location constraint as follows:<br>
> pcs -f $CLUSTER_CREATE_LOG constraint location vha-$uuid rule score=-INFINITY<br>> \#uname ne vsanqa11 and \#uname ne vsanqa12<br>> Even though no error is thrown, the condition after "and" is silently dropped as<br>
> shown below<br>><br>> [root@vsanqa11 ~]# pcs constraint show --full<br>> Location Constraints:<br>> Resource: ms-c6933988-9e5c-419e-8fdf-744100d76ad6<br>> Constraint: location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6<br>
> Rule: score=-INFINITY<br>> (id:location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6-rule)<br>> Expression: #uname ne vsanqa11<br>> (id:location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6-rule-expr)<br>
> Ordering Constraints:<br>> Colocation Constraints:<br>><br>><br>> Then I tried the following<br>> pcs -f $CLUSTER_CREATE_LOG constraint location vha-$uuid rule score=-INFINITY<br>> \#uname ne vsanqa11<br>
> pcs -f $CLUSTER_CREATE_LOG constraint location vha-$uuid rule score=-INFINITY<br>> \#uname ne vsanqa12<br>><br>> but running these two commands did not help either. Expressions were added to<br>> separate rules.<br>
><br>> [root@vsanqa11 ~]# pcs constraint show --full<br>> Location Constraints:<br>> Resource: ms-c6933988-9e5c-419e-8fdf-744100d76ad6<br>> Constraint: location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6-1<br>
> Rule: score=-INFINITY<br>> (id:location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6-1-rule)<br>> Expression: #uname ne vsanqa12<br>> (id:location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6-1-rule-expr)<br>
> Constraint: location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6<br>> Rule: score=-INFINITY<br>> (id:location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6-rule)<br>> Expression: #uname ne vsanqa11<br>
> (id:location-vha-c6933988-9e5c-419e-8fdf-744100d76ad6-rule-expr)<br>> Ordering Constraints:<br>> Colocation Constraints:<br>><br>><br>> Also, tried using multistate resource name<br>> [root@vsanqa11 ~]# pcs constraint location<br>
> ms-c6933988-9e5c-419e-8fdf-744100d76ad6 rule score=-INFINITY \#uname ne vsanqa11<br>> Error: 'ms-c6933988-9e5c-419e-8fdf-744100d76ad6' is not a resource<br>><br>><br>> Can anyone let me correct command for this ?<br>
><br>> 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>><br>> [root@rh7-1 pcs]# pcs constraint location D1 rule score=-INFINITY \#uname ne vsanqa11 and \#uname ne vsanqa12<br>
> [root@rh7-1 pcs]# pcs constraint<br>> Location Constraints:<br>> Resource: D1<br>> Constraint: location-D1<br>> Rule: score=-INFINITY boolean-op=and<br>> Expression: #uname ne vsanqa11<br>
> Expression: #uname ne vsanqa12<br>><br>> Thanks,<br>> Chris<br>><br>><br>><br>><br>><br>><br>> On Tue, May 27, 2014 at 11:01 AM, Andrew Beekhof <<a href="mailto:andrew@beekhof.net" target="_blank">andrew@beekhof.net</a><br>
> <mailto:
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>