ESX Virtualization

VMware ESXi, vSphere, VMware Backup, Hyper-V... how-to, videos....

Nakivo Backup and Replication - #1 Backup solution for Virtual, physical, cloud, NAS and SaaS

Menu
  • Certification
      • VCP-DCV vSphere 8
          • vcp2024-125.
        • Close
    • Close
  • VMware
    • Configuration Maximums
    • vSphere
      • vSphere 8.0
      • vSphere 7.0
      • vSphere 6.7
      • vSphere 6.5
      • vSphere 6.0
      • Close
    • VMworld
      • VMware EXPLORE 2024
      • VMware EXPLORE 2023
      • VMware EXPLORE 2022
      • VMworld 2019
      • VMworld 2018
      • VMworld 2017
      • VMworld 2016
      • VMworld 2015
      • VMworld 2014
      • VMworld 2013
      • VMworld 2012
      • VMworld 2011
      • Close
    • Close
  • Microsoft
    • Windows Server 2012
    • Windows Server 2016
    • Windows Server 2019
    • Close
  • Categories
    • Tips – VMware, Microsoft and General IT tips and definitions, What is this?, How this works?
    • Server Virtualization – VMware ESXi, ESXi Free Hypervizor, VMware vSphere Server Virtualization, VMware Cloud and Datacenter Virtualization
    • Backup – Virtualization Backup Solutions, VMware vSphere Backup and ESXi backup solutions.
    • Desktop Virtualization – Desktop Virtualization, VMware Workstation, VMware Fusion, VMware Horizon View, tips and tutorials
    • How To – ESXi Tutorials, IT and virtualization tutorials, VMware ESXi 4.x, ESXi 5.x and VMware vSphere. VMware Workstation and other IT tutorials.
    • Free – Free virtualization utilities, ESXi Free, Monitoring and free backup utilities for ESXi and Hyper-V. Free IT tools.
    • Videos – VMware Virtualization Videos, VMware ESXi Videos, ESXi 4.x, ESXi 5.x tips and videos.
    • Home Lab
    • Reviews – Virtualization Software and reviews, Disaster and backup recovery software reviews. Virtual infrastructure monitoring software review.
    • Close
  • Partners
    • NAKIVO
    • StarWind
    • Zerto
    • Xorux
    • Close
  • This Web
    • News
    • ESXi Lab
    • About
    • Advertise
    • Archives
    • Disclaimer
    • PDFs and Books
    • Close
  • Free
  • Privacy policy

What is VMware VMFS Locking Mechanism?

By Vladan SEGET | Last Updated: October 25, 2017

Shares

Today we'll learn What is VMware VMFS Locking Mechanism. It is another post within our Tips category, so if you know your way, just skip. New people coming to learn VMware technology usually need this information to understand how VMFS locking works within the shared storage environment. And it is especially for those people that we're creating this post.

We will also talk about VMFS metadata which is basically a maping file assuring a global view of where all files (such as VMDKs, directories, RDM descriptor file….) are located. Metadata is updated each time you perform datastore or virtual machine management operations (Power On or OFF a VM, deploying VM from a template, vMotion migration, expanding VMFS datastore etc).

VMware VMFS locking mechanism is covered within VMware documentation, but we completed the knowledge from other sources too, including VMware forums.

So this post is partly put together from all those resources.

You'll find the links at the bottom of the post if you want to study further. Let's start with a short quote which explains the concept.

Quote:

In a shared storage environment, when multiple hosts access the same VMFS datastore, specific locking mechanisms are used. These locking mechanisms prevent multiple hosts from concurrently writing to the metadata and ensure that no data corruption occurs.

What is VMware VMFS Locking Mechanism?

There are two types of locking mechanisms:

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 higher) 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 turn off the ATS-only setting for a VMFS5 datastore.

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 datastores on storage devices that do not support ATS use the ATS+SCSI mechanism.

How to find out in my VMware vSphere environment?

Connect via SSH (use Putty for example) to your host and enter the following command:

esxcli storage vmfs lockmode list

You'll see an output like this: (click to enlarge)

VMware VMFS Locking Mechanism

As you can see in my environment, I have some VMFS-6 and also VMFS-5 formatted datastores.

The documentation states that it is possible to upgrade the locking mechanism to ATS Only if your hardware supports it. You can find out about it within the third column from the right, a column called “ATS compatible“. In my case, this is not possible.

If not you can use this command for the upgrade of the locking mechanism: Source: VMware Docs

esxcli storage vmfs lockmode set -a|–ats -l|–volume-label= VMFS label -u|–volume-uuid= VMFS UUID.

You then need to unmount and remount the datastore o all hosts which are accessing this datastore. An additional way to complete the upgrade would be to put the datastore into a maintenance mode and then exit the maintenance mode.

Check if the output by using the first command again, whether the output changed to ATS-only mode.

You may have other outputs. for example, If the Locking Mode displays any other status, (ATS UPGRADE PENDING), you can check which host has not yet processed the upgrade by running this command:

esxcli storage vmfs host list

This is about it about the VMware VMFS locking mechanism.

Lab screenshot showing a shared Drobo datastore….

Shared VMFS Datastore lab

VMware VMFS Locking mechanism and “On-disk locking”. How that works?

The “on-disk locking” does prevent powering on a virtual machine (VM) on several hosts at once. Pretty serious, right… The fact that host where the VM is powered on, it locks the VM files, and in this case, the VM can't be powered on another host within the cluster.

Quote:

On-disk locking in VMFS ensures that a virtual machine is not powered on by multiple ESXi Servers at the same time. With VMware HA enabled, if a server fails the on-disk lock for each virtual machine is released, allowing the virtual machine to be restarted on other physical servers.

Screenshot from VMware…

Shared VMFS Datastore

What Is a Distributed Lock Manager?

Yes, this is another interesting concept which is part of the on-disk locking. DLM (Distributed Lock Manager), provides distributed software applications with a means to synchronize their accesses to shared resources. The key here is the distributed aspect of the locking method.

DLM runs on each host which is part of the cluster, and the lock management is distributed across all hosts in the cluster. Each ESXi host stores its virtual machine files in a specific subdirectory on the VMFS file system. When a VM is running, VMFS has a lock on those files so that other ESXi hosts cannot update them. VMFS ensures that the VM cannot be opened by more than one ESXi Server in the cluster.

Wrap Up:

As you can see VMware locking mechanisms are pretty solid allowing to control the writes to shared storage. It's pretty obvious that it has to be managed somehow. Now we know that it is thanks to the ATS or the ATS+SCSI locking mechanisms.

For the VM on-disk locking it works a bit different way, but still, pretty cool knowing that clusters with shared storage can handle that. And VMs can be restarted on another host within the cluster in case there is a host failure, without that the VM stays locked by the failed host.

More from ESX Virtualization:

  • What is VMware Snapshot?
  • What is VMware vMotion?
  • What is VMware Enhanced vMotion Compatibility (EVC)
  • What is VMware Storage DRS (SDRS)?
  • VMware vSphere Standard vs Enterprise Plus

Stay tuned through RSS, and social media channels (Twitter, FB, YouTube)

Sources: VMware Docs , then Google “vSphere Storage Guide” …, (PDF), VMware KB article Investigating virtual machine file locks on ESXi.

Shares
5/5 - (3 votes)

| Filed Under: Tips Tagged With: What is VMware VMFS Locking Mechanism

About Vladan SEGET

This website is maintained by Vladan SEGET. Vladan is as an Independent consultant, professional blogger, vExpert x16, Veeam Vanguard x9, VCAP-DCA/DCD, ESX Virtualization site has started as a simple bookmarking site, but quickly found a large following of readers and subscribers.

Connect on: Facebook. Feel free to network via Twitter @vladan.

Private Sponsors

Featured

  • Thinking about HCI? G2, an independent tech solutions peer review platform, has published its Winter 2023 Reports on Hyperconverged Infrastructure (HCI) Solutions.
  • Zerto: One Platform for Disaster Recovery, Backup & Cloud Mobility: Try FREE Hands-On Labs Today!
Click to Become a Sponsor

Most Recent

  • Nakivo Backup and Replication v11.1 BETA adds more Proxmox friendly features
  • Vulnerability in your VMs – VMware Tools Update
  • FREE version of StarWind VSAN vs Trial of Full version
  • Commvault’s Innovations at RSA Conference 2025 San Francisco
  • VMware ESXi FREE is FREE again!
  • Installation of StarWind VSAN Plugin for vSphere
  • Protect Mixed environments with Nakivo Physical Machine recovery (bare metal)
  • No more FREE licenses of VMware vSphere for vExperts – What’s your options?
  • Tails – Your Private OS on USB Stick
  • StarWind V2V Converter Now has CLI

Get new posts by email:

 

 

 

 

Support us on Ko-Fi

 

 

Buy Me a Coffee at ko-fi.com

Sponsors

Free Trials

  • DC Scope for VMware vSphere – optimization, capacity planning, and cost management. Download FREE Trial Here.
  • Augmented Inline Deduplication, Altaro VM Backup v9 For #VMware and #Hyper-V – Grab your copy now download TRIAL.

VMware Engineer Jobs

VMware Engineer Jobs

YouTube

…

Find us on Facebook

ESX Virtualization

…

Copyright © 2025 ·Dynamik-Gen · Genesis Framework · Log in