Changing the IQN target number on an ESX host
search cancel

Changing the IQN target number on an ESX host

book

Article ID: 306743

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article describes changing the target number assigned to an IQN when using the software iSCSI iniator.


Symptoms:



Environment

VMware ESX Server 3.0.x
VMware ESX Server 3.5.x

Resolution

As the IQN target detection order is not guaranteed to be the same on all servers, the target number for different IQNs may not match on all servers.
This procedure can be used to alter the target number assigned to an IQN.
  1. From the VMware Infrastructure Client, remove the storage processor IP addresses from dynamic initators.

    1. Click on the ESX host.
    2. Click the Configuration tab.
    3. Click Storage Adapters.
    4. Select the software intiator adapter (vmhba32 for ESX 3.5 and vmhba40 for ESX 3.0).
    5. Click Properties.
    6. Click the Dynamic Discovery tab.
    7. Select each target from the array and remove it.

  2. Log in to the ESX service console and change to the /var/lib/iscsi directory.
  3. Edit the vmkbindings and vmkdiscovery files.

    Note: Make a backup of these two files by running cp vmkbindings vmkbindings.bak.

    Remove any unwanted entries and re-number the initiators of the entries you want to keep in both files.

    For example, changing the target number from 6 to 0.

    vmkbindings
    # Format:
    # bus target iSCSI
    # id id TargetName
    #
    0 6 iqn.1992-08.com.netapp:sn.84228148 0


    Change the 6 to 0.

    vmkbindings
    # Format:
    # bus target iSCSI
    # id id TargetName
    #
    0 0 iqn.1992-08.com.netapp:sn.84228148 0

    vmkdiscovery
    0 6 iqn.1992-08.com.netapp:sn.84228148

    Change the 6 to 0.

    vmkdiscovery
    0 0 iqn.1992-08.com.netapp:sn.84228148

  4. Reboot the ESX host.
  5. Log back into the ESX host using the VMware Infrastructure Client and re-add the storage processor IP addresses in Dynamic Discovery.

    1. Click on the ESX host.
    2. Click the Configuration tab.
    3. Click Storage Adapters.
    4. Select the software intiator adapter (vmhba32 for ESX 3.5 and vmhba40 for ESX 3.0).
    5. Click Properties.
    6. Click the Dynamic Discovery tab.
    7. Click Add.
    8. Enter the IP address and click OK.

  6. Perform a rescan from the VMware Infrastructure Client.

The LUNs now appear with the desired target numbers.