Articles
Server and Storage Administration
October 2011
by By Andrew Ness
If your server is running out of internal storage capacity, you can quickly allocate just the right amount of storage from resilient storage pools on the Sun ZFS Storage Appliance from Oracle. This article describes how to use Sun ZFS Storage Appliance iSCSI LUNs in a Microsoft Windows 2008 R2 environment. Windows Server 2008 R2 comes with a software iSCSI initiator package that can be configured to integrate iSCSI LUNs presented by the Sun ZFS Storage Appliance into the Windows environment.
|
This article first describes how to enable the Windows iSCSI initiator on a Windows Server 2008 R2 host. Then it describes how to configure an iSCSI LUN on the Sun ZFS Storage Appliance so the LUN can be accessed by the Windows host using the iSCSI protocol. Procedures are provided for configuring the LUN using either the appliance's browser user interface (BUI) or the appliance's command line interface (CLI). Finally, the article shows how to prepare the LUN for use by the Windows host.
The procedures in this article assume the following:
root password for the Sun ZFS Storage Appliance is known.
The first step is to enable the Microsoft iSCSI Initiator. By default, the Microsoft iSCSI Initiator is not enabled, so it is necessary to enable the initiator and gather the host iSCSI details.

Figure 1. Control Panel Icons

Figure 2. iSCSI Initiator Icon
If the iSCSI initiator has not been previously enabled, the warning shown in Figure 3 is displayed.

Figure 3. iSCSI Service Warning
The iSCSI Initiator Properties dialog box opens, as shown as in Figure 4.

Figure 4. iSCSI Initiator Properties Dialog Box

Figure 5. iSCSI Initiator Properties Dialog Box Showing the IQN
Note: It is possible to change the IQN (shown here as the Initiator Name). However, changing the IQN is not advisable under normal circumstances.
The iSCSI Initiator Mutual CHAP Secret prompt is displayed, as shown in Figure 6.

Figure 6. iSCSI Initiator Mutual CHAP Secret Prompt

Figure 7. Warning Message for Short CHAP Secret
As a unified storage platform, the Sun ZFS Storage Appliance supports access to block-protocol LUNs using iSCSI and Fibre Channel protocols. This section describes how to use the Sun ZFS Storage Appliance BUI to configure the Sun ZFS Storage Appliance to recognize the Windows Server 2008 R2 host and present iSCSI LUNs to it.
To open the Sun ZFS Storage Appliance BUI, do the following:
https://<appliance IP address or host name>:215
The login dialog shown in Figure 8 is displayed.

Figure 8. Sun ZFS Storage Appliance Login
To identify the Windows Server 2008 R2 host to the Sun ZFS Storage Appliance, an iSCSI target group must be created and iSCSI initiator and initiator groups must be defined. These steps are described in the following sections.
A target group is created on the Sun ZFS Storage Appliance to define the ports and the protocol by which the LUN to be presented to the Windows Server 2008 R2 host is accessed. For this example, an iSCSI target group is created that contains the LUN as an iSCSI target that is identified by the default IQN for the Sun ZFS Storage Appliance and presented over default appliance interfaces. Since CHAP will be used for authentication between the storage and the host, CHAP parameters are also specified in this example.
To define an iSCSI target group on the Sun ZFS Storage Appliance, complete these steps:

Figure 9. iSCSI Target Configuration Tab in Sun ZFS Storage Appliance
chapuser and CHAPsecret22 are used. 
Figure 10. New iSCSI Target Dialog Box

Figure 11. Move Icon Displayed to the Left of the Selected iSCSI Target

Figure 12. Creating the iSCSI Target Group
targets-n, where n is an integer (shown in Figure 13).

Figure 13. Selecting the Target Group for Editing
iscsi-TG is used. 
Figure 14. Renaming the iSCSI Target Group

Figure 15. New iSCSI Target Group with Changes Applied
An iSCSI initiator is defined to allow access from one or more servers to particular volumes. Access to volumes should be configured so that a minimum number of iSCSI initiators are allowed to access a particular volume. If more than one host can write to a given volume concurrently and a non-shared file system is used, inconsistencies might occur in file system caches on the hosts, which can ultimately lead to corruption of the on-disk image. Typically, a single initiator is given access to a volume, unless a specialized cluster file system is being used.
The iSCSI initiator defines the "host" from the point of view of the Sun ZFS Storage Appliance. The iSCSI initiator definition contains the host IQN. To identify the Windows server to the Sun ZFS Storage Appliance, the Windows Server 2008 R2 iSCSI initiator IQN must be registered with the appliance by completing the following steps:

Figure 16. Selecting the SAN Configuration

Figure 17. New iSCSI Initiator Definition
Related iSCSI initiators can be combined into logical groups to allow single commands to be executed on multiple iSCSI initiators, for example, assigning LUN access to all iSCSI initiators in a group by using one command. For this example, the iSCSI initiator group contains one initiator, but in a cluster, where multiple servers are treated as a single logical entity, the initiator group may contain multiple initiators.
To create an iSCSI initiator group, complete these steps:

Figure 18. Displaying the Move Icon for a New iSCSI Initiator

Figure 19. Creating the iSCSI Initiator Group
initiators-n, where n is an integer, as shown in Figure 20.

Figure 20. Selecting the iSCSI Initiator Group
win2k8-servers is used. 
Figure 21. Renaming the iSCSI Initiators Group

Figure 22. iSCSI Initiator Configuration Completed
A project can be defined in the Sun ZFS Storage Appliance to group related volumes. A project allows inheritance of properties for file systems and LUNs presented from the project and also allows quotas and reservations to be applied.
To create a project, complete the following steps:

Figure 23. Viewing a Project

Figure 24. Create Project Dialog Box

Figure 25. Displaying the New w2k8-project Project
A LUN must now be created from an existing pool of storage resources, which the Windows Server 2008 R2 host will access. For this example, a thin-provisioned 64 GB LUN called DocArchive1 is created.
The target group will be the iSCSI target group created in the Defining an iSCSI Target Group section to ensure that this LUN can be accessed using iSCSI protocol. The initiator group defined in the Defining the iSCSI Initiator Group section will be used to ensure that only the server(s) defined in the win2k8-servers group can access this LUN (in this example, this group contains only one server).
To create a target group, complete the following steps:

Figure 26. Selecting Shares > Project > LUNs
DocArchive1, set the Volume size field to 64 GB, and select the Thin provisioned check box. Set the Target Group to the iSCSI target group iscsi-TG and the Initiator Group to win2k8-servers. Set the Volume block size to 32K because the volume will hold a ZFS file system. 
Figure 27. Create LUN Dialog Box
As a unified storage platform, the Sun ZFS Storage Appliance supports access to block-protocol LUNs using iSCSI and Fibre Channel protocols. This section describes how to use the Sun ZFS Storage Appliance CLI to configure the appliance to recognize the Windows Server 2008 R2 host and present iSCSI LUNs to it.
The CLI must be accessed using an SSH-enabled terminal session. On a host that has an SSH client available, enter the following:
user@host> ssh root@<appliance IP address or host name> login as: root Using keyboard-interactive authentication. Password: XXXXX Last login: Mon Jul XX XX:XX:XX XXXX from desktop zfssa:>
Navigation follows a similar pattern in the CLI as in the BUI with paths used in commands often corresponding to paths through tabs and screens in the BUI.
In the example in Listing 1, a target group is defined on the Sun ZFS Storage Appliance to specify which ports and protocols will be used to access the LUN. The LUN can be assigned to a particular target group when it is created, or it can be added later by editing the target group. In the example below, an iSCSI target group consisting of a single iSCSI target is defined, using a default IQN, to allow a LUN to be presented through the appliance's default ports using iSCSI protocol.
Since CHAP will be used for authentication between the storage and the host, CHAP parameters are also specified in this example.
Listing 1: Defining an iSCSI Target Group
zfssa:>
configuration san targets
zfssa:configuration san targets>
iscsi
zfssa:configuration san targets iscsi>
create
zfssa:configuration san targets iscsi target (uncommitted)>
set alias=iscsi-Target
alias = iscsi-Target (uncommitted)
zfssa:configuration san targets iscsi target (uncommitted)>
commit
zfssa:configuration san targets iscsi>
list
TARGET ALIAS
target-000 iscsi-Target
|
+-> IQN
iqn.1986-03.com.sun:02:e8589be5-144d-c9b2-89d4-f7fe4e887881
zfssa:configuration san targets iscsi>
select target-000
zfssa:configuration san targets iscsi target-000>
list
Properties:
alias = iscsi-Target
iqn = iqn.1986-03.com.sun:02:e8589be5-144d-c9b2-89d4-f7fe4e887881
auth = none
targetchapuser = (unset)
targetchapsecret = (unset)
interfaces = nge0
zfssa:configuration san targets iscsi target-000>
set targetchapuser=
iqn.1986-03.com.sun:02:e8589be5-144d-c9b2-89d4-f7fe4e887881
targetchapuser = iqn.1986-03.com.sun:02:e8589be5-144d-c9b2-89d4-f7fe4e887881 (uncommitted)
zfssa:configuration san targets iscsi target-000>
set targetchapsecret=CHAPsecret11
targetchapsecret = ************ (uncommitted)
zfssa:configuration san targets iscsi target-000>
commit
zfssa:configuration san targets iscsi target-000>
list
Properties:
alias =
iqn =
auth =
targetchapuser = iqn.1986-03.com.sun:02:e8589be5-144d-c9b2-89d4-f7fe4e887881
targetchapsecret = ************
interfaces =
zfssa:configuration san targets iscsi target-000>
cd ..
zfssa:configuration san targets iscsi>
list
TARGET ALIAS
target-000 iscsi-Target
|
+-> IQN
iqn.1986-03.com.sun:02:e8589be5-144d-c9b2-89d4-f7fe4e887881
zfssa:configuration san targets iscsi>
group
zfssa:configuration san targets iscsi groups>
create
zfssa:configuration san targets iscsi group (uncommitted)>
set name=iscsi-TG
name = iscsi-TG (uncommitted)
zfssa:configuration san targets iscsi group (uncommitted)>
set targets=iqn.1986-03.com.sun:02:e8589be5-144d-c9b2-89d4-f7fe4e887881
targets = iqn.1986-03.com.sun:02:e8589be5-144d-c9b2-89d4-f7fe4e887881 (uncommitted)
zfssa:configuration san targets iscsi group (uncommitted)>
commit
zfssa:configuration san targets iscsi groups>
list
GROUP NAME
group-000 iscsi-TG
|
+-> TARGETS
iqn.1986-03.com.sun:02:e8589be5-144d-c9b2-89d4-f7fe4e887881
zfssa:configuration san targets iscsi groups>
cd /
zfssa:>
An iSCSI initiator is defined to restrict which servers have access to a particular volume. If more than one host can write to a given volume concurrently, inconsistency in file system caching between hosts can cause corruption in the on-disk image. Typically, a single initiator is given access to a volume, unless a specialized cluster file system is being used.
The iSCSI initiator is the "host," as defined from the point of view of the Sun ZFS Storage Appliance. To define the Windows Server 2008 R2 host as an iSCSI initiator with an alias win2k8r2, the iSCSI IQN for the Windows host must be registered with the appliance, as shown in the example in Listing 2.
zfssa:>
configuration san initiators
zfssa:configuration san initiators>
iscsi
zfssa:configuration san initiators iscsi>
ls
Children:
groups => Manage groups
zfssa:configuration san initiators iscsi>
create
zfssa:configuration san initiators iscsi initiator (uncommitted)>
set alias=win2k8r2
alias = win2k8r2 (uncommitted)
zfssa:configuration san initiators iscsi initiator (uncommitted)>
set initiator= iqn.1991-05.com.microsoft:win2k8r2
initiator = iqn.1991-05.com.microsoft:win2k8r2 (uncommitted)
zfssa:configuration san initiators iscsi initiator (uncommitted)>
set chapuser= iqn.1991-05.com.microsoft:win2k8r2
chapuser = iqn.1991-05.com.microsoft:win2k8r2 (uncommitted)
zfssa:configuration san initiators iscsi initiator (uncommitted)>
set chapsecret=CHAPsecret11
chapsecret = ************ (uncommitted)
zfssa:configuration san initiators iscsi initiator (uncommitted)>
commit
zfssa:configuration san initiators iscsi> ls
Initiators:
NAME ALIAS
initiator-000 win2k8r2
|
+-> INITIATOR
iqn.1991-05.com.microsoft:win2k8r2
Children:
groups => Manage groups
zfssa:configuration san initiators iscsi>
Related iSCSI initiators can be combined into logical groups to allow single commands to be executed on multiple iSCSI initiators, for example, assigning LUN access to all iSCSI initiators in a group by using one command. In the example in Listing 3, the iSCSI initiator group contains one initiator. However, in a cluster, where multiple servers are treated as a single logical entity, the initiator group may contain multiple initiators.
Listing 3: Defining an iSCSI Initiator Group
zfssa:configuration san initiators iscsi>
groups
zfssa:configuration san initiators iscsi groups>
create
zfssa:configuration san initiators iscsi group (uncommitted)>
set name=win2k8-servers
name = win2k8-servers (uncommitted)
zfssa:configuration san initiators iscsi group (uncommitted)>
set initiators= iqn.1991-05.com.microsoft:win2k8r2
initiators = iqn.1991-05.com.microsoft:win2k8r2 (uncommitted)
zfssa:configuration san initiators iscsi group (uncommitted)>
commit
zfssa:configuration san initiators iscsi groups >
ls
Groups:
GROUP NAME
group-000 win2k8-servers
|
+-> INITIATORS
iqn.1991-05.com.microsoft:win2k8r2
zfssa:configuration san initiators iscsi groups>
cd /
zfssa:>
A project can be defined in the Sun ZFS Storage Appliance to group related volumes. A project allows inheritance of properties for file systems and LUNs presented from the project and also allows quotas and reservations to be applied.
Define a project as shown in the example below:
zfssa:> shares zfssa:shares> project w2k8-project zfssa:shares w2k8-project (uncommitted)> commit zfssa:shares> cd / zfssa:>
A LUN, which the Windows Server 2008 R2 host will access, must now be created from an existing pool of storage resources. In the example in Listing 4, a thin-provisioned 64 GB LUN called DocArchive1 is created. The LUN is set up for a ZFS file system.
The target group is the iSCSI target group created in the Defining the iSCSI Target Group section to ensure that this LUN can be accessed using iSCSI protocol. The initiator group defined in the Defining the iSCSI Initiator Group section is used to ensure that only the server(s) defined in the win2k8-servers group can access this LUN (in this example, this group contains only one server).
zfssa:shares> select w2k8-project
zfssa:shares w2k8-project> lun DocArchive1
zfssa:shares w2k8-project/DocArchive1 (uncommitted)> set volsize=64G
volsize = 64G (uncommitted)
zfssa:shares w2k8-project/DocArchive1 (uncommitted)>
set targetgroup=iscsi-TG
targetgroup = iscsi-TG (uncommitted)
zfssa:shares w2k8-project/DocArchive1 (uncommitted)>
set initiatorgroup=win2k8-servers
initiatorgroup = win2k8-servers (uncommitted)
zfssa:shares w2k8-project/DocArchive1 (uncommitted)> list
Properties:
checksum = fletcher4 (inherited)
compression = off (inherited)
dedup = false (inherited)
copies = 1 (inherited)
logbias = latency (inherited)
secondarycache = all (inherited)
volblocksize = 8K (default)
volsize = 64G (uncommitted)
sparse = false (default)
exported = true (inherited)
targetgroup = iscsi-TG (uncommitted)
initiatorgroup = win2k8-servers (uncommitted)
lunumber = (default)
assignednumber = (default)
status = (default)
fixednumber = (default)
lunguid = (default)
canonical_name = (default)
nodestroy = (default)
Children:
snapshots => Manage snapshots
replication => Manage remote replication
zfssa:shares w2k8-project/DocArchive1 (uncommitted)>
set volblocksize=32k
volblocksize = 32K (uncommitted)
zfssa:shares w2k8-project/DocArchive1 (uncommitted)> commit
zfssa:shares w2k8-project> cd /
zfssa:shares>
Once the iSCSI LUN has been prepared, the Windows Server 2008 R2 environment must be configured to access the allocated storage, as described in the following steps:

Figure 28. iSCSI Initiator Discover Target Portal Dialog Box
The Target portals box now contains the newly added target, as shown in Figure 29.

Figure 29. Newly Added iSCSI Target

Figure 30. IQN of the New Target

Figure 31. Connect to Target Dialog Box

Figure 32. Specifying the CHAP Details
If the connection is successful, an entry appears in the Discovered Targets box showing the IQN of the Sun ZFS Storage Appliance with a Connected status, as shown in Figure 33. Click OK to continue.
If an Authentication Failure warning is displayed, check that the same CHAP password (CHAP target secret) is used in each of the following places (you may need to re-enter hidden passwords to ensure consistency):

Figure 33. Successful Connection

Figure 34. Selecting the Management Utility for the Computer
Note: If you're absolutely sure that this is the correct disk to be initialized, you can click OK and skip steps 13 through 15.

Figure 35. Initialize Disk Dialog Box
Not Initialized.
Figure 36. Initializing the Disk
When the disk is finished initializing, the status of the disk in the Disk Management dialog box will change from Not Initialized to Online.
The New Simple Volume Wizard is displayed, as shown in Figure 37.

Figure 37. Wizard for Creating a New Simple Volume
The Specify Volume Size dialog box appears, as shown in Figure 38. This dialog box allows you to create a partition on the unallocated space.

Figure 38. Selecting the Size of the Partition
The Assign Letter Drive or Path dialog box is displayed, as shown in Figure 39. Options offered are to assign a drive letter to the new "disk," mount the new disk as an NTFS subfolder (which must be empty), or create the volume without assigning a drive or mounting the disk.

Figure 39. Assigning a Drive Letter

Figure 40. Formatting the Volume
A summary of the selected options is displayed, as shown in Figure 41.

Figure 41. Summary of Selected Options
On the Disk Management screen, the volume status is shown as Formatting until the formatting process is complete, as shown in Figure 42.

Figure 42. Disk Formatting
The status then changes to Healthy, as shown in Figure 43.

Figure 43. Formatting Complete
The new iSCSI LUN is now available for use, as shown in Figure 44.

Figure 44. iSCSI LUN Now Available
This article described how to configure the software iSCSI initiator package supplied with Microsoft Windows Server 2008 R2 to enable a Windows server to access iSCSI LUNs presented by Oracle's Sun ZFS Storage Appliance.
| Revision 1.0, 10/26/2011 |