I am trying to automate the removal of datastores from multiple VMware hosts. The current process is very tedious when you have multiple hosts. The scenario is where I want to permanently remove the datastore from the host. I have used the automation scripts from the following URL: http://blogs.vmware.com/vsphere/2012/01/automating-datastore-storage-device-detachment-in-vsphere-5.html
. This works great to unmount and detach the datastore. What it doesn't do it to remove the static ISCSI target from the storage adapter, and then rescan. I know it can be done programmatically, because I see Equallogic's VSM do it. How can I do this as well?
What would be nice is to be able to pass the datastore name and the host's name to a script and have it complete all the tasks, rather than have it umount/detach from all hosts.
This would be very useful because we have 30 hosts (in 5 node clusters) and at least that many datastores. We try to limit ISCSI connection count by exposing a single datastore to a single cluster. Those VMs will run on that cluster.
Thanks for the help!