I have managed to get a test server and noticed some weird behaviour with this.
If i havent yet bound any vmknics to the software iscsi adapter and run the command from SSH
esxcli swiscsi nic list -d vmhba33
it returns a message saying no nics found for this adapter, as it should do.
If i run the command from PowerCLI:
$HBANumber | %{$esxCli.swiscsi.nic.list("$_")}
or even manually specifying the vmhba:
$esxcli.swiscsi.nic.list("vmhba33")
I get the following error instead of it just saying there are no nics found
[vSphere PowerCLI] C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $esxcli.swiscsi.nic.list("vmhba33")
The remote server returned an error: (500) Internal Server Error.
At line:1 char:25
+ $esxcli.swiscsi.nic.list <<<< ("vmhba33")
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodInvocationException
Once i add a nic through SSH
esxcli swiscsi nic add -n vmk2 -d vmhba33
and then run the list command through PowerCLI it returns some values correctly:
[vSphere PowerCLI] C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $esxcli.swiscsi.nic.list("vmhba33")
NICdriver : e1000
driverversion : 8.0.3.2-1vmw-NAPI
ethernetspeed : 1000
firmwareversion : N/A
ipv4address : 10.10.1.1
ipv4netmask : 255.255.255.0
ipv6addresses :
linkconnected : true
macaddress : 00:0c:29:49:9e:97
mtu : 9000
pNicname : vmnic3
packetsreceived : 9011
packetssent : 51
portsreserved : 63488~65536
tcpchecksum : false
toe : false
tso : true
vNicname : vmk2
vlan : true
vlanId : 0
So thats the first odd thing i noticed.
Second part is I can't add any vmk using powerCLI, i get an error even when specifying vmhba33 manually:
[vSphere PowerCLI] C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $esxcli.swiscsi.nic.add("vmk3", "vmhba33")
The remote server returned an error: (500) Internal Server Error.
At line:1 char:24
+ $esxcli.swiscsi.nic.add <<<< ("vmk3", "vmhba33")
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodInvocationException
What am i doing wrong?
//EDIT//
Got it working changed the vmk and vmhba values around
from $esxcli.swiscsi.nic.add("vmk3", "vmhba33")
to $esxcli.swiscsi.nic.add("vmhba33", "vmk3")