Run this command to see the world that has the device open for the LUN:
#esxcli storage core device world list -d naa_id
For example:
#esxcli storage core device world list -d naa.##################################
You see output similar to:
Device World ID Open Count World Name ------------------------------------ -------- ---------- ---------- naa.################################## 2060 1 idle0
If a VMFS volume is using the device indirectly, the world name includes the string idle0. If a virtual machine uses the device as an RDM, the virtual machine World ID is displayed. If any other process is using the raw device, the corresponding information is displayed.
Notes:
If the host is not responding, run the esxcfg-scsidevs –m | grep naa.id command to get the corresponding datastore name.
Ensure all virtual machines registered on the volume in a PDL state do not require any further steps. If you have a virtual machine in that state, attempting to Retry or Cancel an operation will not return the virtual machine world ID. Click Cancel as the Retry operation cannot succeed unless the volume is remounted.
Run this command to list all virtual machines running on the ESXi host and identify the virtual machine registered on that LUN:
#esxcli vm process list
To kill the virtual machine World ID, run this command:
#esxcli vm process kill --type=force --world-id=World ID
For example:
#esxcli vm process kill --type=force --world-id=12131
To clean up other processes that might be using this datastore: Remove any templates from vCenter that are using this datastore.