ewwhite / zfs-ha

ZFS High-Availability NAS
749 stars 76 forks source link

How best to handle locking over NFS #36

Closed tullis closed 3 years ago

tullis commented 3 years ago

Thanks @ewwhite for your hard work on this. The system that I am building based upon this guide is in testing now, but I have an issue regarding locks over NFS.

I have an NFS export defined for virtual machines, using the sharenfs parameter.

The options are: sync,no_subtree_check,no_wdelay.

I have mounted this NFS share on a Linux client and I am using it to host a VM for test purposes.

When I try a managed failover, the ZFS resource in pacemaker attempts to export the pool, but it gets an error that the pool is in use. For example.

notice: zflash_stop_0:43741:stderr [ umount: /srv/zflash_vm_disks: target is busy. ]
notice: zflash_stop_0:43741:stderr [ cannot unmount '/srv/zflash_vm_disks': umount failed ]

There are no other local processes on the machine, so I think that it is only the only NFS kernel server that is holding the locks open. The protocol in use is NFS version 4.2.

Do you tend to use NFS version 3 for this kind of requirement, where nolock can be specified on the client?

ewwhite commented 3 years ago

Hello. This works best with NFS3.

tullis commented 3 years ago

Thanks very much.