http://kb.vmware.com/kb/1015084
To unpresent a LUN containing a datastore from an ESX/ESXi 4.x host:
Note: These steps must be performed using the VMware ESX service console or the vSphere command line. These steps cannot be performed using the Manage Paths dialog in vSphere Client.
Stop using the datastore:
Unregister all objects (such as virtual machines and templates) stored on the datastore from the inventory.
Ensure there are no 3rd party scripts or utilities running on service console which could access the LUN in question.
When the LUN is masked from all the hosts, unpresent the LUN. For more information, contact your storage array vendor.
Note: Ensure that the correct LUN is unpresented by verifying the naa id on the host and the array.
Perform a rescan on all of the ESX hosts that had visibility to the LUN. If all of the hosts are in a cluster, right-click on the cluster and click Rescan for Datastores.
Perform the following steps for every host that had visibility to the LUN:
Remove the rule created in step 2 with the command:
# esxcli corestorage claimrule delete --rule 192
Run the following command to list the existing claimrules:
# esxcli corestorage claimrule list
For example:
# esxcli corestorage claimrule list
Rule Class Type Plugin Matches
0 runtime transport NMP transport=usb
1 runtime transport NMP transport=sata
2 runtime transport NMP transport=ide
3 runtime transport NMP transport=block
4 runtime transport NMP transport=unknown
101 runtime vendor MASK_PATH vendor=DELL model=Universal Xport
101 file vendor MASK_PATH vendor=DELL model=Universal Xport
192 runtime location MASK_PATH adapter=vmhba33 channel=0 target=* lun=0
65535 runtime vendor NMP vendor=* model=*
Reload the claim rules with the command:
# esxcli corestorage claimrule load
Verify that the created rule is totally deleted.
# esxcli corestorage claimrule list
For example:
# esxcli corestorage claimrule list
Rule Class Type Plugin Matches
0 runtime transport NMP transport=usb
1 runtime transport NMP transport=sata
2 runtime transport NMP transport=ide
3 runtime transport NMP transport=block
4 runtime transport NMP transport=unknown
101 runtime vendor MASK_PATH vendor=DELL model=Universal Xport
101 file vendor MASK_PATH vendor=DELL model=Universal Xport
65535 runtime vendor NMP vendor=* model=*
Run this command to unclaim each path to the masked device:
# esxcli corestorage claiming unclaim -t location -A vmhba0 -C 0 -T 0 -L 2
This ensures that all paths to the device are unclaimed successfully before running the claim. Update vmhba, controller, target and LUN number as required. Unclaiming dissociates the paths from MASK_PATH and have them associated to NMP.
Note: The esxcli corestorage claiming unclaim --type location vmhba1 command to unclaim paths might result in issues if the unclaim for one of the paths times out. Therefore, VMware recommends you to use the esxcli corestorage claiming unclaim --type plugin --plugin MASK_PATH command to unclaim paths.
Perform a rescan on all of the ESX hosts that had visibility to the LUN. If all of the hosts are in a cluster, right-click the cluster and click Rescan for Datastores. Previously masked LUNs should now be accessible to the ESX host.
VCP-DCV, VCP-DT, VCAP-DCD, VSP, VTSP