Got it

Some introduction about ATS which belonged to VAAI Block Primitives

Latest reply: Jul 20, 2021 11:38:16 1674 4 11 0 0

Atomic Test & Set (ATS)

In VMware vSphere VMFS, many operations must establish a lock on the volume when updating a resource.
Because VMFS is a clustered file system, many ESXi hosts can share the volume. When one host must make an
update to the VMFS metadata, a locking mechanism is required to maintain file system integrity and prevent
another host from coming in and updating the same metadata. The following operations require this lock:
1. Acquire on-disk locks
2. Upgrade an optimistic lock to an exclusive/physical lock
3. Unlock a read-only/multiwriter lock
4. Acquire a heartbeat
5. Clear a heartbeat
6. Replay a heartbeat
7. Reclaim a heartbeat
8. Acquire on-disk lock with dead owner


It is not essential to understand all of these operations in the context of this whitepaper. It is sufficient to
understand that various VMFS metadata operations require a lock.


ATS is an enhanced locking mechanism designed to replace the use of SCSI reservations on VMFS volumes
when doing metadata updates. A SCSI reservation locks a whole LUN and prevents other hosts from doing
metadata updates of a VMFS volume when one host sharing the volume has a lock. This can lead to various
contention issues when many virtual machines are using the same datastore. It is a limiting factor for scaling to
very large VMFS volumes. ATS is a lock mechanism that must modify only a disk sector on the VMFS volume.


When successful, it enables an ESXi host to perform a metadata update on the volume. This includes allocating
space to a VMDK during provisioning, because certain characteristics must be updated in the metadata to
reflect the new size of the file. The introduction of ATS addresses the contention issues with SCSI reservations
and enables VMFS volumes to scale to much larger sizes.


In vSphere 4.0, VMFS3 used SCSI reservations for establishing the lock, because there was no VAAI support in
that release. In vSphere 4.1, on a VAAI-enabled array, VMFS3 used ATS for only operations 1 and 2 listed
previously, and only when there was no contention for disk lock acquisitions. VMFS3 reverted to using SCSI
reservations if there was a multihost collision when acquiring an on-disk lock using ATS.


In the initial VAAI release, the ATS primitives had to be implemented differently on each storage array, requiring
a different ATS opcode depending on the vendor. ATS is now a standard T10 SCSI command and uses opcode
0x89 (COMPARE AND WRITE).


For VMFS5 datastores formatted on a VAAI-enabled array, all the critical section functionality from operations 1
to 8 is done using ATS. There no longer should be any SCSI reservations on VAAI-enabled VMFS5. ATS continues
to be used even if there is contention. On non-VAAI arrays, SCSI reservations continue to be used for
establishing critical sections in VMFS5.

This is a very good knowledge point.Some introduction about ATS which belonged to VAAI Block Primitives-2806997-1
View more
  • x
  • convention:

It's too hard for me to understand the theory .From you description , some arrays don't support arrays . Which Huawei products support VAAI? i think it's better to list a list .
View more
  • x
  • convention:

thanks for sharing the knowledge
View more
  • x
  • convention:

VMware vSphere APIs – Array Integration (VAAI)

ATS Only Flag

An ATS only flag appears on newly created VMFS5 and VMFS6 datastores. When the host detects that the array supports ATS on the device, the ATS only flag is written to the datastore. From that point on, ATS always will be used on that datastore, so it can be used for all metadata operations.

The flag is not enabled, however, on VMFS5 volumes that were upgraded from VMFS3, facilitating seamless upgrades from VMFS3 to VMFS5. This is because VMFS3 was not ATS complete, and during the upgrade process, some hosts might continue to use SCSI reservations for certain metadata operations.

You cannot turn on the ATS only flag on VMFS5 volumes upgraded from VMFS3. The ATS only flag can be manually enabled or disabled on a newly created VMFS5. To manually enable it, you can use the hidden option:

# vmkfstools –configATSOnly 1 [device path]

Since there is no upgrade path from VMFS3 or VMFS5 to VMFS6, this is not a concern for VMFS6 volumes.

ATS Miscompare

When ATS was introduced for maintaining heartbeat “liveness” in vSphere 5.5U2, some issues arose. Some storage arrays returned ATS miscompares when the array was overloaded. In another scenario, reservations on the LUN on which the VMFS resided also caused ATS miscompares. In another case, the ATS “set” was correctly written to disk, but the array still returned a miscompare.

But it wasn’t all array related issues. Situations arose where VMFS also detected an ATS miscompare incorrectly. In this case, a heartbeat I/O (1) got timed-out and VMFS canceled that I/O, but before canceling the I/O, the I/O (ATS “set”) actually made it to the disk. VMFS next re-tried the ATS using the original “test-image” in step (1) since the previous one was canceled, and the assumption was that the ATS didn’t make it to the disk. Since the ATS “set” made it to the disk before the cancel, the ATS “test” meant that the in-memory and on-disk images no longer matched, so the array returned “ATS miscompare”.

When an ATS miscompare is received, all outstanding IO is canceled. This led to additional stress and load being placed on the storage arrays and degraded performance.

In vSphere 6.5, there are new heuristics added so that when an ATS miscompare event is encountered, VMFS reads the on-disk heartbeat data and verifies it against the ATS “test” and “set” images. This check to see if there is actually a real miscompare. If the miscompare is real, then we do the same as before, which is to cancel all the outstanding I/O. If the on-disk heartbeat data has not changed, then this is a false miscompare. In the event of a false miscompare, VMFS will not immediately cancled IOs. Instead, VMFS will now re-attempt the ATS heartbeat operation after a short interval (usually less than 100ms).

Thanks.

View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.