<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Another idea is to create a pacemaker:HealthCPU resource that
updates the #health-cpu attribute.<br>
Now you can add a location constraint to your resource to migrate
away if #health-cpu is, lets say 'red'.<br>
<br>
# pcs resource describe ocf:pacemaker:HealthCPU<br>
Resource options for: ocf:pacemaker:HealthCPU<br>
state: Location to store the resource state in.<br>
yellow_limit: Lower (!) limit of idle percentage to switch the
health attribute to yellow. I.e. the #health-cpu will go yellow if
the<br>
%idle of the CPU falls below 50%.<br>
red_limit: Lower (!) limit of idle percentage to switch the health
attribute to red. I.e. the #health-cpu will go red if the %idle of<br>
the CPU falls below 10%.<br>
<br>
# pcs resource create resHealthCPU HealthCPU<br>
# pcs constraint location resMyResource rule score=-INFINITY
'#health-cpu' eq red<br>
<br>
The same exists to query the S.M.A.R.T status of your hard disks.<br>
<br>
<br>
Frank<br>
<br>
<div class="moz-cite-prefix">Am 21.02.2014 08:37, schrieb Dan
Markhasin:<br>
</div>
<blockquote
cite="mid:CAA_=sh6pktof_7q4h8wFW01CXzCTkP59DkzEL9W0uHVBXht=_Q@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<div dir="ltr">Good idea, thanks. :-)</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Fri, Feb 21, 2014 at 1:58 AM, Andrew
Beekhof <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:andrew@beekhof.net" target="_blank">andrew@beekhof.net</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=""><br>
On 20 Feb 2014, at 7:34 pm, Dan Markhasin <<a
moz-do-not-send="true" href="mailto:minimizer@gmail.com">minimizer@gmail.com</a>>
wrote:<br>
<br>
> Hi,<br>
><br>
> I am wondering if it is possible to configure
complex/custom migration rules, so resources would migrate
in case there is a problem with the current node it is
running on.<br>
><br>
> i.e.<br>
><br>
> If the node has a bad disk, or high load, the
resource should be migrated to a different node.<br>
<br>
</div>
If you write a resource agent that monitors any or all of
the above conditions and add it to the cluster as an
unmanaged clone resource, then you can colocate things with
it.<br>
At the point the disk goes bad, the resource appears to have
stopped and the real resources will be moved somewhere else.<br>
<div class=""><br>
> I didn't find any examples for such custom rules in
the documentation. Is it possible ?<br>
><br>
> Thanks,<br>
> Dan<br>
</div>
> _______________________________________________<br>
> Pacemaker mailing list: <a moz-do-not-send="true"
href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a><br>
> <a moz-do-not-send="true"
href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker"
target="_blank">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br>
><br>
> Project Home: <a moz-do-not-send="true"
href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a><br>
> Getting started: <a moz-do-not-send="true"
href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf"
target="_blank">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
> Bugs: <a moz-do-not-send="true"
href="http://bugs.clusterlabs.org" target="_blank">http://bugs.clusterlabs.org</a><br>
<br>
<br>
_______________________________________________<br>
Pacemaker mailing list: <a moz-do-not-send="true"
href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a><br>
<a moz-do-not-send="true"
href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker"
target="_blank">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br>
<br>
Project Home: <a moz-do-not-send="true"
href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a><br>
Getting started: <a moz-do-not-send="true"
href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf"
target="_blank">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
Bugs: <a moz-do-not-send="true"
href="http://bugs.clusterlabs.org" target="_blank">http://bugs.clusterlabs.org</a><br>
<br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Pacemaker mailing list: <a class="moz-txt-link-abbreviated" href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a>
<a class="moz-txt-link-freetext" href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a>
Project Home: <a class="moz-txt-link-freetext" href="http://www.clusterlabs.org">http://www.clusterlabs.org</a>
Getting started: <a class="moz-txt-link-freetext" href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a>
Bugs: <a class="moz-txt-link-freetext" href="http://bugs.clusterlabs.org">http://bugs.clusterlabs.org</a>
</pre>
</blockquote>
<br>
<br>
</body>
</html>