Hi,
I'm trying to rescan just one storage adapter (iscsi) instead of rescanning all storage adapters. The script I'm using is the following:
$esxcli = Get-EsxCli -VMHost esxi65host -V2
$Arguments = $esxcli.storage.core.adapter.rescan.CreateArgs()
$Arguments.adapter = "vmhba64"
$esxcli.storage.core.adapter.rescan.Invoke($Arguments)
This is the output I get for the variable $Arguments:
Name Value
---- -----
all Unset, ([boolean], optional)
skipfsscan Unset, ([boolean], optional)
type Unset, ([string], optional)
skipclaim Unset, ([boolean], optional)
adapter vmhba64
Running the script gives the following output:
true
But the action doesn't appear under tasks and checking the events history, there're failures for each iscsi target:
"Login to iSCSI target iqn.... on vmhba64 @ vmk3 failed. The iSCSI initiator could not establish a network connection to the target."
If I run a manual rescan of the iscsi adapter from the GUI, it works fine and there's a log of the rescan action under tasks.
In the meantime, I'm just rescanning all the storage adapters via:
Get-VMHost -Name esxi65host | Get-VMHostStorage -RescanAllHba
But I would like to be more specific in targeting the adapters to rescan.
Any help would be much appreciated.
Thanks.