Rescan all hosts for new storage

More of a note for myself really but others may find this useful, to rescan all the hosts (rather than clicking Rescan in the GUI) you can run the following PowerShell command:

For a Specific Cluster:

get-cluster -name “MY CLUSTER” | get-vmhost | Get-VMHostStorage -RescanAllHBA

All Hosts in VC:

get-vmhost | Get-VMHostStorage -RescanAllHBA

3 thoughts on “Rescan all hosts for new storage

  1. Kevin

    Thanks for the tip, although this makes it slightly easier, it still takes 5 minutes per server to re-scan and since this is a synchronous command, with 10 ESX hosts, this takes 1 hour to run.

    Any idea of a asynchronous way to kickoff a rescan for each host simultaneously?

  2. Rob Preston

    Nice, just used it. Works a treat and will save loads of time.

    Keep ’em coming.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.