Managing Byte-Range Locks, Open File Handles, and NFSv4 Delegations
Use the following procedures to list and release byte-range locks and open file handles for a certain file, and also to view current NFSv4 file delegations.
List and Release Byte-Range Locks for a File (VAST Web UI)
To list and release byte-range locks for a file:
From the left navigation menu, select Element Store and then Views to open the Views page.
Right-click a view, select Multi-Protocol File State and then Byte-Range Locks.
The File Handles, Byte-Range Locks, And Delegations On A File dialog is displayed with the Byte-Range Locks tab opened.
Select a tenant in the Tenant field.
In the Full path field, enter the path to the locked file. This is formed as:
<view>/<filename>, where<view>is the view you selected (relative to the preselected tenant), and<filepath>is the path to the file locked by the client, relative to the path of the view.For example, supposing we created a view named
/Exportand we mounted the view onto an NFS client directory named/Directory. Suppose we create and lock a file under/Directorynamedexamplefile. To search for that lock, we need to search for the file path/Export/examplefile.Click Show Locks, Open Handles, And Delegations.
The grid below is populated with byte-range locks on the specified file.
The following information is displayed for each lock:
Lock Path
The path to the locked file.
Lock Type
The lock type:
NLM4 locks taken by NFSv3 clients
NFS4 locks taken by NFSv4 clients
SMB locks
Creation Time
The time the lock was acquired.
Caller
An identifier of the the client that acquired the lock. This could be an IP or host name of the client.
Owner
An identifier internal to the client kernel for the specific process that owns the lock.
Exclusive
Whether the lock is an exclusive (write) lock or a shared (read) lock.
Yes. The lock is an exclusive or write lock acquired by the client.
No. The lock is a shared, or read, lock. Many clients can access the file to read it, but no client may write to the locked byte range.
Granted Type
The type of delegation granted to the client.
READ. No other client has the ability to write to the file for the duration of the delegation.
WRITE. no other client has read or write access to the file for the duration of the delegation.
Length
The number of bytes of the file locked by the lock. A length of 0 means the lock reaches until the end of the file.
If both offset and length are
0, the entire file is locked.Offset
The number of bytes from the beginning of the file's byte range from which the lock begins.
Svid
A kernel identifier of the owning process on the client machine.
State
The lock's state ID.
Client ID
The lock's client ID.
Open ID
The lock's open ID.
Lock ID
The lock's lock ID.
Unlock ID
The lock's unlock ID.
If you want to release locks on the selected file, click Release All File Locks.
All the byte-range locks for the file are removed from the VAST Cluster server.
Release All Byte-Range File Locks for a View (VAST Web UI)
To release all byte range file locks under a view's directory and recursively in all its subdirectories:
From the left navigation menu, select Element Store and then Views to open the Views page.
Right-click the view for which you want to release locks and click Multi-Protocol File State -> Release All Locks from Directory and Sub Directories.
Confirm the action in the confirmation prompt.
List and Close Open File Handles for a File (VAST Web UI)
To list and close open file handles for a file:
From the left navigation menu, select Element Store and then Views to open the Views page.
Right-click a view, select Multi-Protocol File State and then Open Protocol Handles.
The File Handles, Byte-Range Locks, And Delegations On A File dialog is displayed with the Open Protocol Handles tab opened.
Select a tenant in the Tenant field.
In the Full path field, enter the path to the open file. This is formed as:
<view>/<filename>, where<view>is the view you selected (relative to the pre-selected tenant), and<filepath>is the path to the file opened by the client, relative to the path of the view.For example, supposing we created a view named
/ExportExampleand we mounted the view onto an NFS client directory named/DirectoryExample. Suppose we create and open a file under/DirectoryExamplenamedexamplefile. To search for that open file handle, we need to search for the file path/ExportExample/examplefile.Click Show Locks, Open Handles, And Delegations.
The grid below is populated with open file handles for the specified file.
The following information is displayed for each open file handle:
Protocol
The protocol used to open the file (SMB or NFS).
Client IP
The IP address of the client.
Username
The name of the user for which the handle was created.
Session ID
The ID of the session where the handle was created.
Unique ID
The unique ID of the handle.
Share Access
SMB share permissions.
Access mask
A list of SMB access masks.
Lease
Indicates whether there is an SMB lease on the file.
File Mode
NFS file permissions.
NFSv4 sequence ID
The NFSv4 sequence number used in the lock request.
Select a handle you want to close and choose Close in the context menu. Note that this action is supported for SMB handles only.
List NFSv4 File Delegations for a File (VAST Web UI)
To list and revoke NFsv4 file delegations for a file:
From the left navigation menu, select Element Store and then Views to open the Views page.
Right-click a view, select Multi-Protocol File State and then NFSv4 Delegations.
The File Handles, Byte-Range Locks, And Delegations On A File dialog is displayed with the NFSv4 Delegations tab opened.
Select a tenant in the Tenant field.
In the Full path field, enter the path to the locked file. This is formed as:
<view>/<filename>, where<view>is the view you selected (relative to the preselected tenant), and<filepath>is the path to the file locked by the client, relative to the path of the view.For example, supposing we created a view named
/Exportand we mounted the view onto an NFS client directory named/Directory. Suppose we create and lock a file under/Directorynamedexamplefile. To search for that lock, we need to search for the file path/Export/examplefile.Click Show Locks, Open Handles, And Delegations.
The grid below is populated with byte-range locks on the specified file.
The following information is displayed for each lock:
Client IP
The IP of the client to which the delegation was granted.
Delegation Type
Indicates the delegation type: read or write.
Delegation StateID
The state ID of the delegation.
Revoke in Progress
Indicates if the delegation is being revoked.
If you want to revoke a delegation, right-click it and choose Revoke in the context menu.
Manage Byte-Range Locks, Open Handles and NFSv4 Delegations in VAST CLI
Use the following commands to manage byte-range locks, open handles and NFSv4 file delegations in VAST CLI:
List byte-range locks for a path | |
Release byte-range locks for a path | |
List open file handles for a path | |
Close an open file handle | |
Close open files | |
List NFSv4 file delegations for a tenant | |
Revoke NFSv4 file delegations for a tenant |
Managing Open SMB Files
For each SMB-enabled view, you can list all SMB open files and/or SMB byte-range locks for a certain directory and unlock the files as needed. The following actions are supported:
List all open files and directories under a certain path
Close selected files or folders (will close all open handles on files)
Unlock all SMB byte-range locks on selected files
List all open handles of a single chosen file or folder
Release selected open handles of a single chosen file or folder
To list open files, you run an open file query. You can create a new query or select one of queries that you've run previously.
Managing Open SMB Files in VAST Web UI
Run an Open File Query
To search for open files on an SMB view:
From the left navigation menu, select Element Store and then Views to open the Views page.
Right-click an SMB-enabled view and choose Open SMB Files -> SMB Locks & Open Handles to open the SMB Locks & Open Handles dialog.
Do either of the following:
If you want to create and run a new query, use the Define query pane:
In the File prefix field, enter the path to the directory to search for open files.
This field is prepopulated with a path to the current view's root directory. Append it with a relative path to the directory you want. If you omit the ending slash, it will be added automatically when processing the query.
Note that the search will not include subdirectories.
Select Return only files with byte-range-locks if you want the query to return only files that have SMB byte-range locks on them. If this checkbox is not selected, both open handles and byte-range locks are displayed.
Click Start query.
If you want to rerun one of prior queries, select the query you want in the Past queries pane and click Start query.
VAST Cluster runs the query and displays a list of open files. For each file, there is an indication whether it has SMB byte-range locks on it.
View All Open Handles for a File
To list all open handles for a file included in open file query results:
Right-click the file and choose List All Open Handles.
A list of open handles for the file is displayed, including the following information per handle:
Client IP | The IP address of the client. |
Share Access | SMB share permissions. |
Username | The name of the user for which the handle was created. |
Session ID | The ID of the session where the handle was created. |
Unique ID | The unique ID of the handle. |
Has Locks | Indicates whether the file has byte-range locks on it. |
Access mask | A list of SMB access masks. |
Lease | Indicates whether there is a lease on the file. |
Close Open Handles
To close all open handles and release all SMB byte-range locks for a file:
Run an open file query for the path where the file resides.
Right-click the file in the query results and choose Close All Handles and Locks.
To close one or more specific handles for a file included in open file query results:
Run an open file query for the path where the file resides.
Right-click the file in the query results and choose List All Open Handles to view a list of open handles for the file.
Select one or more handles you want to close. Up to five handles can be selected.
Right-click the selection and choose the option to close handles.
Click Yes in the confirmation prompt.
Release Byte-Range Locks for a File
To release byte-range locks for a file:
Run an open file query for the path where the file resides.
Right-click the file in the query results and choose Release Byte-Range Locks.
Managing Open SMB Files in VAST CLI
Use the following VAST CLI commands to manage SMB open files:
Create a query to search for open files |
|
Delete an open file query |
|
List open file queries |
|
View details of an open file query |
|
Run an open file query |
|
Close an open file |
|
Retrieve open file handles for a file |
|
View open file handles for a file |
|
Close a particular file handle |
|