Virtual Machine Shows as "Inaccessible" in vCenter After Host Failure due to a VMFS file lock
search cancel

Virtual Machine Shows as "Inaccessible" in vCenter After Host Failure due to a VMFS file lock

book

Article ID: 423382

calendar_today

Updated On:

Products

VMware vSphere ESXi 8.0

Issue/Introduction

A Virtual Machine (VM) is displayed as Inaccessible within the vCenter Server user interface.
This status persists even after the parent ESXi host has been rebooted or remains in a powered-off state.
The VM cannot be powered on, migrated, or managed through standard vCenter operations.

Environment

ESXi 8.0
vCenter Server 8.0

Cause

This issue typically occurs when a host failure leaves an active VMFS file lock on the virtual machine configuration or disk files. Even if the host is rebooted, the metadata on the datastore may still associate the file lock with the MAC address of the failed host's management NIC, preventing other hosts from registering or starting the VM.

Run the below command to find any locks
for file in *;do vmfsfilelockinfo -p "$file" | awk '{FS = "\n"; RS = ""} {print $2 , $7}';done
ls | while read x;do vmfsfilelockinfo -p "$x"| grep "is locked"; done

The locks will point to the Mac address that is on the failed host

Resolution

If the lock cannot be cleared through standard host management, the recommended workaround is to recreate the VM shell and reattach the existing virtual disks.

Step 1: Unregister the Inaccessible VM

  1. Right-click the Inaccessible VM in the vCenter inventory.

  2. Select Remove from Inventory.

    • Note: Do not select "Delete from Disk."

Step 2: Create a New Virtual Machine

  1. Right-click your Cluster or Host and select New Virtual Machine.

  2. Choose Create a new virtual machine.

  3. Match the original configuration (CPU, RAM, Network) of the failed VM.

  4. When prompted to Customize Hardware, remove the default "New Hard Disk."

Step 3: Attach Existing Disks

  1. Click Add New Device and select Existing Hard Disk.

  2. Browse to the datastore folder of the original (inaccessible) VM.

  3. Select the base disk (.vmdk) file.

    • Important: Ensure you are pointing to the base disk and not a snapshot delta file unless specifically required for data consistency.

  4. Complete the wizard and finish the VM creation.

Step 4: Power On and Verify

  1. Power on the newly created VM.

  2. Verify that the Guest OS boots correctly and data is intact.

  3. Once verified, you may delete the old orphaned folder/files remaining from the previous registration if they are no longer needed.

Ref: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/add-an-existing-hard-disk-to-a-virtual-machine.html