Vmware lab building reference: http://boerlowie.wordpress.com/2011/12/15/building-the-ultimate-vsphere-lab-part-10-storage/
The blog was written based on vmware esxi5, I am using vmware esx 4.1 to build a lab. Part 10 – Storage has a user interface to bind the iscsi ports to the iscsi adapter however in vmware esx 4.1 I could not find the tab which says Network Configuration, I refer to the knowledge base of vmware and found that to bind the ports to the adapter I need to use command line.
Enable iscsi adapter
I need to enable the iscsi adapter first in order to proceed with the rest of the steps described by Building the ultimate vsphere lab.
There was no iscsi name before enabling it, after iscsi adapter was enabled vmhba33 was created and with a name. This name is needed to create iscsi targets.
Bind iscsi ports to the iscsi software adapter
You need to use command line to accomplish this step, as you can see from screenshot, there is no tab which says Network Configuration in iSCSI initiator (vmhba33) properties dialog.
For ease of demonstration I enable ssh for root access, by default sshd does not allow root access.
The below is an error from esx2.cyruslab.local which is my second vmware esx host. As you can see there is no iscsi ports bound to the iscsi adapter.
[root@esx2 ~]# esxcli swiscsi nic list -d vmhba33 Errors: No nics found for this adapter. [root@esx2 ~]#
I will add the two vswitch ports to the iscsi software adapter.
[root@esx2 ~]# esxcli swiscsi nic add -n vmk0 -d vmhba33 [root@esx2 ~]# esxcli swiscsi nic add -n vmk1 -d vmhba33
vmk
is the vswitch port, and vmnic
is the virtual nic for the guest OS.
Check the ports of the iscsi adapter.
[root@esx2 ~]# esxcli swiscsi nic list -d vmhba33 vmk0 pNic name: vmnic2 ipv4 address: 10.0.1.5 ipv4 net mask: 255.255.255.0 ipv6 addresses: mac address: 00:0c:29:69:02:80 mtu: 1500 toe: false tso: true tcp checksum: false vlan: true vlanId: 0 ports reserved: 63488~65536 link connected: true ethernet speed: 1000 packets received: 4151 packets sent: 769 NIC driver: e1000 driver version: 8.0.3.2-1vmw-NAPI firmware version: N/A vmk1 pNic name: vmnic3 ipv4 address: 10.0.1.7 ipv4 net mask: 255.255.255.0 ipv6 addresses: mac address: 00:0c:29:69:02:8a mtu: 1500 toe: false tso: true tcp checksum: false vlan: true vlanId: 0 ports reserved: 63488~65536 link connected: true ethernet speed: 1000 packets received: 4909 packets sent: 11 NIC driver: e1000 driver version: 8.0.3.2-1vmw-NAPI firmware version: N/A [root@esx2 ~]#
As you can see the output shows which vmk
attached itself to which vmnic
.
Add iscsi target
Add the iscsi target dynamically by specifying the iscsi server which is the shared storage.


