How to setup Ubuntu server 64 bit 11.10 as an ISCSI host/target

jerwal

Honorable
Jul 24, 2012
17
0
10,510
Hello all,

I was wondering if anyone know in a step by step how to setup Ubuntu server 64 bit 11.10 as an ISCSI host/target, I have been trying for the past couple days with no luck.

There is a great setup guide on youtube from timtanllc's channel (http://www.youtube.com/feed/UC7DMboGR-fBLzTVcy6GP_YA) for redhat, however at points redhat and Ubuntu differ greatly.

I also tried to follow these steps: (fails at step 2)

Follow the steps to configure iSCSI volume on ubuntu (i tried on 11.10):


1) You need to install open-iscsi package :

#sudo apt-get install open-iscsi

2) Now you need to run discovery agains t the iscsi host:



# iscsiadm -m discovery -t sendtargets -p <iscsi server ip address>

eg: If 192.168.11.110 is the ip address of iscsi server

# iscsiadm -m discovery -t sendtargets -p 192.168.1.110

OR

# iscsiadm --mode discovery --type sendtargets --portal 192.168.11.110

3) Note down the record id (such as iqn.xxxxxxxxxxxxx:test) found by the discovery. You need the
same for login. Login, must use a node record id found by the discovery:

# iscsiadm --mode node --targetname iqn.xxxxxxxxxxxxx:test --portal 192.168.11.110:3260 --login

4) Restart the service:

# /etc/init.d/open-iscsi restart

5) Now you should see an additional drive on the system such as /dev/sdd. Use /var/log/messages or
/var/log/syslog file to find out device name: (in my case /var/log/syslog):

# tail -f /var/log/syslog

6) If your device name is /dev/sdd, enter the following command to create a partition:

# fdisk /dev/sdd

Use the help in the fdisk menu to create a new partition.

7) format the partition:

# mkfs.ext3 /dev/sdd1

8) Mount the file system:

# mkdir iscsi
# mount /dev/sdd /iscsi

TBH really not sure what I am doing any help would be greatly appreciated please! Thanks in advance.

Kind regards,

Jerwal

P.S if there is any other information you need please let me know.
 
I'm not clear whether you are trying to configure an iSCSI target or an iSCSI initiator. The instructions that you have been following are for an initiator. This is the client software that connects to another device that is sharing some of its resources via iSCSI.

If you have an iSCSI device then this may be what you want. But if you are trying to share some part of the disk space on your server as an iSCSI disk visible to another computer then you need to set up an iSCSI target on your server. Have a look at: http://www.heath-bar.com/blog/?p=203 .

I know it's not relevant to you, but if anyone is trying to set up a computer as a NAS server / iSCSI target by far the easiest way is to use FreeNAS. This makes the configuration of the components very simple.
 

jerwal

Honorable
Jul 24, 2012
17
0
10,510
Hi Ijack,

Thank you for the quick reply, I wanted to use Ubuntu as a datastore for my two vmware esx 4.1 host. From what your saying I need to set it up as a iscsi target, sorry for not being clear.

My reasons for choosing ubuntu over freenas:
* not sure my raid card is compatiable with FreeBSD. (Adaptec 6805E)
* Really want to learn more about how do do stuff in linux.

Thank you for the guide it's greatly apprecaited, I will try it tonight.

Kind regards,

Jerwal
 
You definitely want a target, and I appreciate that FreeNAS doesn't fit your needs. Have a go at setting up a target and post back if you still have problems; I've never done this on Ubuntu, but I've set up iSCSI targets on FreeBSD without any great problem, so it can't be too different. I can always have a play with a Ubuntu machine if necessary.

Whatever your final client (initiatior) you use, probably the easiest one to test on is the Windows iSCSI initiator if you have a Windows machine. It is particularly easy to access iSCSI disks from Windows (and next to impossible from OS X, without spending large sums of money, unfortunately.).
 

jerwal

Honorable
Jul 24, 2012
17
0
10,510
Thank you once again for your help, however my short temper got the better of me and I installed windows server 2008 R2 with the ISCSI target software.

Kind regards,

Jerwal