How to create and use the iSCSI target service on the QNAP NAS

"Quick, efficient and cheap method of implementing network storage solutions"

Contents

What is iSCSI and how can one benefits from it?

Microsoft Active DirectoryiSCSI, (Internet Small Computer System Interface), an Internet Protocol (IP)-based storage networking standard for linking data storage facilities. By carrying SCSI commands over IP networks, iSCSI is used to facilitate data transfers over intranets and to manage storage over long distances. iSCSI can be used to transmit data over local area networks (LANs), wide area networks (WANs), or the Internet and can enable location-independent data storage and retrieval. (quoted from Wikipedia)

An all-in-one storage solution with high ability of expansion and low establishment cost is alway seeked by most SMB storage infrastructure planners who have budget concerns and overall ease of delpoyment. With the iSCSI service on QNAP Turbo NAS it can instantly be served as your storage expansion or backup destination of the application servers, such as database server, mail server, or Time Machine (for Mac OS X 10.5 or later) in the business environment. This article demonstrates how you can use the iSCSI target service on QNAP NAS for storage expansion on different operating systems. See below for the usage scenario.

iSCSI target usage scenario

Things to know before we start

In between the relationship of your computer and the storage device, your computer is called an 'initiator' because it initiates the connection to the device, which is called a 'target'.

Note: It is NOT suggested to connect to the same iSCSI target with two different clients (iSCSI Initiators) at the same time, because this may lead to data crash or disk damage.

To begin, simply follow through the step-by-step guide below.

Create an iSCSI target volume

Log in to your QNAP NAS, go to 'Disk Management' > 'iSCSI' > 'iSCSI TARGET LIST' > 'Create New iSCSI Target' to create a new iSCSI target.

Start the iSCSI target creation wizard

Refer to the image below to enter the required information to create the iSCSI target.

Enter the information to create the iSCSI target

*Allocating the disk space ensures that an iSCSI Target has enough disk space as specified. However, the disk will take longer to create (depends on the given size) and there must be enough space on the physical disk.

Upon the successfull creation the iSCSI target will be shown on the iSCSI Target page and with status showing 'Ready'.

iSCSI target created successfully

Advantages of Thin Provisioning on QNAP NAS
With thin provisioning, the system administrator can flexibly allocate the disk space (on iSCSI Target) to the server applications to expand the storage capacity anytime regardless of their current storage size. The adding of the storage space on the servers can be easily done on different operation systems by the iSCSI initiator. Thin provisioning allows efficient storage management since the system administrator has to monitor only the storage capacity of one single server (QNAP NAS) rather than extra hard drives or tapes on other sub-storage systems. Over-allocation is allowed since the storage capacity of the NAS can be expanded by Online RAID Capacity Expansion

To connect to the iSCSI target we've just created select the tab representing the operating system you use to proceed.

Connect to the iSCSI targets by Microsoft iSCSI initiator on Windows

This article shows you how to use the iSCSI initiator on Windows to add the iSCSI target (QNAP NAS) as an extra partition. Before you start to use the iSCSI target service, make sure you have created an iSCSI target on the NAS in ‘Device Configuration' > ‘iSCSI Target' and installed the correct iSCSI initiator for your OS.

iSCSI Initiator on Windows

The Microsoft iSCSI Software Initiator v2.07 is an official application for Windows OS 2003, XP, and 2000 to allow users to implement an external iSCSI storage array over the network. If you are using Windows Vista or Windows Server 2008, the Microsoft iSCSI Software Initiator is included. For more information and the download location, please visit:
http://www.microsoft.com/downloads/details.aspx?familyid=12cb3c1a-15d6-4585-b385-befd1319f825&displaylang=en

Start iSCSI initiator from 'Control Panel' > 'Administrative Tools'. Under the 'Discovery' tab click on 'Add Portal'. Enter the NAS IP and the port number for the iSCSI service.

Enter the IP address of the NAS to start the discovery

The available iSCSI targets and their status will then be shown under the 'Targets' tab. Select the target you wish to connect then click on 'Log on'.

Enter the IP address of the NAS to start the discovery

You may click on 'Advanced' to specify the logon information if you have configured the authentication otherwise simply click on 'OK' to continue.

Confirm to log on to the chosen target

Upon successful logon, the status of the target now shows "Connected".

The status of the target now shows 'Connected'

After the target has been connected Windows will detect its presense and treat it as if there was a new hard drive has been added which needs to be initialized and formated before we can use it. Right-click on 'My Computer' > 'Manage' to open the 'Computer Management' window then go to "Disk Management" and a window should pop-up automatically asking whether you wanna initialize the newly found hard drive. Click on OK then format this drive as normally you would when adding a new disk.

The status of the target now shows 'Connected'

That's it! After disk initialization & formatting, the new drive is attached to your PC. You can now use this iSCSI target as a regular disk partition.

Connect to the iSCSI targets by Xtend SAN iSCSI initiator on Mac OS

Since GlobalSAN iSCSI initiator was reported to have stability concern when dealing with heavy load, we have selected to use Xtend SAN iSCSI Initiator as an example in this application notes. If you would like to read the instructions about using GlobalSAN iSCSI initiator with QNAP NAS, please click here.

About Xtend SAN iSCSI Initiator

ATTO's Xtend SAN iSCSI Initiator for Mac OS X allows Mac users to utilize and benefit from iSCSI. It is compatible with Mac® OS X 10.4.x to 10.6.x. For more information, please visit: http://www.attotech.com/products/product.php?sku=INIT-MAC0-001

After installing Xtend SAN iSCSI Initiator, you can find it in "Applications".

Click the "Discover Targets" tab, you can either choose "Discover by DNS/IP" or "Discover by iSNS" according to the network topology. In this example, we will use the IP address to discover the iSCSI targets.

Follow the screen instructions and enter the server address, iSCSI target port number (default: 3260), and CHAP information (if applicable). Click "Finish" to retrieve the target list after all the data have been entered correctly.

All the available iSCSI targets on the NAS server will be shown. Select the target you would like to connect and click "Add".

You can configure the connection properties of the selected iSCSI target in the "Setup" tab.

Click the "Status" tab, select the target to connect. Then click "Login" to proceed.

Connect to the iSCSI targets by Open-iSCSI Initiator on Ubuntu Linux

This article shows you how to use Linux Open-iSCSI Initiator on Ubuntu to add the iSCSI target (QNAP NAS) as an extra partition. Before you start to use the iSCSI target service, make sure you have created an iSCSI target on the NAS in ‘Device Configuration’ > ‘iSCSI Target’ and installed the correct iSCSI initiator for your OS.

About Linux Open-iSCSI Initiator

The Linux Open-iSCSI Initiator is a built-in package in Ubuntu 8.04 LTS (or later). You can connect to an iSCSI volume at a shell prompt with just a few commands. More information about Ubuntu is available at http://www.ubuntu.com/ and for information and download location of Open-iSCSI, please visit: http://www.open-iscsi.org/

Before you start

Install the open-iscsi package. The package is also known as the Linux Open-iSCSI Initiator.

# sudo apt-get install open-iscsi

Now follow the steps below to connect to an iSCSI target (QNAP NAS) with Linux Open-iSCSI Initiator.
You may need to modify the iscsid.conf for CHAP logon information, such as node.session.auth.username & node.session.auth.password.

# vi /etc/iscsi/iscsid.conf

Save and close the file, then restart the open-iscsi service.

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

Discover the iSCSI targets on a specific host (the QNAP NAS in this example), e.g. 10.8.12.31 with default port 3260.

# iscsiadm -m discovery -t sendtargets -p 10.8.12.31:3260

Check the available iSCSI node(s) to connect.

# iscsiadm -m node

** You can delete the node(s) you don’t want to connect to when the service is on with the following command:

# iscsiadm -m node --op delete --targetname THE_TARGET_IQN

Restart open-iscsi to login all the available nodes.

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

You should be able to see the login message as below: Login session [iface: default, target: iqn.2004-04.com:NAS:iSCSI.ForUbuntu.B9281B, portal: 10.8.12.31,3260] [ OK ]
Check the device status with dmesg.

# dmesg | tail

Enter the following command to create a partition, /dev/sdb is the device name.

# fdisk /dev/sdb

Format the partition.

# mkfs.ext3 /dev/sdb1

Mount the file system.

# mkdir /mnt/iscsi

# mount /dev/sdb1 /mnt/iscsi/

That’s it! You can test the I/O speed using the following command.

# hdparm -tT /dev/sdb1

Below are some “iscsiadm” related commands.
Discover the Targets on the host:

# iscsiadm -m discovery --type sendtargets --portal HOST_IP

Login to a Target:

# iscsiadm –m node --targetname THE_TARGET_IQN --login

Logout from a Target:

# iscsiadm –m node --targetname THE_TARGET_IQN --logout

Delete a Target:

# iscsiadm –m node --op delete --targetname THE_TARGET_IQN