Present ISCSI LUN From Nimble Storage to ubuntu 18.04

Please refer to the steps below on how to Present ISCSI LUN From Nimble Storage to ubuntu 18.04

Get the ISCSI initiator IQN name for ubuntu 18.04
open-iscsi is installed by default and note down the name of the iscsi initiaor

cat /etc/iscsi/initiatorname.iscsi

    ## DO NOT EDIT OR REMOVE THIS FILE!
    ## If you remove this file, the iSCSI daemon will not start.
    ## If you change the InitiatorName, existing access control lists
    ## may reject this initiator.  The InitiatorName must be unique
    ## for each iSCSI initiator.  Do NOT duplicate iSCSI InitiatorNames.
    InitiatorName=iqn.1993-08.org.debian:01:bb4224e84355

Configuration in NimbleOS 5
1. Login to NimbleOS Storage via SSH and Create ISCSI Initiator Group

#Create a new ISCSI initiator Group called ubuntu
Nimble OS $ initiatorgrp --create ubuntu
#Add the initiator Name for ubuntu with IP Address
Nimble OS $ initiatorgrp --add_initiators ubuntu --label ubuntu --initiator_name iqn.1993-08.org.debian:01:bb4224e84355 --ipaddr 192.168.1.252
#Verify the info
Nimble OS $ initiatorgrp --info ubuntu
    Name: ubuntu
    Description:
    Host Type: auto
    Access Protocol: iscsi
    Application identifier:
    Created: Aug 29 2018 19:42:20
    Last configuration change: Aug 29 2018 19:50:26
    Number of Subnets: All
    Number of Initiators: 1
            Initiator Label: ubuntu
                    Initiator Name: iqn.1993-08.org.debian:01:bb4224e84355
                    Initiator IP Address: 192.168.1.252
    Number of Volumes: 0

Create a new Volume for ubuntu
Size = 1024MB and allow ubuntu (Initiatir Group) to access only with default performance policy

Nimble OS $ vol --create ubuntu --size 1024 --initiatorgrp ubuntu

Discover the availble ISCSI Tager in NimbleOS 5

root@myuat:~# iscsiadm -m discovery -t sendtargets -p 192.168.1.242
192.168.1.242:3260,2460 iqn.2007-11.com.nimblestorage:ubuntu-v1d93a7e6c1dd32cb.00000003.dc4e952d

Login to ISCSI Target

root@myuat:~# iscsiadm -m node --login
Logging in to [iface: default, target: iqn.2007-11.com.nimblestorage:ubuntu-v1d93a7e6c1dd32cb.00000003.dc4e952d, portal: 192.168.1.242,3260] (multiple)
Login to [iface: default, target: iqn.2007-11.com.nimblestorage:ubuntu-v1d93a7e6c1dd32cb.00000003.dc4e952d, portal: 192.168.1.242,3260] successful.

Verify the established ISCSI session

root@myuat:~# iscsiadm -m session -o show
tcp: [1] 192.168.1.242:3260,2460 iqn.2007-11.com.nimblestorage:ubuntu-v1d93a7e6c1dd32cb.00000003.dc4e952d (non-flash)

Verify the newly create HDD (it is sdc in our case)

root@myuat:/# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0    7:0    0 86.6M  1 loop /snap/core/4486
loop1    7:1    0   87M  1 loop /snap/core/5145
sda      8:0    0   10G  0 disk
├─sda1   8:1    0    1M  0 part
└─sda2   8:2    0   10G  0 part /
sdb      8:16   0   10G  0 disk
└─sdb1   8:17   0   10G  0 part
sdc      8:32   0 1000M  0 disk
sr0     11:0    1 1024M  0 rom

Format the entire volume as EXT4

root@myuat:/# mkfs.ext4 /dev/sdc
    mke2fs 1.44.1 (24-Mar-2018)
    Discarding device blocks: done
    Creating filesystem with 256000 4k blocks and 64000 inodes
    Filesystem UUID: e8a07af9-7460-4879-83b1-d8cf872f2f86
    Superblock backups stored on blocks:
            32768, 98304, 163840, 229376

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

Mount the new volume

root@myuat:/# mkdir nimble
root@myuat:/# mount /dev/sdc /nimble
root@myuat:/# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0    7:0    0 86.6M  1 loop /snap/core/4486
loop1    7:1    0   87M  1 loop /snap/core/5145
sda      8:0    0   10G  0 disk
├─sda1   8:1    0    1M  0 part
└─sda2   8:2    0   10G  0 part /
sdb      8:16   0   10G  0 disk
└─sdb1   8:17   0   10G  0 part
sdc      8:32   0 1000M  0 disk /nimble
sr0     11:0    1 1024M  0 rom

The ISCSI LUN is mounted successfully in ubuntu 18.04 now

Leave a Comment