In a shared storage environment, when multiple ESXi hosts access the same VMFS datastore, locking mechanisms are used. The locking mechanisms prevent multiple hosts from concurrently writing to the metadata and ensure that no data corruption occurs. VMFS supports ATS-only and ATS+SCSI locking. Learn how to display information about locking mechanisms, how to change from ATS+SCSI to ATS-only, or how to downgrade to ATS+SCSI.

To learn more about VMFS as a cluster file system, see vSphere VMFS Datastore Concepts and Operations.

Depending on its configuration and the type of underlying storage, a VMFS datastore can use different types of locking mechanisms. It can exclusively use the atomic test and set locking mechanism (ATS-only), or use a combination of ATS and SCSI reservations (ATS+SCSI).

ATS-Only Mechanism

For storage devices that support T10 standard-based VAAI specifications, VMFS provides ATS locking, also called hardware assisted locking. The ATS algorithm supports discrete locking per disk sector. All newly formatted VMFS5 and VMFS6 datastores use the ATS-only mechanism if the underlying storage supports it, and never use SCSI reservations.

When you create a multi-extent datastore where ATS is used, vCenter Server filters out non-ATS devices. This filtering allows you to use only those devices that support the ATS primitive.

In certain cases, you might need to change the default locking mechanism for a VMFS5 or VMFS6 datastore. For information, see Change Locking Mechanism to ATS+SCSI.

Note: If you are running a VMware vSAN environment or have ATS-only VMFS volumes, do not deactivate ATS. Deactivating ATS might result in an outage as no locking mechanism is available. For more information, see a VMware Knowledge Base article.

ATS+SCSI Mechanism

A VMFS datastore that supports the ATS+SCSI mechanism is configured to use ATS and attempts to use it when possible. If ATS fails, the VMFS datastore reverts to SCSI reservations. In contrast with the ATS locking, the SCSI reservations lock an entire storage device while an operation that requires metadata protection is performed. After the operation completes, VMFS releases the reservation, and other operations can continue.

Datastores that use the ATS+SCSI mechanism include VMFS5 datastores that were upgraded from VMFS3. In addition, new VMFS5 or VMFS6 datastores on storage devices that do not support ATS use the ATS+SCSI mechanism.

If the VMFS datastore reverts to SCSI reservations, you might notice performance degradation caused by excessive SCSI reservations.

Display VMFS Locking Information

Use the esxcli command to obtain information about the locking mechanism that a VMFS datastore uses.

Prerequisites

Install ESXCLI. See Getting Started with ESXCLI. For troubleshooting, run esxcli commands in the ESXi Shell.

Procedure

  • To display information related to VMFS locking mechanisms, run the following command:
    esxcli storage vmfs lockmode list

Results

The table lists items that the output of the command might include.
Table 1. VMFS Locking Information
Fields Values Descriptions
Locking Modes Indicates the locking configuration of the datastore.
ATS The datastore is configured to use the ATS-only locking mode.
ATS+SCSI The datastore is configured to use the ATS mode. If ATS fails or is not supported, the datastore can revert to SCSI.
ATS upgrade pending The datastore is in the process of an online upgrade to the ATS-only mode.
ATS downgrade pending The datastore is in the process of an online downgrade to the ATS+SCSI mode.
ATS Compatible Indicates whether the datastore can be or cannot be configured for the ATS-only mode.
ATS Upgrade Modes Indicates the type of upgrade that the datastore supports.
None The datastore is not ATS-only compatible.
Online The datastore can be used during its upgrade to the ATS-only mode.
Offline The datastore cannot be used during its upgrade to the ATS-only mode.
ATS Incompatibility Reason If the datastore is not compatible with ATS-only, the item indicates the reason for the incompatibility.

ATS-Only Locking Mechanism for VMFS

If your VMFS datastore uses the ATS+SCSI locking mechanism, you can change to ATS-only locking.

Typically, VMFS5 datastores that were previously upgraded from VMFS3 continue using the ATS+SCSI locking mechanism. If the datastores are deployed on ATS-enabled hardware, they are eligible for an upgrade to ATS-only locking. Depending on your vSphere environment, you can use one of the following upgrade modes:
  • The online upgrade to the ATS-only mechanism is available for most single-extent VMFS5 datastores. While you perform the online upgrade on one of the hosts, other hosts can continue using the datastore.
  • The offline upgrade to ATS-only must be used for VMFS5 datastores that span multiple physical extents. Datastores composed of multiple extents are not eligible for the online upgrade. These datastores require that no hosts actively use the datastores at the time of the upgrade request.

Prepare for an Upgrade to ATS-Only Locking

You must perform several steps to prepare your environment for an online or offline upgrade to ATS-only locking.

Procedure

  1. Upgrade all hosts that access the VMFS5 datastore to the newest version of vSphere.
  2. Determine whether the datastore is eligible for an upgrade of its current locking mechanism by running the esxcli storage vmfs lockmode list command.
    The following sample output indicates that the datastore is eligible for an upgrade. It also shows the current locking mechanism and the upgrade mode available for the datastore.
    Locking Mode  ATS Compatible  ATS Upgrade Modes
    ------------  --------------  -----------------
    ATS+SCSI           true       Online or Offline
    
  3. Depending on the upgrade mode available for the datastore, perform one of the following actions:
    Upgrade Mode Action
    Online Verify that all hosts have consistent storage connectivity to the VMFS datastore.
    Offline Verify that no hosts are actively using the datastore.

Upgrade Locking Mechanism to the ATS-Only Type

If a VMFS datastore is ATS-only compatible, you can upgrade its locking mechanism from ATS+SCSI to ATS-only.

Most datastores that do not span multiple extents are eligible for an online upgrade. While you perform the online upgrade on one of the ESXi hosts, other hosts can continue using the datastore. The online upgrade completes only after all hosts have closed the datastore.

Prerequisites

If you plan to complete the upgrade of the locking mechanism by putting the datastore into maintenance mode, deactivate Storage DRS. This prerequisite applies only to an online upgrade.

Procedure

  1. Perform an upgrade of the locking mechanism by running the following command:
    esxcli storage vmfs lockmode set -a|--ats -l|--volume-label= VMFS label -u|--volume-uuid= VMFS UUID.
  2. For an online upgrade, perform additional steps.
    1. Close the datastore on all hosts that have access to the datastore, so that the hosts can recognize the change.
      You can use one of the following methods:
      • Unmount and mount the datastore.
      • Put the datastore into maintenance mode and exit maintenance mode.
    2. Verify that the Locking Mode status for the datastore changed to ATS-only by running:
      esxcli storage vmfs lockmode list
    3. If the Locking Mode displays any other status, for example ATS UPGRADE PENDING, check which host has not yet processed the upgrade by running:
      esxcli storage vmfs host list

Change Locking Mechanism to ATS+SCSI

When you create a VMFS5 datastore on a device that supports the atomic test and set (ATS) locking, the datastore uses the ATS-only locking mechanism. In certain circumstances, you might need to downgrade the ATS-only locking to ATS+SCSI.

You might need to switch to the ATS+SCSI locking mechanism when, for example, your storage device is downgraded. Or when firmware updates fail and the device no longer supports ATS.

The downgrade process is similar to the ATS-only upgrade. As with the upgrade, depending on your storage configuration, you can perform the downgrade in online or offline mode.

Note: If you are running a VMware vSAN environment or have ATS-only VMFS volumes, do not deactivate ATS. Deactivating ATS might result in an outage as no locking mechanism is available. For more information, see a VMware Knowledge Base article.

Procedure

  1. Change the locking mechanism to ATS+SCSI by running the following command:
    esxcli storage vmfs lockmode set -s|--scsi -l|--volume-label= VMFS label -u|--volume-uuid= VMFS UUID.
  2. For an online mode, close the datastore on all hosts that have access to the datastore, so that the hosts can recognize the change.