Hi,
This post is a simple tutorial on how to use IET software target. IET stands for iSCSI Enterprise Target. There are few Software targets available for Linux operating system and IET is one of the best and easy to configure software target.
You can download the IET target from the Sourceforge.net. The installation is pretty easy. In this tutorial I am not covering installation process.
Checking iSCSI Target service:
Once you install the IET target software in your Linux System, you need to check the IET service status using the below command to confirm that target service is running.
service iscsi-target status
If the service is not running you can start the service using the below command.
service iscsi-target start
We can create and delete targets and LUNs through command line or by editing the configuration file /etc/iet/ietd.conf. I will cover the command line configuration in this tutorial. IETADM is the tool to configure IET target.
Creating a New Target:
We can create a new target using the below command.
ietadm --op new --tid=1 --params --name= iqn.2009-10.com.iet:target
In the above command, --op is the operation. We can mention different operations like new, delete and show.
--tid is the target ID. You can create multiple targets by providing different Target IDs with Unique Target IQN names for each target ID.
--params is the Parameters required to complete the command.
Once you create the target, you can check view the target details by the below command
cat /proc/net/iet/session
Deleting the existing Target:
To delete the existing target you can use the below command
ietadm --op delete --tid=1
You don't need to provide any parameters except Target ID to delete a target.
Creating a new LUN:
You can create a new LUN using the below command. I use dd command to create a LUN file in Linux. Make sure that you have enough space to create a Virtual LUN file in your Linux system. In this example I want to create the LUN file in /home directory.
dd if=/dev/zero of=/home/IET/target1/LUN0 bs=1G count=60
In the above example, bs stands for Block size and count is the multiplication of Block size to create the LUN with required size. So I will be creating 60 X 1G = 60G LUN. You can try Block size as 1k, 1m etc. It will take sometime based on the LUN size you have mentioned.
Now we have a LUN and Target created and we will see how to map the LUN to the target.
Mapping the LUN to Target:
You can map a LUN to the target using the below command.
ietadm --op new --tid=1 --lun=0 --params=path=/home/IET/target1/LUN0,Type=fileio
As per the above command, we are creating mapping a LUN as LUN id 0 with the LUN placed in /home/IET/target1 folder. Type is fileio as it needs to perform Input and Output operations.
To check LUNs mapped to targets, use the below command.
cat /proc/net/iet/volume
It will list the available targets and LUNs mapped to the particular targets.
Configuring CHAP:
CHAP provides security for the targets to be accessible by Initiators. CHAP is two types.
1. One way CHAP
2. mutual CHAP
Use the below command to configure One way CHAP
ietadm --op new --tid=1 --user --params=IncomingUser=incuser,password=xxxxxxxxxxxx
Use the below command to configure mutual CHAP
ietadm --op new --tid=1 --user --params=OutgoingUser=ouruser,password=xxxxxxxxxxxx
Once you configure the One way and mutual CHAP, use the below command to check
ietadm --op show --tid=1 --user
This is the tutorial on IET software target usage. Please leave a comment if you have any query on this post.
Thank you...
This post is a simple tutorial on how to use IET software target. IET stands for iSCSI Enterprise Target. There are few Software targets available for Linux operating system and IET is one of the best and easy to configure software target.
You can download the IET target from the Sourceforge.net. The installation is pretty easy. In this tutorial I am not covering installation process.
Checking iSCSI Target service:
Once you install the IET target software in your Linux System, you need to check the IET service status using the below command to confirm that target service is running.
service iscsi-target status
If the service is not running you can start the service using the below command.
service iscsi-target start
We can create and delete targets and LUNs through command line or by editing the configuration file /etc/iet/ietd.conf. I will cover the command line configuration in this tutorial. IETADM is the tool to configure IET target.
Creating a New Target:
We can create a new target using the below command.
ietadm --op new --tid=1 --params --name= iqn.2009-10.com.iet:target
In the above command, --op is the operation. We can mention different operations like new, delete and show.
--tid is the target ID. You can create multiple targets by providing different Target IDs with Unique Target IQN names for each target ID.
--params is the Parameters required to complete the command.
Once you create the target, you can check view the target details by the below command
cat /proc/net/iet/session
Deleting the existing Target:
To delete the existing target you can use the below command
ietadm --op delete --tid=1
You don't need to provide any parameters except Target ID to delete a target.
Creating a new LUN:
You can create a new LUN using the below command. I use dd command to create a LUN file in Linux. Make sure that you have enough space to create a Virtual LUN file in your Linux system. In this example I want to create the LUN file in /home directory.
dd if=/dev/zero of=/home/IET/target1/LUN0 bs=1G count=60
In the above example, bs stands for Block size and count is the multiplication of Block size to create the LUN with required size. So I will be creating 60 X 1G = 60G LUN. You can try Block size as 1k, 1m etc. It will take sometime based on the LUN size you have mentioned.
Now we have a LUN and Target created and we will see how to map the LUN to the target.
Mapping the LUN to Target:
You can map a LUN to the target using the below command.
ietadm --op new --tid=1 --lun=0 --params=path=/home/IET/target1/LUN0,Type=fileio
As per the above command, we are creating mapping a LUN as LUN id 0 with the LUN placed in /home/IET/target1 folder. Type is fileio as it needs to perform Input and Output operations.
To check LUNs mapped to targets, use the below command.
cat /proc/net/iet/volume
It will list the available targets and LUNs mapped to the particular targets.
Configuring CHAP:
CHAP provides security for the targets to be accessible by Initiators. CHAP is two types.
1. One way CHAP
2. mutual CHAP
Use the below command to configure One way CHAP
ietadm --op new --tid=1 --user --params=IncomingUser=incuser,password=xxxxxxxxxxxx
Use the below command to configure mutual CHAP
ietadm --op new --tid=1 --user --params=OutgoingUser=ouruser,password=xxxxxxxxxxxx
Once you configure the One way and mutual CHAP, use the below command to check
ietadm --op show --tid=1 --user
This is the tutorial on IET software target usage. Please leave a comment if you have any query on this post.
Thank you...
No comments:
Post a Comment