Showing posts with label iSCSI. Show all posts
Showing posts with label iSCSI. Show all posts

Sunday, March 28, 2010

Discover iSCSI SAN LUN on ESX via CLI - As easy as you count 1,2,3 (assumes SAN admin mapped LUN to ESX Host & VMkernel port ready on ESX)



The command vmkiscsi-tool. Really good stuff, I can complete the rest of my setup without the GUI. One thing though to list out the iqn for iscsi after you enable it you must know the device name (ie vmhba??). Using this command:

# vmkiscsi-tool -I -l

I usually guess the iscsi hba is vmhba33 or 32 but how do I know for sure? Try:
# esxcfg-scsidevs -a
esxcfg-scsidevs-a
Ok great, now we know it is vmhba33 (Click the above image for full details as well)

[root@esxhost01 sbin]# vmkiscsi-tool -I -l vmhba33


iSCSI Node Name: iqn.1998-01.com.vmware:esxhost01-35151883
 

[root@esxhost01 sbin]#

Now with a few more vmkiscsi-tool commands I can finish configuring my iSCSI.

Add the Ip of the SAN:
[root@esxhost01 sbin]# vmkiscsi-tool -D -a 172.16.23.251 vmhba33

Now rescan:
[root@esxhost01 sbin]# esxcfg-rescan -a vmhba33

Wednesday, March 24, 2010

Configuring and troubleshooting basic software iSCSI setup

Configuring and troubleshooting basic software iSCSI setup (Extract from Vmware KB 1008083)

Symptoms


You are experiencing these issues with iSCSI targets:
  • Targets are numbered out of sequence.
  • Targets do not appear in VMware Infrastructure (VI) Client or VirtualCenter.
  • Targets do not appear in vSphere Client or vCenter Server.

Purpose


This article provides basic software iSCSI setup, configuration and troubleshooting.

Resolution


Configuration

From vSphere Client/VMware Infrastructure (VI) Client or vCenter Server:

  1. Ensure you have a separate physical vswitch for iSCSI.

  2. Add a VMKernel and Service Console portgroup and give them appropriate IPs.

    Note: A service console may not be needed if working in ESX / ESXi 4.0.

  3. Log into the ESX host and ensure you can ping the iSCSI array. Run the following command:

    # ping 10.1.10.100

    PING 10.1.10.100 (10.1.10.100) 56(84) bytes of data.
    64 bytes from 10.1.10.100: icmp_seq=0 ttl=64 time=0.766 ms


    Note: You do not need to use ping when working with ESX / ESXi 4.0 hosts.

  4. Log into the ESX host and ensure you can vmkping the iSCSI array. Run the following command:

    # vmkping 10.1.10.100

    PING 10.1.10.100 (10.1.10.100): 56 data bytes
    64 bytes from 10.1.10.100: icmp_seq=0 ttl=64 time=0.940 ms


    If you are unable to ping or vmkping the array, you need to correct your network connectivity issue before iSCSI works.


  5. Log in to vCenter Server, click on the ESX host, and click Configuration.

  6. Click Storage Adapters and click on the iSCSI Software Adapter.

  7. In the Details pane, click Properties.

  8. On the General tab, click Configure, select Enabled, then click OK. You notice that the Status is now enabled, and the iSCSI name has a valid IQN.

  9. Configure the iSCSI array to use the IQN you have just created. Generally, you also need to assign storage to the ESX host from the array.

  10. Click the Dynamic Discovery tab and click Add.

  11. In the Add Send Targets Server area, add the iSCSI array IP to the iSCSI Server field and click OK.

  12. After the iSCSI Server is added, click Close. This may take a significant amount of time.

  13. Rescan the ESX host storage in the Storage Adapters section, after the rescan, click on the iSCSI initiator and you see information about the SAN array as well as one or more targets.

Troubleshooting

To troubleshoot your setup or re-number your targets:

  1. Ensure that the array, and possibly each Service Processor, has an entry in each of the following files:


    • /etc/vmkiscsi.conf

      Syntax: DiscoveryAddress=:

      For example, DiscoveryAddress=10.200.107.10:3260


    • /var/lib/iscsi/vmkbindings

      Syntax: 0 0

      For example, 0 0 iqn.1992-08.com.company:sn.84259608

      Note: This file is rebuilt on rescan and should be recreated if iSCSI target numbers are out sequence.

    • /var/lib/iscsi/vmkdiscovery

      Syntax: 0 0

      For example, 0 0 iqn.1992-08.com.company:sn.84259608

      Note: This should be recreated if iSCSI target numbers are out sequence.



  2. Restart the Software iSCSI initiator:


    1. Disable the software iSCSI interface

      # esxcfg-swiscsi -d


    2. Kill the iSCSI stack

      # esxcfg-swiscsi -k


    3. Re-enable the iSCSI interface and open the firewall

      # esxcfg-swiscsi -e


    4. Rescan the Software Initiator, wait about 30 seconds after re-enabling

      # esxcfg-swiscsi -s


  3. Rescan a second time.

  4. Reboot the ESX host to have the changes take effect.
Note: If the vswitch is using NIC teaming, as a troubleshooting step, try disabling the second NIC and see if iSCSI functions.