Location : VISA Research Lab »
iSCSI
This article is a basic tutorial on how to setup the iSCSI protocol on a Linux machine. Before we get started make that your Linux machine is configured with the following items:
The iSCSI (internet Small Computer System Interface) protocol is a method for connecting to a storage device on a remote server by using an internet connection. ISCSI allows the client machine (known as the iSCSI Initiator) to see a storage device, i.e. a hard drive, on another machine (called the iSCSI Target) as a locally-attached device. In order to achieve this kind of connection, we need to set up both the target and the initiator separately.
Note: You will need root privileges in order to execute some of the following commands.
The first step is to download the iSCSI Target package:
This command installs the iSCSI target from the source code, and also installs the iSCSI target module which is necessary to run the iSCSI service. If you get an error that says something like “FATAL: Module iscsi_trgt not found” make sure that the iscsi_trgt module is loaded.
Next, we need to the let the software know that this machine is an iSCSI target by simply editing the file at /etc/default/iscsitarget and setting the “ISCSITARGET_ENABLE” field from false to true:
Next, we add the storage device path to the list of targets. For this, just open the configuration located at /etc/iet/ietd.conf and add the corresponding fields at the end of the file. This is an example:
The word “Target” is a required key name. The string after that is the unique ID that the initiators will see when they connect to this target. The iSCSI standard suggests the format of an IQN or iSCSI Qualified Name. The format is basically iqn.yyyy-mm.<reversed domain name>:<identifier>;the yyyy-mm is the current year and the month; next is the domain name of the machine where the device is located; lastly, the identifier is the name which you choose for your device. The next two lines, the IncomingUser and OutgoingUser fields, are used for authentication purposes which are not used in this simple tutorial (the number sign means the fields are ignored). The next line specifies the target device. If this is the first target device just write Lun 0, to specify that this is the first target device in the list. Next, we specify the full path to the device, and the type which for hard drives is fileio. The last two lines are also optional.
Lastly, start the iSCSI service:
Note: You must make sure that your machine is configured appropriately, or else the program will not install correctly.
Now we need to install the iSCSI initiator. Run this command on the client machine to install the program:
Once the program is installed, you can optionally configure it so that the initiator service starts automatically every time the machine is booted. To do this, just edit the file at /etc/iscsi/iscsid.conf, and uncomment the line that says “node.startup = automatic” and comment out the one that says manual:
Lastly, we turn on the initiator service:
This command basically asks the server to show what target devices are available. An example output would be:
Lastly, we login to the device by running the following command:
Once, you login to the device you will see a new device listed by running the following command:
Once you are able to login to the target device you can mount it (make sure the device has been formatted) and use it as local storage device. This ends this short tutorial on the iSCSI protocol.
http://www.heath-bar.com/projects/blog/?p=203
http://www.heath-bar.com/projects/blog/?p=243
http://www.howtoforge.com/using-iscsi-on-ubuntu-10.04-initiator-and-target
iSCSI
Setting Up iSCSI on Linux
This article is a basic tutorial on how to setup the iSCSI protocol on a Linux machine. Before we get started make that your Linux machine is configured with the following items:
// Items are shown using make menuconfig
Device Drivers --->
SCSI device support --->
[*] SCSI device support
<*> SCSI disk support
SCSI Transports --->
{M} iSCSI Transports Attributes
[*] SCSI low-level drivers --->
<M> iSCSI Initiator over TCP/IP
Cryptographic options --->
[*] Cryptographic API
<*> CRC32c CRC algorithmThe iSCSI (internet Small Computer System Interface) protocol is a method for connecting to a storage device on a remote server by using an internet connection. ISCSI allows the client machine (known as the iSCSI Initiator) to see a storage device, i.e. a hard drive, on another machine (called the iSCSI Target) as a locally-attached device. In order to achieve this kind of connection, we need to set up both the target and the initiator separately.
Setting Up the Target
Note: You will need root privileges in order to execute some of the following commands.
The first step is to download the iSCSI Target package:
aptitude install iscsitarget iscsitarget-source iscsitarget-dkms
This command installs the iSCSI target from the source code, and also installs the iSCSI target module which is necessary to run the iSCSI service. If you get an error that says something like “FATAL: Module iscsi_trgt not found” make sure that the iscsi_trgt module is loaded.
Next, we need to the let the software know that this machine is an iSCSI target by simply editing the file at /etc/default/iscsitarget and setting the “ISCSITARGET_ENABLE” field from false to true:
ISCSITARGET_ENABLE=true
Next, we add the storage device path to the list of targets. For this, just open the configuration located at /etc/iet/ietd.conf and add the corresponding fields at the end of the file. This is an example:
Target iqn.2001-04.com.example:storage.lun #IncomingUser someuser secret #OutgoingUser Lun 0 Path=/dev/vg0/storage_lun1,Type=fileio #Alias LUN1 #MaxConnections 6
The word “Target” is a required key name. The string after that is the unique ID that the initiators will see when they connect to this target. The iSCSI standard suggests the format of an IQN or iSCSI Qualified Name. The format is basically iqn.yyyy-mm.<reversed domain name>:<identifier>;the yyyy-mm is the current year and the month; next is the domain name of the machine where the device is located; lastly, the identifier is the name which you choose for your device. The next two lines, the IncomingUser and OutgoingUser fields, are used for authentication purposes which are not used in this simple tutorial (the number sign means the fields are ignored). The next line specifies the target device. If this is the first target device just write Lun 0, to specify that this is the first target device in the list. Next, we specify the full path to the device, and the type which for hard drives is fileio. The last two lines are also optional.
Lastly, start the iSCSI service:
/etc/init.d/iscsitarget start
Setting Up the Initiator
Note: You must make sure that your machine is configured appropriately, or else the program will not install correctly.
Now we need to install the iSCSI initiator. Run this command on the client machine to install the program:
aptitude install open-iscsi
Once the program is installed, you can optionally configure it so that the initiator service starts automatically every time the machine is booted. To do this, just edit the file at /etc/iscsi/iscsid.conf, and uncomment the line that says “node.startup = automatic” and comment out the one that says manual:
node.startup = automatic [...] # node.startup = manual
Lastly, we turn on the initiator service:
/etc/init.d/open-iscsi restart
Setting Up a Connection
In order to connect to the device in the target machine, run the following commands in the initiator machine, where the last field is the IP address of the target machine:iscsiadm -m discovery -t st -p 192.168.0.101
This command basically asks the server to show what target devices are available. An example output would be:
192.168.0.101:3260,1 iqn.2001-04.com.example:storage.lun1
Lastly, we login to the device by running the following command:
iscsiadm -m node --targetname "iqn.2001-04.com.example:storage.lun1" -p "192.168.0.101:3260" --login
Once, you login to the device you will see a new device listed by running the following command:
fdisk -l
Once you are able to login to the target device you can mount it (make sure the device has been formatted) and use it as local storage device. This ends this short tutorial on the iSCSI protocol.
http://www.heath-bar.com/projects/blog/?p=203
http://www.heath-bar.com/projects/blog/?p=243
http://www.howtoforge.com/using-iscsi-on-ubuntu-10.04-initiator-and-target
Sidebar
News
- NSF Award on Cloud Resource Management
- vMoodle goes live
- DOD Award on Real-time Virtualization Research
- FAST2013 Presentations
- Fall 2012 Senior Project presentation
- Dr. Zhao Awarded Excellence in Student Mentoring
- ICAC2012 Presentation
- FeedbackComputing2012 Presentation
- Dm-cache in the Cloud (Call for beta testing)
- VISA undergraduates awarded a CREU grant
