Semaphor blog
Blog: Semaphor

Increase your virtualization storage with iSCSI

We strive to have multiple points of backup of our own and our customers data.
Therefore we have both backup of the individual VM's as well as the raw data on their disks.
ESXi supports both NFS and iSCSI, and while NFS is a bit easier to set up, the performance is way to slow to use in production.
So here we will give you some tips on how to set up an iSCSI storage solution in your environment.

In this guide we assume that you already have a linux (Debian) server set up.
First install the iSCSI target server on your linux SAN/Backup server. We use debian based servers:

 apt-get install iscsitarget iscsitarget-dkms open-iscsi 

You can ommit the open-iscsi as it is a utill you can use to discover if your iSCSI target is set up right.

As target, iSCSI can use both a file, and a whole drive.
As we want to provision slices of storage to a given server, we will be using files.
You make the file with the dd command. For example if you want a 30GB large storage file in the /data dir the command looks like:

 dd if=/dev/zero of=/data/server1lun1.img bs=1M count=30K

You can make any name and extension, but conversion advice you to make it a *.img file

Now we need to make the image vissible to the server that will use it:

nano /etc/iet/ietd.conf

Go down to the buttom and paste the following (with your own LUN ID)

Lun 0 Path=/try/lun4.img,Type=fileio
Alias LUN1
#MaxConnections 6

#Or if it is a whole disk, then:

Lun 0 Path=/dev/sdb,Type=blockio
Alias LUN1
#MaxConnections 6

Target must be unique and conform to the following standard
iqn.yyyy-mm.<reversed domain name>[:identifier]

Incomming and outgoing user can be set up to make authentication, but we would rather restrict on the IP adresses of our servers.

After that, we need to enable the target service:
nano /etc/default/iscsitarget

but setting it from false to true.

Next, start the service:

/etc/init.d/iscsitarget start

Now before you go to ESXI, try to see if you can see the target by calling the following on another machine on the network:

sudo iscsiadm -m discovery -t st -p [IP]

Where the IP is the ip to your iSCSI target(server).

sofus@sofus-ThinkCentre-M91p:~$ sudo iscsiadm -m discovery -t st -p,1,1

Now go in to esxi and configure a new storage iSCSI adapter, and connect to the LUN you just created.

The ESXI will partition and format the file to it's needs.

Good luck:)

07-09-2013 15:35


Add comment

It may take a moment until your comment is published.