Powering on the virtual machine results in the power-on task remaining at 95% indefinitely
Consolidation Task hangs at 0 %
The virtual machine is unable to power on.
The virtual machine is in an 'Invalid' state.
The virtual machine reports conflicting power states between vCenter Server and the ESXi host UI
Adding an existing virtual machine disk (VMDK) to a powered-on virtual machine fails with the following errors:
Failed to add disk scsi0:1. Failed to power on scsi0:1Cannot power on the virtual machine after deploying it from a templatePowering on a virtual machine fails with an error: Unable to open Swap FileUnable to access a file since it is lockedUnable to access the virtual machine configurationIn the /var/log/vmkernel.log file, there are entries similar to
WARNING: World: VM ####: ###: Failed to open swap file path: Lock was not freeWARNING: World: VM ####: ###: Failed to initialize swap file path
When opening a console to the virtual machine, the following error appears
Error connecting to path/virtual machine/vmx because the VMX is not started
Attempting to view or open the .vmx file using a text editor (ex: cat or vi), reports an error similar to:
cat: can't open '[name of vm].vmx': Invalid argument
Purpose of File Locking
Initiate Quick Test
Identifying the Locked File
Removing the lock
For vSAN -Investigating virtual disk files locks on vSAN
The Purpose of File Locking
To prevent concurrent changes to critical virtual machine files and file systems, ESXi hosts establish locks on these files. In certain circumstances, these locks may not be released when the virtual machine is powered off. As such, the files cannot then be accessed by other ESXi hosts while locked and the virtual machine fails to power on.
VM---> Monitor tab--> Tasks and Events--> TasksFor pre-ESXi 8.0U2
vmfsfilelockinfo -p /vmfs/volumes/<UUID>/VM_name/VM_name-000001-delta.vmdk vmfsfilelockinfo -p /vmfs/volumes/<UUID>/VM_name/VM_name-000001-delta.vmdk -v <vCenter IP> -u <Admin user/SSO>lsof | egrep 'Cartel|VM_name-000001-delta.vmdk'
Cartel | World name | Type | fd | Description362## vmx FILE 80 /vmfs/volumes/<UUID>/VM_name/VM_name-000001-delta.vmdkesxcli vm process list
This displays information for active virtual machines grouped by virtual machine name and having a format similar to:
Alternate_VM_name
World ID: 362##
Process ID: 0
VMX Cartel ID: 362##
UUID: <UUID>
Display Name: Alternate_VM_name
Config File: /vmfs/volumes/<UUID>/Alternate_VM_name/Alternate_VM_name.vmx
The virtual machine entry having VMX Cartel ID: 362## shows the display name of the virtual machine holding the lock on file VM_name-000001-delta.vmdk, which in this example, is Alternate_VM_name.
for i in $(vim-cmd vmsvc/getallvms | grep -v Vmid | awk -F "/" '{print $2}' | awk '{print $1}'); do echo $i && find ./ -iname $i | xargs grep vmdk | grep -Ei VMDKS_TO_LOOK_FOR ; done
Note: This script will return all VM_Name.vmx files regardless if the vmdk you're looking for is not found. The reason for this is so you know which VM(s) the vmdks are attached to.
Sample vmdk found output:
vm_name.vmx
vm_name2.vmx
scsi0:0.fileName = "vm_name2-000001.vmdk"
vm_name3.vmx
Sample vmdk not found output:
vm_name.vmx
vm_name2.vmx
vm_name3.vmx
Note:
If your VM name contains spaces, you won't get the full VM name; you'll only get the first word. It's best not to use spaces in VM names.
As of 8.0U3, the vCLS VMs are embedded on the ESXi host and no longer stored on a datastore. As such, the output for the vCLS VMs will return as just /var/..
Sample path to the embedded vCLS VMs:/var/run/crx/infra/vCLS-28a#####-10b2-4819-37c5-############/vCLS-28a#####-10b2-4819-37c5-############.vmx
mkdir bkup" to create a backup directorymv lck-#### bkupbkup” folder with the command “ls -lah bkup”C) Verify the integrity of the virtual machine configuration file (.vmx) - Refer to KB - Validating the .vmx settings of a virtual machine
D) Opening a Support Request
If the problem persists after completing the steps above, Create a Broadcom Support case