I thought I would share this script, its been circulating a bit but I feel it is a nice one to have in your toolkit.
Have you ever had to remove a LUN from a cluster and thought “Do I really need to detach all the LUN’s, before un-mapping from my SAN?”
Un-map from SAN
Well here is a handy script with output. All you need to do is unmount your datastore(s), and then enter in your naaid of your LUN’s and the cluster you want to remove it from, save it an execute. All the LUN’s will be detached without having to manually go and detach it from every LUN in your cluster.