VMware : iSCSI LUN datastore no longer visible after outage

By | March 30, 2014

If after a power outage or ESX hypervisor shutdown your iSCSI datastores are missing, it might be caused by a lock on the LUN on your host machine.

You may find this in your vmkernel logs :

 /var/log/vmkernel.log

2014-02-19T04:19:11.927Z cpu3:33477)NMP: nmp_ThrottleLogForDevice:2321: Cmd 0x88 (0x412e80814440, 0) to dev “t10.FreeBSD_iSCSI_Disk______74867ae04094000_________________” on path  “vmhba37:C0:T1:L0” Failed: H:0x2 D:0x0 P:0x0 Possible sense data: 0x0 0x0 $

To remove the lock, browse your disk device directory and find the ones that match your iSCSI tagets :

/vmfs/devices/disks/

Example of iSCSI target name :

t10.FreeBSD_iSCSI_Disk______74867ae04094010_________________

Then through the ESX console, type the following command :

vmkfstools -L targetreset <TARGET_NAME>

Example :

vmkfstools -L targetreset /vmfs/devices/disks/t10.FreeBSD_iSCSI_Disk______74867ae04094010_________________

Now you need to rescan your iSCSI device as followed :

esxcfg-rescan vmhba37

Your datastore should be now visible from the inventory.