VMware Cloud Community
troyemc
Contributor
Contributor
Jump to solution

iSCSI Port Binding

Hi Experts,

I am trying to bind 2 vmkernal ports to iSCSI SW HBA. using powercli. ESXi v6.0, Powercli v6.5

I found 2 examples how to do it, but both don't work:

First way: Get-VMHost $VMhost | Set-VMHostiSCSIBinding -HBA $HBANumber -VMKernel $iSCSI_nic - it complain there is no Set-VMHostiSCSIBinding

The second way:

$esxcli = Get-EsxCli -V2 -VMhost $VMhost

$esxcli.iscsi.networkportal.add($HBA, $Null, $vmk1number)

or

#$esxcli.swiscsi.nic.add($HBANumber,$vmk1number)

It fails complaining "add" is not an option.

Any help is appreciated.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

When you use the V2 switch on the Get-EsxCli cmdlet, the way of making the call is slightly different.

See also PowerCLI 6.3 R1: Get-ESXCLI Why the V2?

First do the following to get the layout of the hash table.

$esxcli.iscsi.networkportal.add.CreateArgs()

Then do the call (notice the Invoke that needs to be added).

$iScsi = @{

    force = $false

    nic = 'vmk0'

    adapter = 'vmhba34'

}

$esxcli.iscsi.networkportal.add.Invoke($Iscsi)


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

When you use the V2 switch on the Get-EsxCli cmdlet, the way of making the call is slightly different.

See also PowerCLI 6.3 R1: Get-ESXCLI Why the V2?

First do the following to get the layout of the hash table.

$esxcli.iscsi.networkportal.add.CreateArgs()

Then do the call (notice the Invoke that needs to be added).

$iScsi = @{

    force = $false

    nic = 'vmk0'

    adapter = 'vmhba34'

}

$esxcli.iscsi.networkportal.add.Invoke($Iscsi)


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
troyemc
Contributor
Contributor
Jump to solution

Thank you so much LucD! Work like a charm!

0 Kudos