Skip to content
NGX Storage Knowledge Base
< All Topics

Configuring Linux Host for iSCSI with NGX Storage Unified Series

Print

This document covers the configuration and best practices to configure iSCSI in Linux. In this example, we used Red Hat Enterprise Linux 8, but this procedure also works on Pardus, Ubuntu, Debian, openSUSE , SLES, Rocky Linux systems. When running below commands, replace the IPs and the IQNs with those from your own environment.

Linux Host Configuration

1. Make sure that you are following NGX Storage Linux Recommended Settings before proceeding.
2. Install the iscsi-initator package as the root user:

For RHEL / CentOS / Rocky :

# yum install iscsi-initiator-utils

For Ubuntu / Debian / Pardus :

# apt-get install open-iscsi

For SLES / openSUSE :

# zypper -n install open-iscsi

3. Configure /etc/iscsi/iscsid.conf for optimal performance.

To control how many commands the session will queue, set it to;
node.session.cmds_max=256

To control the device's queue depth, set it to;
node.session.queue_depth=128

4. Start the iscsi service and enable it to start when the system boots:

For RHEL / CentOS / Rocky :

# systemctl start iscsid.service

For Ubuntu / Debian / Pardus :

# systemctl enable open-iscsi 
# systemctl enable iscsid

5.  Install and enable Device Mapper Multipathing.

For RHEL / CentOS / Rocky :

# yum install device-mapper-multipath device-mapper-multipath-libs
# mpathconf --enable --with_multipathd y

For Ubuntu / Debian / Pardus :

# apt-get install multipath-tools
# systemctl start multipath-tools.service

NGX Storage iSCSI Target Configuration

1. From each controller at least 1 IP, a total of 2 IP addresses should be assigned for iSCSI connectivity.

2. Add a new portal group under SAN->Portal Group section.

3.  Collect the IQN from the Linux host:

# cat /etc/iscsi/initiatorname.iscsi

4. Add a new auth group under SAN-> Authentication Groups section.

5. Configure auth group with collected Linux IQN:

6.  Map LUNs to target under SAN-> iSCSI Targets menu:

Now, you can see iSCSI target information from the GUI:

7. On the Linux host, discover the target iSCSI portals for both controllers:

# iscsiadm -m discovery -t st -p <NGX Storage SP-A IP>
# iscsiadm -m discovery -t st -p <NGX Storage SP-B IP>

<NGX Storage SP-A/B> is the iSCSI interface IP address that was assigned to controllers.
#  iscsiadm -m discovery -t st -p 10.5.5.1 
10.5.5.1:3260,257 iqn.2015-03.com.ngxio.barisabc123:linuxclients 
#  iscsiadm -m discovery -t st -p 10.5.5.2 
10.5.5.2:3260,257 iqn.2015-03.com.ngxio.barisabc123:linuxclients

8. From your Linux host, log in to the NGX Storage iSCSI targets on both controllers:

# iscsiadm -m node -p <NGX Storage SP-A IP> --login
# iscsiadm -m node -p <NGX Storage SP-B IP> --login

9.  Enable automatic iSCSI login on boot:

# iscsiadm -m node -L automatic

 

10. Edit /etc/multipath.conf file with NGX Storage recommended multipath parameters:

defaults {
        polling_interval 5
        user_friendly_names yes
}
 
devices {

        device {
                vendor "NGX-IO.*"
                product "NGX-IO ISCSI"
                path_grouping_policy group_by_prio
                prio alua
                path_checker tur
                failback immediate
                no_path_retry queue
                flush_on_last_del yes
                dev_loss_tmo infinity
                detect_prio yes
        }
}

multipaths {

    multipath {
        wwid                    3589c00 ...
        alias                   lun1
    }

    multipath {
        wwid                    3589c00 ...
        alias                   lun2
    }

    multipath {
        wwid                    3589c00 ...
        alias                   lun3
    }
 
    multipath {
        wwid                    3589c00 ...
        alias                   lun4
    }
 
}

In this example our multipath.conf is shown below.


defaults { 
       polling_interval 5 
       user_friendly_names yes 
} 
 
devices {
       device { 
               vendor "NGX-IO.*" 
               product "NGX-IO ISCSI" 
               path_grouping_policy     group_by_prio 
               prio alua 
               path_checker    tur 
               failback        immediate 
               no_path_retry   queue 
               flush_on_last_del yes 
               dev_loss_tmo infinity 
               detect_prio yes 
       }
}
multipaths {
   multipath { 
       wwid                    3589c005ff10bc53a6c89713c58ce53be 
       alias                   test_lun_1 
   }
   multipath { 
       wwid                    3589c0036d18678d1674c2dc0fbbe1e44 
       alias                   test_lun_2 
   }
}

11. Restart multipathd service after modifying multipath.conf to changes effect.

# service multipathd restart

See RHEL documentation for multipath.conf attribute descriptions.

According to https://access.redhat.com/solutions/3234761, if you are using RHV-H, multipath configuration must include user_friendly_names no.

12. On the Linux host confirm volumes are presented with multiple paths:

# multipath -ll 
test_lun_2 (3589c0036d18678d1674c2dc0fbbe1e44) dm-3 NGX-IO,NGX-IO ISCSI 
size=100G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw 
|-+- policy='service-time 0' prio=50 status=active 
| `- 3:0:0:1 sde 8:64 active ready running 
`-+- policy='service-time 0' prio=10 status=enabled 
 `- 4:0:0:1 sdd 8:48 active ready running 
test_lun_1 (3589c005ff10bc53a6c89713c58ce53be) dm-2 NGX-IO,NGX-IO ISCSI 
size=100G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw 
|-+- policy='service-time 0' prio=50 status=active 
| `- 3:0:0:0 sdc 8:32 active ready running 
`-+- policy='service-time 0' prio=10 status=enabled 
 `- 4:0:0:0 sdb 8:16 active ready running

13. Now you can provision a filesystem on the dm device using the device name. If  the user_friendly_names parameter is no you can use device-mapped ID.

# mkfs.ext4 /dev/mapper/test_lun_1  
mke2fs 1.45.4 (23-Sep-2019) 
Creating filesystem with 26214400 4k blocks and 6553600 inodes 
Filesystem UUID: 4be58f5f-174e-4c21-9152-ef769f3d4b66 
Superblock backups stored on blocks:  
       32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,  
       4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done                             
Writing inode tables: done                             
Creating journal (131072 blocks): done 
Writing superblocks and filesystem accounting information: done

 

Reference Links

 

COPYRIGHT
© 2022 NGX Teknoloji A.Ş. (NGX Storage). All rights reserved. Printed in the Turkey. Specifications subject to change without notice. No part of this document covered by copyright may be reproduced in any form or by any means-graphic, electronic, or mechanical, including photocopying, recording, taping, or storage in an electronic retrieval system-without prior written permission of NGX Storage. Software derived from copyrighted NGX Storage material is subject to the following license and disclaimer:

THIS SOFTWARE IS PROVIDED BY NGX Storage “AS IS” AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL NGX Storage BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

NGX Storage reserves the right to change any products described herein at any time, and without notice. NGX Storage assumes no responsibility or liability arising from the use of products described herein, except as expressly agreed to in writing by NGX Storage. The use or purchase of this product does not convey a license under any patent rights, trademark rights, or any other intellectual property rights of NGX Storage.

TRADEMARK

NGX Storage and the NGX Storage logo are trademarks of NGX TEKNOLOJI A.Ş. Other company and product names may be trademarks of their respective owners.