How to remove inaccessible iSCSI LUN from vSphere ESXi 4.1/5 with Storage I/O Control enabled

datastoreiscsivmware-esxivmware-vsphere

I am testing out a iSCSI SAN solution in my vSphere environment and have been adding/removing LUNs on the SAN host while some were left connected on ESXi hosts. I had enabled Storage I/O Control on the datastores and now I cannot remove them. The errors received is:

Call "HostDatastoreSystem.RemoveDatastore" for object "datastoreSystem-580" on vCenter Server "VCENTER1" failed.
Cannot remove datastore 'ramdisk' because Storage I/O Control is enabled on it. Correct it and re-try the operation

I cannot disable Storage I/O Control since I cannot right click on the datastore and get to the Properties option. There is a KB article for removing inaccessible NFS datastores:

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2008507

But this doesn't seem to apply to iSCSI datastores. I no longer have the LUN available to represent.

I have also tried unlclaiming the storage device and get an error that it is still busy:

~ # esxcli corestorage claiming unclaim -t device -d naa.600144f0a4a4450000004d7ae2dd0002
Errors:
Unable to perform unclaim.  Error message was : Unable to unclaim all requested paths. Some paths were busy or were the last path to an in use device.  See VMkernel logs for more information.

How can I remove the iSCSI datastore that is missing the LUN?

Best Answer

Unfortunately, I was forced to reboot this host. I will try contacting VMware about the issue. Though I would guess it is likely a bug on the ESXi 4.1 build I was running.

After a reboot the LUNs were gone and vSphere allowed me to vMotion freely.