shashivm
Contributor
Contributor

how to unlock vmdk file

how to unlock vmdk file

3 Replies
kramsen
Contributor
Contributor

AUTO: Matthias Brückner ist nicht im Haus und kann E-Mails erst nach Rückkehr beantworten.

Bitte wenden Sie sich in dringenden Angelegenheiten an seine stets freundlichen Kollegen unter 034205 759 0.

0 Kudos
NavalgundRaj
Enthusiast
Enthusiast

Hi,

To determine which ESXi/ESX host has locked the file:

  1. Log in to the Local Tech Support Mode console of the ESXi/ESX host.
  2. The lock status of the file can be obtained using the vmkfstools command:
    # vmkfstools -D /vmfs/volumes/LUN/VM/disk-flat.vmdk
    You see output similar to:
    Lock [type 10c00001 offset 54009856 v 11, hb offset 3198976
    gen 9, mode 0, owner 4655cd8b-3c4a19f2-17bc-00145e808070 mtime 114]
    Addr <4, 116, 4>, gen 5, links 1, type reg, flags 0, uid 0, gid 0, mode 600len 5368709120, nb 0 tbz 0, cow 0, zla 3, bs 1048576

    Note: This output from running the vmkfstools  which appears on the command line may be incomplete. Always check the output logged to the vmkernel , messages , or vmkernel.log files to see all the output.
    Where:
    • The owner4655cd8b-3c4a19f2-17bc-00145e808070 indicates that the MAC address of the ESXi/ESX host locking the file is 00:14:5E:80:80:70.

      Note: If the owner has the entry 00000000-00000000-0000-000000000000 it indicates that the file has either a read-only lock or a multi-writer lock or there is no lock on the file.
    • The mode indicates the type of lock that is on the file. The list of mode locks are:

      • mode 0 = no lock
      • mode 1 = is an exclusive lock (vmx file of a powered on VM, the currently used disk (flat or delta), *vswp, etc.)
      • mode 2 = is a read-only lock (e.g. on the ..-flat.vmdk of a running VM with snapshots)
      • mode 3 = is a multi-writer lock (e.g. used for MSCS clusters disks or FT VMs).
    • .Determine which ESXi/ESX host has a network adapter with this MAC address. From the vSphere/VI client check the Network Adapters section or esxcfg-nics -l from the command line to obtain the MAC address.
  3. With ESX 3.x/4.x and ESXi 5.0 you can use the lsof command on the host holding the lock to attempt to identify the process which is holding the lock:

    # lsof |grep /vmfs/volumes/LUN/VM/disk-flat.vmdk

    If the process holding the lock is ESXi/ESX management agent then restarting the management agents may free up the lock.



Note:
If your backup program uses snapshots or the VMware Backup API to backup virtual machines then it is common for the backup server to hold the lock. Power off or reset the backup server to see if that helps clear the lock.

  1. Migrate or vMotion all virtual machines running on the ESXi/ESX host that created the lock to another ESXi/ESX host.
  2. Stop the ESXi/ESX host that created the lock by either rebooting the host or executing:

    # vm-support -X

Thanks and Regards

Basavaraj.R Navalgund

Note: If you found this correct or answer useful please consider the use of the Correct buttons to award points. Regards Basavaraj.R Navalgund
kramsen
Contributor
Contributor

AUTO: Matthias Brückner ist nicht im Haus und kann E-Mails erst nach Rückkehr beantworten.

Bitte wenden Sie sich in dringenden Angelegenheiten an seine stets freundlichen Kollegen unter 034205 759 0.

0 Kudos