"The operation is not allowed in the current state"/var/log/vmkernel.log displays errors similar to: WARNING: VC: 2445: unmounting opened volume ('datastore_uuid' 'datastore_name') with ref 2 is not allowed. VC: 2716: Unmount volume f532 28 2 4 1 0 0 0 0 0 : Busylsof or vmkvsitools lsof) performed on the host show no open user-space file handles. The datastore browser shows only standard hidden VMFS system metadata files (e.g., .sdd.sf, .iormstats.sf).# esxcfg-mpath -b | grep -i <NAA-ID-of-Device>naa.############################## De11EMC iSCSI Disk (naa.##############################)vmhba#:C#: T#: L# LUN:# state:dead iscsi Adapter: Unavailable Target: Unavailable
Track host processes keeping descriptors open on the volume path to verify no active user-space file handles exist:
Connect via SSH to the ESXi host.
Execute: lsof | grep /vmfs/volumes/<Datastore_UUID>
If no open files are returned, proceed to the next step. Ensure the current SSH terminal session is not parked within the volume path by executing cd /.
Verify the physical block device world list to confirm only the default filesystem driver holds an open count:
Execute: esxcli storage core device world list -d naa.<Device_ID>
Confirm the output only shows idle0 under World Name. This indicates the ESXi kernel's VMFS driver holds a standard operational handle and no direct-access virtual machine utilities or RDMs are locking the device.
Verify System Scratch, Syslog, and Coredump configurations are not targeting the datastore:
Scratch Partition: Execute esxcli system option get -o /ScratchConfig/ConfiguredScratchLocation. If it references the datastore UUID, set a new path and reboot the host.
Syslog Directory: Execute esxcli system option get -o /Syslog/global/logDir. If mapped to the datastore, modify the configuration to an alternate volume.
Coredumps: Execute esxcli system coredump file list. If an active dump file exists on the volume, execute esxcli system coredump file remove --force.
Confirm that Storage I/O Control (SIOC) and vSphere HA Datastore Heartbeating are not actively locking the volume:
vSphere HA: In the vSphere Client, navigate to Cluster > Configure > vSphere Availability > Edit > Heartbeat Datastores. Ensure the datastore is explicitly excluded from heartbeating.
SIOC: Navigate to Datastore > Configure > Settings > Storage I/O Control and confirm it is disabled.
If the issue persists, attempt to clear stale daemon locks by executing the following commands via SSH on the affected host:
/etc/init.d/storagerm restart
/etc/init.d/vsantraced restart
/etc/init.d/vsanepd restart
services.sh restart
If the ref 2 kernel lock remains after flushing the management agents, the orphaned kernel thread must be cleared by a system reboot. (The host should already be in Maintenance Mode from Step 5).
Reboot the ESXi host.
Attempt the datastore unmount operation again via the vSphere Client.
Repeat the rolling reboot process for the remaining hosts in the cluster as necessary until the datastore is successfully unmounted.
Also, refer following article for "Device or Resource Busy' errors:
Error: "Device or Resource Busy" or "Device in use" when attempting to delete/unmount/disconnect a Datastore