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

Ken Gaillot kgaillot at redhat.com
Fri Apr 30 11:11:19 EDT 2021

On Fri, 2021-04-30 at 07:26 -0700, 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.  
> I'm not sure how to make this work because the dependency changes
> with 
> what node the VirtualDomain resource is started on.

If each VM needs a particular mount, you can clone the NFS server,
create separate groups where groupN = (mountN, vmN), and colocate/order
the groups relative to the clone.

> 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/
Ken Gaillot <kgaillot at redhat.com>

More information about the Users mailing list