Disabling oplocks for a vsan fileshare
search cancel

Disabling oplocks for a vsan fileshare

book

Article ID: 415224

calendar_today

Updated On:

Products

VMware vSAN

Issue/Introduction

High availability setup in some applications such as ArcGIS Server using a vSAN SMB fileshare fails
While the application runs with one of the two node powered on, when the second node is powered on, the application fails.

Environment

vSAN
vSAN File Service
vSAN SMB File Share

Cause

It may be required by some applications such as ArcGIS to have oplocks feature on a vSAN SMB fileshare disabled for a high availability setup to work.

Resolution

Over a SSH session to an ESXi host in the vSAN cluster, take the following steps to disable the oplocks feature on the vSAN SMB file share:
Note: These steps need to be performed on all the SMB file shares in question as this setting are per SMB share and not a cluster-wide setting

  1. Obtain the current path to smb.conf file:
    grep -i "<name of the share>" /vmfs/volumes/vdfsDatastore/*/volumes/*/default/*/*/etc/smb.conf
    Sample Output:
    [root@esxi01:~] grep -i "fileshare1" /vmfs/volumes/vdfsDatastore/*/volumes/*/default/*/*/etc/smb.conf
    /vmfs/volumes/vdfsDatastore/########-####-####-####-############/volumes/########-####-####-####-############/default/########-####-####-####-############/vsanfs1/etc/smb.conf:[fileserver1$]

  2. Use the vi editor to add 'oplocks = no' at the end of the smb.conf file:
    vi <path obtained in step 1>/smb.conf

  3. Verify that the file is updated
    grep oplocks <path obtained in step 1>
    Sample Output:
    [root@esxi01:~] grep oplocks /vmfs/volumes/vdfsDatastore/########-####-####-####-############/volumes/########-####-####-####-############/default/########-####-####-####-############/vsanfs1/etc/smb.conf
    ..
    ..
    oplocks = no

Note: Do not touch  and keep the value 'kernel oplocks' unchanged

Additional Information

Oplocks, or opportunistic locks, are a performance-enhancing technique used in network file sharing environments like SMB (Server Message Block) to allow a client to cache a file on its local machine. By reducing the need to communicate with the server for every read or write, oplocks significantly improve network performance and speed up file access. These locks can be broken by the server if another client needs access to the same file.

The following page provides a comprehensive reference detailing the format, sections, and numerous parameters for configuring the Samba suite of programs: smb.conf — The configuration file for the Samba suite