Rescanning for new storage devices
After creating LUN on your Fibre Channel storage system and presenting LUN to your ESXi servers, you have to rescan HBAs on the ESXi servers before you can create a datastore on LUN. An ESXi host will not see newly attached LUN before a rescan is performed. You can use the Get-VMHostStorage
cmdlet to rescan the HBAs of a host. The Get-VMHostStorage
cmdlet has the following syntax; the first parameter set is the default:
Get-VMHostStorage [-VMHost] <VMHost[]> [-Refresh] [-RescanAllHba]
[-RescanVmfs] [-Server <VIServer[]>] [<CommonParameters>]
The second parameter set is for retrieving host storage by ID:
Get-VMHostStorage -Id <String[]> [-Server <VIServer[]>]
[<CommonParameters>]
The -VMHost
and -Id
parameters are required.
In the following example, we will rescan all the HBAs of the hosts of cluster Cluster01
:
PowerCLI C:\> Get-Cluster -Name Cluster01 | >> Get-VMHost | Get-VMHostStorage -RescanAllHba...