I have DV switch with 5 portgroups. Of the 5 portgroups, three of them has a VM Kernel port
1 - Management - vmk0 (set to management)
2 - vMotion - vmk1 (set to vMotion)
3 - VM - no kernel port
4 - iSCSI - vmk2 (set to nothing)
5 - Trunk - no kernel port
I am trying to bind the vmk2 to my software iSCSI HBA with the following
$hba = Get-VMHostHba -Type iScsi | Where {$_.Model -eq "iSCSI Software Adapter"}
$vmkSCSI = $vmhost | Get-VMHostNetworkAdapter -VMKernel | where {$_.PortGroupName -cmatch 'iSCSI Network'} | select Devicename
$esxcli = Get-EsxCli -V2 -VMHost $vmhost
$esxcli.iscsi.networkportal.add.CreateArgs()
$bind = @{
adapter = $hba.Device
force = $false
nic = $vmkSCSI.DeviceName
}
$esxcli.iscsi.networkportal.add.Invoke($bind)
Upon execution, I got the following error, and not sure exactly what I am missing
PS C:\Users\cdominic> $esxcli.iscsi.networkportal.add.Invoke($bind)
Message: EsxCLI.CLIFault.summary;
InnerText: Unable to bind iscsi port. [force = 0]
iScsiException: status(c0000000): Invalid parameter; Message= IMA_VMW_AddNicEsxCLI.CLIFault.summary
At line:1 char:1
+ $esxcli.iscsi.networkportal.add.Invoke($bind)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], MethodFault
+ FullyQualifiedErrorId : VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.MethodFault
Just to be safe, I explicitly add in the values manually and gotten the same error
$bind = @{
adapter = 'vmhba64'
force = $false
nic = 'vmk2'
}
When I try to do it through the GUI, I notices that I don't have the option to pick vmk2 from the GUI either. What am I missing?