[ClusterLabs] ethmonitor resource - for iface which does not exist yet - how?

Ken Gaillot kgaillot at redhat.com
Tue Jun 30 12:33:17 EDT 2020


On Tue, 2020-06-30 at 15:09 +0100, lejeczek wrote:
> 
> On 09/06/2020 15:22, Ken Gaillot wrote:
> > On Wed, 2020-06-03 at 12:33 +0100, lejeczek wrote:
> > > hi guys
> > > 
> > > I wonder about an idea of 'ethmonitor' watching a net iface
> > > which is of USB type. Such an iface which would physically
> > > roam between nodes.
> > > Would 'ethmonitor' work in such a case?
> > > I've tried and the resource actually got started (small
> > > two-node cluster) on the node which has USB iface physically
> > > absent?! That must be wrong, right?
> > > But if it's not and that how 'ethmonitor' works(the I got it
> > > wrong) then what else would be best resource agent for such
> > > a case of a USB net iface?
> > > 
> > > many thanks, L.
> > 
> > ethmonitor sets a node attribute for the node it's running on,
> > marking
> > whether the interface is active on that node.
> > 
> > It's typically configured as a clone running on all nodes,
> > monitoring
> > the same interface name.
> > 
> > These days, depending on distribution, interface names for
> > removable
> > devices might change from boot to boot by default. But there's
> > generally a way to assign a permanent interface name via udev.
> > 
> > As long as your interface name stays the same, you can use it for
> > what
> > you want -- configure it as a clone and you will get node
> > attributes on
> > every node (named ethmonitor-<INTERFACE_NAME> by default). You can
> > then
> > use location constraints with an attribute-based rule to keep
> > resources
> > where the interface is. See the man page for examples:
> > 
> > https://www.mankier.com/7/ocf_heartbeat_ethmonitor
> > 
> 
> But why would I need to clone such a ethmonitor resource?
> If ifaces naming is taken care of, then should a "regular"
> resource not just work?
> Then, if the interface exits in the node then 'ethmonitor'
> is started and colocation constraints just follow, no?
> Or I completely failed to grasp the need for 'clone' with
> 'ethmonitor' ?
> 
> many thanks, L.

The ethmonitor resource doesn't bring up or take down an interface, or
even monitor an interface for failure. It simply sets a node attribute
according to whether the interface is up or down on the node where it's
running.

The idea is that node attribute could then be used in location
constraint rules to determine where other resources should go.

If you configured it as a regular resource, it would not necessarily
run on the node that has the interface. It would run on a seemingly
random node, and set the node attribute according to whether that node
has the interface or not.

Configuring it as a clone means that node attribute will be set for all
nodes, and you can tell which node is running the interface by looking
at the node attributes.
-- 
Ken Gaillot <kgaillot at redhat.com>



More information about the Users mailing list