Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Trying to setup a few CentOS nodes to connect to a Dell MD3600i array, i'm running into the issue that the MD3600i shows 4 different portals (with different IP addresses) and when i launch the initiator on host side well, it connects to every IP address it has seen during the discovery phase; resulting in duplicates.

How can I 'force' the initiator to discard every other IP and let me choose only one IP portal to connect to ?

Must be damn stupid but I can't figure out how.

Thx

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Often a single storage array is serving data to several different networks where each initiator connecting to it has its interfaces only in a subset of the networks.

                           -----------------------     ------------------------
department 1(vlan1,3)  --  |                     | -- |storage ctlr 1(vlan 1-4)|
                           |shared storage fabric|    |                        |
department 2(vlan2,4)  --  |                     | -- |storage ctlr 2(vlan 1-4)|
                           -----------------------     ------------------------

Multipath would "merge" four reachable targets for deparmtent 1 host into one device-mapper node. However it would not save from waiting for unreachable vlan2 and vlan4 targets to timeout during boot.

iSCSI discovery returns all the target IP-addresses both reachable and non-reachable ones. SuSE-based distributions have a YaST iSCSI Initiator setup applet to configure which discovered targets should be connected automatically and which should not. For RedHat-based distributions one has to do it by hand changing the startup mode in the target descriptions stored under /var/lib/iscsi/nodes/ from automatic to manual.

I am using a script to browse the files and update the startup mode line:

#!/bin/bash
for tgt in /var/lib/iscsi/nodes/*/* ; 
do 
   echo $tgt 
   if [ -f "$tgt"/default ] ; then 
     mode=$( grep node.startup "$tgt"/default | sed -e 's/^.*=//' -e 's/ //g' )
     if [ "$mode" = "automatic" ] ; then 
       echo "Switch to manual [y/n]?" 
       read ANS 
       case $ANS in 
          y|Y) echo "BEFORE:" 
               head -3 $tgt/default 
               perl -p -i -e \
                  "s{node.startup = automatic}{node.startup = manual}" \
                  $tgt/default 
               echo "AFTER:" 
               head -3 $tgt/default ;; 
          n|N) echo "ok, will keep as is" ;; 
          *) echo "wrong answer" ;; 
       esac
     else
      echo "Already in manual mode" 
     fi # mode is automatic
   fi # defaults exist
done
share|improve this answer

Have you considered running Multipath? In a situation such as this Multipath would still allow for all of the connections to the device, however in the event one goes down the other can take over. Alternatively you can configure Multipath to use all links to the storage to increase bandwidth to your storage device. Either way Multipath can be used to make all of the devices seen appear as one device when they all represent the same storage LUN.

The documentation for RHEL 5 can be found here:
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/DM_Multipath/index.html

RHEL 6: http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/DM_Multipath/index.html

share|improve this answer
    
Sure but in order to use multipath; i need to have multiple nics, right ? In this case I only have 1 nic that i can dedicate for this purpose –  Disco Jun 26 '12 at 20:15
    
No, Multipath is included in the OS. Often customers coming from a Unix background think they need something like PowerPath from EMC when they do not. Check the documentation links presented for more information. Mutlipath allows for multiple paths to the same storage LUN. These paths can be used for resiliency, or increased bandwidth. –  Red Tux Jun 26 '12 at 20:23
    
Final question: how do i flush the corrent iscsi sessions as it tries to connect each time to a previous non-existing ip address portal ? –  Disco Jun 26 '12 at 21:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.