Removing VMFS Volume locks on datastores
search cancel

Removing VMFS Volume locks on datastores

book

Article ID: 344722

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

Symptoms

  • You see the error:
volume on device naa.device_id locked, possibly because remote host Host_IP encountered an error during a volume operation and couldn’t recover.
 
For example:
If naa.60060160b3c018009bd1e02f725fdd11:1 represents one of the partitions used in a VMFS volume, you see this message when the VMFS volume is inaccessible:
 
volume on device naa.60060160b3c018009bd1e02f725fdd11:1 locked, possibly because remote host 10.17.211.73 encountered an error during a volume operation and couldn’t recover.
 
  • Virtual machine stored on an inaccessible datastore will appear as unavailable in the vSphere Client
  • In the /var/log/vmkernel.log file, you see similar to:
WARNING: LVM: 13127: The volume on the device naa.6000eb3b3638efa50000000000000258:1 locked, possibly because some remote host encountered an error during a volume operation and could not recover.
LVM: 11786: Failed to open device naa.6000eb3b3638efa50000000000000258:1 : Lock was not free


Environment

VMware vSphere ESXi 6.5
VMware vSphere ESXi 6.7
VMware vCenter Server Appliance 6.5.x
VMware vCenter Server Appliance 6.7.x
VMware vCenter Server 6.5.x
VMware vCenter Server 6.7.x

Resolution

To resolve this issue, remove the lock on the affected ESXi host, run the below commands or reboot the host:
  1. Connect to the ESXi host with an SSH session and root credentials.
  2. Break the existing LVM lock on the datastore:
vmkfstools –B vmfs_device

Note: You can use the parameter --breaklock instead of -B with the vmkfstools command.

For example:
vmkfstools -B /vmfs/devices/disks/naa.60060160b3c018009bd1e02f725fdd11:1
  1. You will prompted similar to:
VMware ESX Question:
LVM lock on device /vmfs/devices/disks/naa.60060160b3c018009bd1e02f725fdd11:1 will be forcibly broken. Please consult vmkfstools or ESX documentation to understand the consequences of this.
 
Please ensure that multiple servers aren't accessing this device.
 
Continue to break lock?
0) Yes
1) No
 
Please choose a number [0-1]:
 
  1. Enter 0 to break the lock.
  2. Re-read and reload VMFS datastore metadata to memory with:
vmkfstools –V
  1. From the vSphere UI, refresh the Storage Datastores View under Configuration tab.

Additional Information

For translated versions of this article, see: