[Pacemaker] Migrating resources on custom conditions

Frank Brendel frank.brendel at eurolog.com
Fri Feb 21 03:19:51 EST 2014


Another idea is to create a pacemaker:HealthCPU resource that updates 
the #health-cpu attribute.
Now you can add a location constraint to your resource to migrate away 
if #health-cpu is, lets say 'red'.

# pcs resource describe ocf:pacemaker:HealthCPU
Resource options for: ocf:pacemaker:HealthCPU
   state: Location to store the resource state in.
   yellow_limit: Lower (!) limit of idle percentage to switch the health 
attribute to yellow. I.e. the #health-cpu will go yellow if the
                 %idle of the CPU falls below 50%.
   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
              the CPU falls below 10%.

# pcs resource create resHealthCPU HealthCPU
# pcs constraint location resMyResource rule score=-INFINITY 
'#health-cpu' eq red

The same exists to query the S.M.A.R.T status of your hard disks.


Frank

Am 21.02.2014 08:37, schrieb Dan Markhasin:
> Good idea, thanks. :-)
>
>
> On Fri, Feb 21, 2014 at 1:58 AM, Andrew Beekhof <andrew at beekhof.net 
> <mailto:andrew at beekhof.net>> wrote:
>
>
>     On 20 Feb 2014, at 7:34 pm, Dan Markhasin <minimizer at gmail.com
>     <mailto:minimizer at gmail.com>> wrote:
>
>     > Hi,
>     >
>     > 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.
>     >
>     > i.e.
>     >
>     > If the node has a bad disk, or high load, the resource should be
>     migrated to a different node.
>
>     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.
>     At the point the disk goes bad, the resource appears to have
>     stopped and the real resources will be moved somewhere else.
>
>     > I didn't find any examples for such custom rules in the
>     documentation. Is it possible ?
>     >
>     > Thanks,
>     > Dan
>     > _______________________________________________
>     > Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
>     <mailto:Pacemaker at oss.clusterlabs.org>
>     > http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>     >
>     > Project Home: http://www.clusterlabs.org
>     > Getting started:
>     http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
>     > Bugs: http://bugs.clusterlabs.org
>
>
>     _______________________________________________
>     Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
>     <mailto:Pacemaker at oss.clusterlabs.org>
>     http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
>     Project Home: http://www.clusterlabs.org
>     Getting started:
>     http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
>     Bugs: http://bugs.clusterlabs.org
>
>
>
>
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20140221/6c33d31d/attachment-0003.html>


More information about the Pacemaker mailing list