Configuring Windows Server 2012 as an iSCSI Target SAN in a Two Host Failover Cluster Part 1

We’re currently working on virtualizing a large number of our servers and going through the process of deciding whether to deploy a 3rd party SAN or WS 2012 iSCSI Target in production.

In the meantime, I have gone ahead and deployed a basic iSCSI Target and Two host WS 2012 Failover cluster in the lab to properly test it’s resilience and ability to support our services in a production environment. I will not get into detailed configuration of the networking requirements of the Cluster at this time. I will share my practical experience with configuring the networking needs of the cluster in future posts.

The Windows Server 2012 IscsiTarget PowerShell module simplifies this implementation. The following screenshot shows all cmdlets available in this module:


1) The first step to building the iSCSI Target Server, involves installing the IscsiTarget role using the following PowerShell command:

Install-WindowsFeature -Name FS-iSCSITarget-Server (Installs a stand-alone iSCSI target feature)

2) The iSCSI virtual disk in the .vhd format will have to be created in this step:
New-IscsiVirtualDisk -Path g:\iscsivirtualdisks\Target00.vhd -Size 150GB (Creates the iSCSI virtual disk)

3) Create an iSCSI Target device on the server:
New-IscsiServerTarget -TargetName Target00 -InitiatorIds "","" -ComputerName labtarget -Verbose (Creates a new iSCSI Target, with two hosts specified by their iqn). You can get the iqn number of the hosts by running the following commands remotely:Enter-PSSession -ComputerName hyperv01
[hyperv01]: PS C:\Users\admin\Documents> Start-Service -Name msiscsi
[hyperv01]: PS C:\Users\admin\Documents> Set-Service -Name msiscsi -StartupType auto
[hyperv01]: PS C:\Users\admin\Documents> iscsicli
Microsoft iSCSI Initiator Version 6.2 Build 9200
[] Enter command or ^C to exit( The iscsicli command generates the long iqn number. Run the same commands on the second host.)

4) Map the iSCSI virtual disk to the new Target device:
Add-IscsiVirtualDiskTargetMapping -TargetName Target00 –Path g:\iscsivirtualdisks\Target00.vhd -ComputerName labtarget (Assign the virtual disk to the iSCSI Target)

These steps describe the process of creating the iSCSI Target device and mapping the device to a LUN or iSCSI virtual disk. In the next part of this series, we will look at configuring the iSCSI initiators on the host servers.

This entry was posted in Failover Cluster, Hyper-v, ISCSI, ISCSI Initiator, ISCSI Target, Microsoft Hyper-v, PowerShell, PowerShell 3.0, Windows Server 2012. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s