VMware is currently working on improving this behavior.
If you are currently experiencing the problem reported in this KB then remove the perennially reserved flag of LUNs that were removed in the past.
Run this command to find the naa.id devices listed in the VSI nodes
# vsish -e ls /storage/scsifw/persistDeviceAttrs/uidsRun this command to verify if there are 512 devices listed already:
# vsish -e ls /storage/scsifw/persistDeviceAttrs/uids | wc -lPlease note: that devices listed under uids, may have multiple attributes, including perennially reservation.
The listing of an naa ID does not automatically indicate that the LUN is perennially reserved.
/storage/scsifw/persistDeviceAttrs/uids/> get naa.624a93704a136e62ff54907c002baf51
Device Persistent Attributes {
detached:0
perennially reserved:0
not shared:1In this example the LUN is
not reserved, yet the naa ID does appear under uids, because one of the 3 attributes are TRUE.
Identify the naa.ids that where detached in the past and do not exist in the environment anymore.
Run this command to remove the perennially reserved flag on those naa.id:
# esxcli storage core device setconfig -d naa.id --perennially-reserved=falseNow you could attempt to detach the desired LUN again.
To avoid this problem from happening in the future, please follow the steps of KB Article
2004605 to detach the LUN correctly from an ESXi and as per the the Related Information of that KB the flag of "perennially reserved" needs to be removed to prevent a successful unmount/detach of the LUN.
Workaround:
You could reboot the ESXi to clean some entries that are not persistent from the VSI nodes and then be able to detach the LUN. However, those entries that are persistent will have to be manually removed with the process in the Resolution section. It is highly recommended that this clean up is performed in the environment to avoid this problem from happening in the future.