Here’s a quick walk-through to get you up and running with fibre channel in LIO.
1) Install LIO if not already installed
1 2 3 |
sudo apt-get install targetcli python-urwid |
2) Create the qla2xxx.conf file to configure fibre HBA to target mode
1 2 3 |
sudo nano /etc/modprobe.d/qla2xxx.conf |
(the x’s are a part of the file name and not just blanks for the actual model number)
3) Add the following line to the qla2xxx.conf file
1 2 3 |
options qla2xxx qlini_mode="disabled" |
4) Save the file and exit
5) Now we must update initramfs with the new changes
1 2 3 |
sudo update-initfamfs -u -k -all |
6) Restart the server to apply changes
1 2 3 |
sudo reboot |
7) Launch targetcli to configure LIO
1 2 3 |
sudo targetcli |
8) Add the LVM luns to Lio-Target (LVM luns are added to the iblock option under /backstores)
1 2 3 |
cd /backstores/iblock |
1 2 3 |
create name=Test_LUN dev=/dev/VG0/Test_LUN |
9) Now find the WWN(s) for the fibre card that is located in the server
1 2 3 |
/qla2xxx info |
10) Change to the qla2xxx directory
1 2 3 |
cd qla2xxx |
11) Now we need to add the WWN(s) from step 9 into targetcli (Do this step for each WWN that you wish to use)
1 2 3 |
create 21:xx:xx:xx:xx:xx:xx:xx |
(fill out the WWN from step 9)
12) Change to the WWN that you wish to add storage to
1 2 3 |
cd 21:xx:xx:xx:xx:xx:xx:xx/luns |
13) Add the storage from step 8 to the WWN that you just changed to.
1 2 3 |
create /backstore/iblock/Test_LUN |
14) Repeat steps 12 and 13 for each WWN and storage that you wish to use
15) Now change to the ACLS directory so we can add the ACL so the host can talk to the USAN
1 2 3 |
cd /qla2xxx/21:xx:xx:xx:xx:xx:xx:xx/acls |
16) Now create the ACL for the WWN of the host you are trying to present the LUN to
1 2 3 |
create 21:xx:xx:xx:xx:xx:xx:xx |
(This is the WWN on the host)
17) Review all the configuration changes that were just made
1 2 3 |
ls / |
18) Once all configuration changes have been verified, save the configuration
1 2 3 |
cd / |
1 2 3 |
saveconfig |