RHCE Providing Remote Block Storage Using iSCSI

iSCSI Concept

Video Tutorial Part 1

Part 2

Part 3

What is iSCSI

iSCSI is refer to Internet Small Computer System interface.This is used to Transfer data actually SCSI high performance local storage bus over the TCP/IP protocol. At the beginning this used as testing environments but now advancement of software,hardware and networking iSCSI concept is used in  production environments too.

SCSI cables only can transfer reliable data within 20m only.But using fiber optic cables and expensive switches.it can be done but its more expensive.But when you use iSCSI concept you can transfer storage data using Ethernet.

iSCSI concept mostly used in NAS(Network attached  Storage) and SAN(Storage Area Networks)

There are two main component

  1. iSCSI Target(server side)
  2. iSCSI Initiator(Client Side)

And there is few terminology you need to understand

iSCSI Terminology

  • Initiator-is the client side this can be hardware device or a software.Initiator should have unique name.
  • Target-is the Storage device.Target also have unique name.Target can provide one or more block devices.This is called LUN
  • ACL-is the Access Control List.Provide permission to initiator
  • Discovery-Can query all the configured targets
  • IQN-is the iSCSI Qualified Name.this will identify the target and the initiator.IQN has pattern

 

  • LUN-Logical Unit Number block devices attached and available via target
  • Node-iSCSI target or a iSCSI initiator can identified by its own IQN
  • Portal- IP and the Port number of target or a initiator
  • TGP-Target Portal Group specific IP and The Port listen by the iSCSI target

Create iSCSI Target Using targetcli

Today Lesson we are going to create separate partition inside the Server and Mount it inside the Desktop using iSCSI concept.

First we create separate partition 1G inside the server

Then

Now create volume group called my_iSCSI

now Create 100mb logical volume called my_logical_volume_disk1 inside the my_iSCSI volume group

lets check newly created 100mb logical volume my_logical_volume

see LV Size 100.00 MiB

lets make this 100mb logical volume as target .Then remote desktop can access the target.

first install and enable targetcli then start target

Then open targetcli

type targetcli in terminal

targetcli looks like this lets make our logical volume as target.so it can be used by the target initiator

server0.disk1 is the name for backstore

Then Create unique IQN (iSCSI Qualified Name) for the target

This will create TGP(Target Portal Group ) automatically named as tgp1

Now Create ACL for target initiator.so client can connect via initiator name

 

Then create LUN for previously created backstore

Make portal listen on port 3260 in target.so any request received to target on port 3260 will directed to iSCSI

Then verify the configuration using ls

Final stem type exit to save and exit the targetcli

 

All the configuration is saved as a jsonfile

Now 100mb logical volume is configured as a target.This target can access via remote machine using target initiator.

lets access this target from another machine.Now im using Desktop

Accessing iSCSI Storage

Previous step we created the target in server0. Now i’m inside desktop0 and create target initiator inside the desktop and access the server0 target via Desktop.Lets get started.

First install iscsi-initiator-utils

 

Edit /etc/iscsi/initiatorname.iscsi

Enable iSCSI and start iSCSI

 

Discover iSCSI target

but error will occur.

Fixed iscsiadm: cannot make connection to IP: No route to host Solved

Lets add port 3260 to firewall in server0

Then reload the firewall-cmd

Check ports that allowed through firewall

Lets rerun the discovery command to get the node of the target .so lets back to desktop0

Same thing can be done like this also

 

Log in to iSCSI Target

Same thing can by this command also

Lets check any scsi device that have attached to the system

Check disk for read only mode

RO equals to 0 that means this is read write mode.

Now we are good to go.Now create file system just like normal device.Our iSCSI device is sda so /dev/sda

this will format entire  device as ext4 file system.

For mount this newly created device we need UUID so get UUID

Add this UUID to the /etc/fstab so it will auto mount when system restart

inside /etc/fstab

in this case remember normally we use default but here its _netdev that means it wait for the network to mount the devices.

now create new directory called /mnt/iscsi

 

Mount devices

See file system is mounted via iSCSI

create new text file inside /mnt/iscsi/first.txt

 

Check session details of iscsi administrator

This will give the all the information about the iSCSI session.

iSCSI node keep the record of the session.this located inside /var/lib/iscsi/nodes

Logout From iSCSI Target

we use -l or –login for login to the node -u or –logout

But /var/lib/iscsi/nodes still keep the record for the session.so delete node record

Delete node record in iSCSI

 

This will stop the session and delete the record.after this step session record file is delete.

Rebooting the iscsi System

First umount the file system

Stop iSCSI Initiator

 

This will release the all the file system locks otherwise system will stuck because of locked file system.

Reboot the desktop0.This should auto mount the iSCSI target because its in /etc/fstab

I hope you will get something from this tutorial.if you like this tutorial please share on facebook,twitter,google plus.

If you have any question please leave comment below.

See you in next tutorial.

Sameera Dissanayaka

 

 

 

 

 

Keyword For Search

redhat iscsi initiator
redhat iscsi multipath
redhat iscsi target server
redhat iscsi setup
redhat iscsi rescan
redhat iscsi config
redhat iscsi boot
redhat iscsi timeout
redhat iscsi target
redhat add iscsi disk
redhat iscsi bonding
redhat iscsi configuration
redhat iscsi client
redhat iscsi commands
redhat iscsi chap
redhat iscsi ceph
redhat ceph iscsi gateway
redhat configure iscsi target
redhat 7 iscsi configuration
redhat delete iscsi target
redhat discover iscsi
redhat list iscsi devices
iscsi discovery redhat
redhat scan iscsi disk
redhat iscsi fstab
redhat boot from iscsi
redhat iscsi gui
redhat iscsi howto
redhat iscsi initiator howto
rhel5 iscsi how to
red hat linux iscsi howto
redhat iscsi iface
redhat install iscsi
redhat install iscsi target
rhel5 iscsi initiator
redhat list iscsi targets
red hat linux iscsi
redhat remove iscsi lun
redhat add iscsi lun
red hat login iscsi
redhat iscsi mount
redhat 7 iscsi multipath
redhat mount iscsi volume
redhat 6 iscsi multipath
redhat iscsi initiator name
redhat openstack iscsi
iscsi on redhat
iscsi on redhat 7
redhat iscsi package
redhat remove iscsi target
redhat restart iscsi
redhat iscsi server
redhat iscsi service
redhat show iscsi
redhat iscsi initiator setup
redhat 7 iscsi server
redhat ceph storage iscsi
redhat iscsi troubleshooting
rhel5 iscsi target
redhat 7 iscsi target
redhat 6 iscsi target
red hat update iscsi
rhel 4 iscsi
iscsi redhat 5
redhat 5 iscsi
rhel5 iscsi
rhel 5 iscsi target
iscsi redhat 6
install iscsi redhat 6
iscsi redhat 7
redhat 7.4 iscsi
redhat 7.3 iscsi
redhat 7.2 iscsi
redhat 7 iscsi
rhel 7 iscsi multipath
rhel 7 iscsi target setup
rhel 7 iscsi boot
rhel 7 iscsi client

6 thoughts on “RHCE Providing Remote Block Storage Using iSCSI

Leave a Reply

Your email address will not be published. Required fields are marked *