vmware: Binding iscsi initiator ports to iscsi software adapter

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.
storage1

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.
storage2

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.
storage4

Once added the server is listed, click close button.

Once added the server is listed, click close button.

click yes to rescan

click yes to rescan

Connected targets and Devices should be 2, and there should be 4 paths. The virtual disks assigned should also be displayed.

Connected targets and Devices should be 2, and there should be 4 paths. The virtual disks assigned should also be displayed.

Advertisements
This entry was posted in VMware and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s