In VMware vCenter, a virtual machine (VM) may appear in an "invalid" state within the inventory. You may find yourself unable to re-register the VM because a specific ESXi host is holding a file lock on the VM’s configuration (vm-name.vmx) file. This issue can occur even if the host holding the lock is currently in maintenance mode.
An ESXi host maintains an active lock on the VM files, preventing other hosts from registering or managing the object. This typically happens if a VM process remains running on a host creating a mismatch between the host's actual state and the vCenter inventory.
To resolve this issue, you must identify the host holding the lock and re-register the VM from that specific host.
vmkfstools -D against the VM's .vmx file and reviewing the vmkernel.log.vmkfstools -D /vmfs/volumes/<Datastore_Name>/<VM_Folder>/<VM_Name>.vmxtail /var/run/log/vmkernel.log<timestamp> In (182)| vmkernel: gen 37, mode 1, owner ########-########-####-001122334455 mtime 389094200:11:22:33:44:55 in the above example.vim-cmd solo/registervm /vmfs/volumes/<Datastore_Name>/<VM_Folder>/<VM_Name>.vmx