Rasmus Haslund

Virtualize everything!

  • LinkedIn
  • RSS
  • Twitter
  • YouTube
  • Home
  • Videos
  • Practice Exams
    • VMCE practice exam – Veeam Certified Engineer
  • EqualLogic
  • Veeam
  • VMware
  • About

VMware ESXi 5.1 unable to mount datastore: Lock was not free

2013-01-22 by Rasmus Haslund 4 Comments

Today I had a customer running VMware ESXi 5.1 on three hosts connected to a Dell EqualLogic SAN. The issue at hand was out of 10 datastores on the SAN one datastore could suddenly no longer be mounted.

It showed up as (inactive)(unmounted):
datastore_inactive_unmounted

Obviously the logical solution would be to just try and mount the datastore but this gave an error message:

datastore_unable_to_mount

Operation failed, diagnostics report: Sysinfo error on operation returned status : Lock was not free. Please see the VMkernel log for detailed error information

 

I then enabled SSH on the host and checked the mentioned VMkernel log located in /var/log and found the following entries at the bottom:

WARNING: LVM: 12969: The volume on the device naa.6090a078f04af0b0a7ea54aecf002067:1 locked, possibly because some remote host encountered a error during a volume operation and could not recover.

WARNING: LVM: 4925: If you are _sure_ this is the case, please break the device lock with `vmkfstools -B /vmfs/devices/disks/naa.6090a078f04f0b0a7ea54aecf002067:1`

 

To ensure nothing was still locking this I emptied each server one at a time with vMotion and rebooted it. After rebooting the last host I checked if it was possible to mount the datastore, but unfortunately it was still the same.

I then proceeded to execute the suggested command:
datastore_remove_lock

 

After the command finished I was finally able to mount the datastore on all ESXi hosts.

 

UPDATE
As written by Ibecake in the comments, please make sure you do NOT! have any VMs running on the datastore from any host before removing the lock.

As always, if this helped you please leave a comment 🙂

Filed Under: Fix IT, VMware Tagged With: error, ESXi, lock, mount, unable, VMware

Subscribe
Connect with
Login
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.
DisagreeAgree
Notify of
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.
DisagreeAgree
Please login to comment
4 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Ibecake
9 years ago

You forgot to mention that the vmkfstools -B command will break all locks to that device and any Vm’s using that datastore will also have their locks broken possibly causing them to fail worst case scenario.

0
Rasmus Haslund
9 years ago
Reply to  Ibecake

Thank you for taking time to reply Ibecake!

You are entirely correct! I will update the post to reflect this more clearly.

However in my case none of the hosts had access to the datastore and due to this no VMs were able to use the datastore.

0
Wadih Chamas
7 years ago

thanks a lot it’s work for me

0
Simon Trangmar
5 years ago

Thanks – saved my bacon at 2am on a Sunday morning! We had been working on this for hours – am really REALLY grateful you took time to post this info

0

Sponsors

wpDiscuz