Cannot power on backup proxy VM due to a persistent VMDK disk lock.
search cancel

Cannot power on backup proxy VM due to a persistent VMDK disk lock.

book

Article ID: 439018

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

VMs in the environment are not able to power on due to VMDK file locks that are held by a backup proxy VM. The backup proxy VM is shut down in order to release the locks on the production VMs and the production VMs are able to power on.

When trying to power on the backup proxy VM, the power on task fails due to VMDK file locks.

Attempting to remove the disk(s) from the Proxy VM fails with error: "The operation cannot be performed in the current state".

 

Environment

vSphere 8.0.X

Cause

This happens when the production VM(s) powered on, but the disks are still attached to the backup proxy VM, after it is powered off. The original VM(s) own the file locks on the disks, so the backup proxy VM will not power on.

Resolution

The locks cannot be removed without shutting down the running VMs and the drives cannot be removed from backup proxy VM via the vSphere UI. The only way to remove the drives from the backup proxy VM is to delete the scsi entries from the vmx file of the backup proxy VM.

  1. Go to edit settings on the backup proxy VM that will not power on.

  2. Look at each drive on the VM and note the SCSI identifiers on the drives that belong to other VMs:


  3. Start an SSH session to the host where the backup proxy VM resides.

  4. Navigate to the storage location where the vmx file for the VM is located. (If you don't know the location, you can find it using the following command: find -iname VMName.vmx.)

  5. Use the following command to backup the vmx file of the VM:

    cp VMname.vmx VMname.vmx.bak


  6. Edit the vmx file using vi:

    vi VMname.vmx


  7. Scroll down the file to the scsi#.# entries that coincide with the drives that belong to other VMs.

     

  8. Place the cursor on each line that starts with "scsi#:#" and type dd to remove the line. Repeat this for every disk that references another VM.

  9. Run vim-cmd vmsvc/getallvms in order to the the VMID.


  10. Run vim-cmd vmsvc/reload VMID to reload the vmx file.

  11. Power on the VM from the vSphere client.