Detaching datastores with vMA
Once you have a decommissioned datastore, it could be a little hectic to detach it from all the hosts manually. What if you have fifty vSphere hosts and you need to detach it one by one from all the hosts. You can use the VMware Management Assistant (vMA) to automate detachment. Now we will use it to delete a datastore. If you need help or further explanation about vSphere vMA appliance, please refer to Chapter 1, The Methodology of Problem Solving.
Log in to the vSphere vMA appliance through SSH as a vi-admin user.
Add a server as a vMA target by running the following command:
vi-admin@vma:~> vifp addserver crimv3esx003.linxsol.com --authpolicy fpauth --username root
Now, set it as the target server to execute storage operations:
vi-admin@vma:~> vifptarget --set crimv3esx003.linxsol.com
Next, use the
vicfg-nas
command to list all available datastores to the host:vi-admin@vma:~[crimv3esx003.linxsol.com]> vicfg-nas –l
Select the name of the datastore...