[ClusterLabs] Resolving cart before the horse with mounted filesystems.

Andrei Borzenkov arvidjaar at gmail.com
Fri Apr 30 12:30:43 EDT 2021

On 30.04.2021 17:26, Matthew Schumacher wrote:
> I have an issue that I'm not sure how to resolve so feedback is welcome.
> I need to mount a local NFS file system on my node before I start a
> VirtualDomain resource which depends on it, however, the NFS server is
> itself a resource on the cluster.
> This causes the cart before the horse.  If I insert a node into a
> running cluster, this is pretty simple, mount nfs before starting
> pacemaker, and if a VirtualDomain resource is immediately started, we
> already have what we need.  But that doesn't work on a cold cluster
> because if I try to mount NFS on the node before the cluster starts the
> NFS server, the mount fails.  If I always mount NFS after I start
> pacemaker, then pacemaker will usually try to start VirtualDomain
> resources before I can get further in the boot and mount NFS which
> causes the VirtualDomain resource to fail to start.
> I think I need one of the following fixes:
> 1.  Delayed start on VirtualDomain resources so that we give time to get
> the file system mounted which feels hackish as it's the old sleep fix
> for race conditions.
> 2.  Make the nfs mount itself a resource and make VirtualDomain
> resources depend on it.  In order for this to work each node would need
> it's own nfs mount resource, and VirtualDomain resources that can run on
> any node would need to depend on the nfs mount resource of whatever node
> they decide to run on but not the nfs mount resource of any other node. 

Which is exactly what clones are for. Clone NFS mount and order
VirtualDomain after clone. Just do not forget to set interleave=true so
VirtualDomain considers only local clone instance.

> I'm not sure how to make this work because the dependency changes with
> what node the VirtualDomain resource is started on.
> 3.  Make the VirtualDomain resource call a script on start/migrate that
> simply looks for the nfs mount, and if missing, try to mount. This seems
> less hackish, but will ensure that we always try to get the nfs mount
> going the first time the resource is moved/started there.
> Any ideas or thoughts would be very helpful and appreciated.
> Matt
> _______________________________________________
> Manage your subscription:
> https://lists.clusterlabs.org/mailman/listinfo/users
> ClusterLabs home: https://www.clusterlabs.org/

More information about the Users mailing list