Configuring iSCSI Targets on Windows Server 2012 Failover Clusters

In Windows Server 2012, admins can configure iSCSI Targets using the Server and Failover Cluster Managers and PowerShell cmdlets. Here's how.

New with Windows Server 2012, the Microsoft iSCSI Target software now comes bundled with the operating system and...

is cluster aware. This allows you to serve local or shared storage in the form of virtual hard disks (VHDs) to clients across your network with your existing networking infrastructure. Using iSCSI Target can mean reduced data center costs.

This tip provides guidance with configuring iSCSI Targets in a Windows Server 2012 Failover Cluster environment by using the Server Manager, the Failover Cluster Manager and PowerShell cmdlets.

Steps to configure Cluster iSCSI Targets

Figure 1. Installing iSCSI Target Server role via Server Manager

The first step to configuring iSCSI Targets and associated virtual disk LUNs on Windows Server 2012 is to install the iSCSI Target Server role. This can be accomplished by using the Server Manager by pulling down the Manage menu and selecting Add Roles and Features. In the Roles selection dialog, expand File and Storage Services, then File and iSCSI Services, selecting iSCSI Target Server (figure 1). This needs to be done on each failover cluster server. The iSCSI Target Server role can also be installed by using this PowerShell cmdlet:

PS C:\> Install-WindowsFeature –name FS-iSCSITarget-Server

After you install the iSCSI Target Server role, you will see a new service running called the Microsoft iSCSI Software Target. You may also see a service called the Microsoft iSCSI Initiator Service, which starts the first time you use the iSCSI Initiator control panel applet on the client-side to connect to virtual iSCSI LUNs served by the iSCSI Target Server. In our configuration, the iSCSI Target Server will be a highly available virtual iSCSI Target Server running on a Windows Failover Cluster.

Figure 2. Adding iSCSI Target Server Role within the Failover Cluster Manager

The next step is to make the iSCSI Target software aware that it is being used in a failover cluster. To accomplish this, you can use the Server Manager's Tools pull-down menu to select the Failover Cluster Manager. A new failover cluster role can be created by right-clicking Roles in the left-hand pane and selecting "Configure Role..." (figure 2). This only needs to be done once on the cluster, unless you need to configure multiple iSCSI Target virtual servers with their own storage.

Figure 3. Specify virtual network name and storage for iSCSI Target Server

You then select the iSCSI Target Server role by providing the NetBIOS network name of the virtual iSCSI Target Server that clients will use (figure 3). Alternatively, you can use the PowerShell cmdlet Add-ClusteriSCSITargetServerRole specifying the iSCSI Target name and the associated storage disk:

PS C:\> Add-ClusteriSCSITargetServerRole –name ClusterTargets –Storage "Cluster Disk 4"

Figure 4. iSCSI Target Server role includes Network name resource and shared storage

The resulting cluster role can be viewed by selecting Roles in the left-hand pane, then selecting the new iSCSI Target Server role in the middle pane. This will display the details of the various cluster resources associated with the iSCSI Target Server role (figure 4).

The remainder of the configuration is performed in the Server Manager by expanding File and Storage Services in the left-hand navigation pane, then selecting iSCSI. The upper right-hand pane will reveal any virtual iSCSI disks that have been configured or allow you to create or import new ones. The lower right-hand pane allows you to create iSCSI Target names that can be associated with the virtual disks.

Figure 5. Using Server Manager to create a new iSCSI virtual disk

During the process of creating an iSCSI virtual disk (VHD file), you will be prompted for the disk location of the cluster iSCSI Target Server you just created (figure 5). You will then be prompted for the name of the virtual disk and the size. Next you will be prompted for the name of the iSCSI Target that you would like associated with the new virtual disk for discovery purposes on the client. Finally, you will be prompted to add the iSCSI initiators addresses (clients) that will be allowed to access the virtual disk.

Alternatively, there are a variety of iSCSI PowerShell cmdlets that can be used to create and map virtual hard disks. For example, the following cmdlets can be used to create a virtual hard disk and map it to a new iSCSI Target called Win2012Target and allow clients with IP addresses & access to the drive.

PS C:\> New-IscsiVirtualDisk –Path T:\Temp\test.vhd –Size 100MB
PS C:\> New-IscsiServerTarget -TargetName Win2012Target
      -ClusterGroupName ClusterTargets
      -ComputerName ClusterTargets.xyz.com
      -InitiatorId IPAddress:,IPAddress:
PS C:\> Add-iscsiVirtualDiskTargetMapping -targetName "Win2012Target"
      -DevicePath "T:\temp\test.vhd"

On the client side, all you need to do is to use the iSCSI Initiator applet in the control panel to connect to the DNS name or IP address of the iSCSI Target server you just created. Then use Disk Management to bring the iSCSI LUN online, initialize the drive, format it with NTFS and give it a drive letter. You will then be able to access the iSCSI drive as if it were another local disk on your computer.

About the Author
Bruce Mackenzie-Low is a master consultant at Hewlett-Packard providing third-level worldwide support on Microsoft Windows-based products, including clusters and crash dump analysis. With over 18 years of computing experience at Digital, Compaq and HP, he is a well-known resource for resolving highly complex problems involving clusters, SANs, networking and internals. He has taught extensively throughout his career, always leaving his audience energized with his enthusiasm for technology.

Dig Deeper on Microsoft Windows Server 2012