Difference between revisions of "Set up an iscsi storage"

From Linuxintro
imported>ThorstenStaerk
m
Line 1: Line 1:
 
[http://en.wikipedia.org/wiki/Iscsi iSCSI] is a protocol that allows you to connect to block-oriented [[storage]] over the IP-[[network]]. To have an ISCSI target, you do not need to buy an enterprise-class ISCSI storage, you can start an ISCSI target as service on your computer. This is especially useful when running e.g. [[cluster]] tests on shared storage.
 
[http://en.wikipedia.org/wiki/Iscsi iSCSI] is a protocol that allows you to connect to block-oriented [[storage]] over the IP-[[network]]. To have an ISCSI target, you do not need to buy an enterprise-class ISCSI storage, you can start an ISCSI target as service on your computer. This is especially useful when running e.g. [[cluster]] tests on shared storage.
  
= QuickStart =
+
What’s up?. Thanks a bunch for the blog. I’ve been dggiing around looking some info up for shool, but there is so much out thereGoogle lead me here – good for you i suppose! Keep up the great information. I will be coming back in a couple of days to see if there is any more info.
 
 
== SUSE Linux Enterprise server 10 ==
 
 
 
In this chapter, we will set up an ISCSI target and connect to it
 
 
 
=== Check your state ===
 
 
 
See how many block devices you have attached:
 
  [[hwinfo]] --block --short
 
 
 
=== Set up a target ===
 
 
 
* start [[yast2]]
 
* chose Miscellaneous->iSCSI target
 
* continue as instructed, if prompted, allow to [[install]] the [[package]] iscsitarget
 
 
 
=== Set up an initiator ===
 
 
 
* start [[yast2]]
 
* chose Miscellaneous->iSCSI initiator
 
* continue as instructed, if prompted, allow to [[install]] the [[package]] openiscsi
 
 
 
=== Check if it worked ===
 
 
 
See how many block devices you have attached:
 
  [[hwinfo]] --block --short
 
It must be more than before
 
 
 
== generic ==
 
 
 
In this chapter we will set up an iscsi target and test it by installing an iscsi initiator.
 
 
 
=== Set up a target ===
 
 
 
* Download the latest version of iscsi-target from http://iscsitarget.sourceforge.net/. In this example, we use version 0.4.15.
 
* Unpack the [[package]] you just downloaded
 
[[tar]] xvfz iscsitarget-0.4.15.tar.gz
 
* [[Build]] the [[software]]
 
[[cd]] iscsitarget-0.4.15
 
  [[make]] [[&&]] make [[install]]
 
on problems see the article [[Compiling]].
 
* create a configuration for your service:
 
'''/etc/ietd.conf'''
 
Target iqn.2007-12.local.net:storage.lvm
 
        Lun 0 Path=/dev/hdb
 
* start the service
 
/etc/init.d/iscsi-target start
 
* verify the service is running
 
$ [[lsof]] -i
 
  [...]
 
ietd      8692  root    7u  IPv6  36856      TCP *:iscsi-target (LISTEN)
 
ietd      8692  root    8u  IPv4  36857      TCP *:iscsi-target (LISTEN)
 
 
 
=== Set up an initiator ===
 
 
 
To set up an [[iscsi]] initiator, [[install]] the openiscsi [[package]]. Then, discover your targets. Let's assume the [http://en.wikipedia.org/wiki/IP-Address IP-address] of your target is ''192.168.0.5''
 
 
 
$ iscsiadm -m discovery -t st -p ''192.168.0.5''
 
[fa084c] ''192.168.0.5'':3260,1 ''iqn.2001-04.com.example:storage.disk2.sys1.xyz''
 
[3727f9] 127.0.0.1:3260,1 ''iqn.2001-04.com.example:storage.disk2.sys1.xyz''
 
$ iscsiadm -m node
 
[fa084c] ''192.168.0.5'':3260,1 ''iqn.2001-04.com.example:storage.disk2.sys1.xyz''
 
[3727f9] 127.0.0.1:3260,1 ''iqn.2001-04.com.example:storage.disk2.sys1.xyz''
 
 
 
You know now you have a target named ''iqn.2001-04.com.example:storage.disk2.sys1.xyz''
 
Now have a look what drives you have attached:
 
$ [[hwinfo]] --block --short
 
disk:
 
  /dev/sda            VMware Virtual S
 
  /dev/sdb            IET VIRTUAL-DISK
 
partition:
 
[...]
 
Now connect your iscsi target:
 
$ iscsiadm -m node -T ''iqn.2001-04.com.example:storage.disk2.sys1.xyz'' -p ''192.168.0.5'':3260 --login
 
And find a new device in your list:
 
$ hwinfo --block --short
 
disk:
 
  /dev/sda            VMware Virtual S
 
  /dev/sdb            IET VIRTUAL-DISK
 
  /dev/sdc            IET VIRTUAL-DISK
 
partition:
 
[...]
 
  
 
= See also =
 
= See also =

Revision as of 12:12, 12 February 2012

iSCSI is a protocol that allows you to connect to block-oriented storage over the IP-network. To have an ISCSI target, you do not need to buy an enterprise-class ISCSI storage, you can start an ISCSI target as service on your computer. This is especially useful when running e.g. cluster tests on shared storage.

What’s up?. Thanks a bunch for the blog. I’ve been dggiing around looking some info up for shool, but there is so much out there. Google lead me here – good for you i suppose! Keep up the great information. I will be coming back in a couple of days to see if there is any more info.

See also