If you just want to remove a iSCSI HyperStore storage server from your ESXi shell command line you do the following:
esxcli iscsi adapter discovery sendtarget remove --address <<your-ip-addres-goes-here>> --adapter=`esxcli iscsi adapter list|grep -i software|cut -f 1 -d " "`;
Well you have a few ESXi blades it's OK and recommended (as far as I know) to umount the HyperStore storage server (FreeNAS or what ever you have) using the VMware console GUI. But when you have a hundreds of ESXi blades it's a bit time consuming to do that.
I truly hope you do not have any active servers on that HyperStore storage server. You remove those first or migrate them via VMware.
After you have removed the IP (or IPs - as usually the SCSI targets are mounted via 2 fibers, each with it's own switch and IP), you now have to run the rediscover and rescan on the ESXi. For that use the following commands:
esxcli iscsi adapter discovery rediscover --adapter=`esxcli iscsi adapter list|grep -i software|cut -f 1 -d " "`;
and...
esxcli storage core adapter rescan --adapter=`esxcli iscsi adapter list|grep -i software|cut -f 1 -d " "`
All the above have been tested on ESXi 5 and 6.
That's it!
This is intended to share a bit of my experience from the magic world of Linux system administration, Ceph Cluster Storage administration and how I’ve rebooted the wrong servers and what I did not to screw things up again, and so on… I guess, this is what experience is…
More to follow…
Thank you.