Showing posts with label iSCSI. Show all posts
Showing posts with label iSCSI. Show all posts

Friday, February 12, 2016

IET - iSCSI Enterprise target

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...




Wednesday, July 30, 2014

How to perform iBFT?


As discussed in previous post, We can perform iBFT in three ways. I will be explaining that in brief below.


iBFT though System ROM (Native iBFT):

Many servers supporting iBFT through system ROM. As per my knowledge most of the UEFI boot supported servers support iBFT through their ROM. In these servers iBFT is implemented in UEFI ROM. To perform this type of iBFT boot, all we need is a iBFT supported Server ROM and a network adapter. Normally UEFI Firmware will contain the required iBFT drivers.

Here is the way to perform iBFT in this method.

  1. Configure a server with a network adapter
  2. Enter System UEFI interface. Here, in Network settings you can find iSCSI configuration field.
  3. Select the iSCSI Configuration option and provide the Initiator and Target details.
  4. Now Reboot the system
  5. You will be able to see an iSCSI session is established in iSCSI Target.
  6. Enter UEFI Shell. If inbuilt system UEFI shell is not available, Copy required UEFI kernel files into a USB and boot from the UEFI kernel.
  7. In UEFI Shell, Enter the command “drivers –b” à It will list all the drivers loaded
  8. You can find “ISCSIDXE” driver file which is the inbox iBFT supported driver file.
  9. Now you can check all the iSCSI target and initiator details using the command “Map -r"
  10. You can see the iSCSI target details in the output.
  11. Now proceed to install OS and provide Network drivers if LUN not detected.
iBFT though Adapter's Firmware:
Many HBA adapters and CNA Adapters available now with Inbuilt iBFT support. To perform the iBFT using Adapters Firmware, we should be having the required drivers. We need to keep the Boot Mode as disabled and Personality should be NIC. Here are the simple steps to perform:


  1.  In UEFI supported system, Go to the Network settings in System BIOS settings and change the personality to “NIC” only.
  2.  Reboot the system
  3.  Enter system settings and select iSCSI configuration for particular adapter’s network settings.
  4. Provide all the required initiator and Target information to boot from iSCSI and save it.
  5. Enter UEFI Shell. If inbuilt system UEFI shell is not available, Copy required UEFI files into a USB and boot from the file.
  6. Select the boot from file in Boot options and provide the UEFI file “UEFIx64”
  7.  Take a USB and copy all required UEFI shell files and drivers to that and connect it to the server (Applicable to Network adapter supported iBFT)
  8.  Now Reboot the system.
  9. You will be able to see an iSCSI session is established in iSCSI Target.
  10. Enter UEFI Shell. If inbuilt system UEFI shell is not available, Copy required UEFI files into a USB and boot from the file.
  11. Select the boot from file in Boot options and provide the UEFI file “UEFIx64”
  12. It will load the UEFI shell
  13. Enter the command “drivers –b” à It will list all the drivers loadedYou can find “ISCSIDXE” driver file which is an inbox iBFT supported driver file.
  14. Now you can check all the iSCSI target and initiator details using the command “Map –r”
  15. You can see the below output if the LUN detected successfully.
  16. Select the boot from file and provide the UEFI file “UEFIx64”
  17. It will load the UEFI shell
  18. drivers -b à It will list all the drivers loaded
  19. unload XX <Where “XX” is handle for iscsidxe driver>
  20. And for loading go to directory where driver is, eg:- fs0: or fs1:
  21. Then “load <driver name>”
  22. Load iSCSIConfig first then DXEdisk driver. Once you load the drivers
  23. Don’t reboot the server because it will lose all the drivers you have loaded previously.
  24. Just try to boot from DVD from RBSU itself.