This topic includes sample Windows PowerShell cmdlets that you can use to automate some of the procedures described. For more information, see Using Cmdlets.

Prerequisites

Before you configure block storage, you need to set up two or more servers that are running Windows Server 2012.

Step 1: Install iSCSI Target Server and failover clustering

Install the required role service and features by using Windows PowerShell commands:

Start Windows PowerShell if it is not already open. From the Start menu, click Administrative Tools, and then click Windows PowerShell Modules. The Windows PowerShell Modules command-line console appears. The first time you open the tool and click ENTER, Windows PowerShell imports all the cmdlets.

Add the iSCSI Target Server role service by running the following command:

PS C:\> Add-WindowsFeature fs-iscsitarget-server

Verify that the iSCSI Target Server role service is installed by running the following command:

PS C:\> Get-WindowsFeature fs-iscsitarget-server

Note

"[X]" indicates that the role service is installed.

Install failover clustering by running the following command on the cluster node:

PS C:\> Add-WindowsFeature failover-clustering

Verify that the feature is installed on both nodes by running the following command:

PS C:\> Get-WindowsFeatures failover-clustering

Note

"[X]" indicates that the feature is installed.

Step 2: Configure the iSCSI initiator

On the computer that you set up as the iSCSI initiator, start the iSCSI Initiator Properties. From Server Manager, click the Tools menu, and then choose iSCSI Initiator.

Click the Targets tab, and then type the iSCSI target IP address.

Click Quick Connect, and then select the Connect button.

After a connection has been established, you can use Windows PowerShell cmdlets to bring the disks online.

Each time that you assign storage to the cluster nodes, by default, the disks are offline. You need to manually bring them online. To bring the disks online, leave the High Availability Wizard open (you will return to it shortly) and open the Disk Management tool.

In the Disk Management tool, right-click the disks to bring them online.

After bringing the disks online, you need to put them in the storage. Open the Failover Cluster Manager. From the Actions pane, click Storage, and then click Add Disk.

Return to the High Availability Wizard, select the check box for this storage volume, and then click Next. The Confirmation page appears.

Return to the Failover Cluster Manager and verify that the storage volume was created successfully.

Note

To manage iSCSI Target Server on a cluster, you need to use Server Manager or Windows PowerShell cmdlets.

Step 4: Configure iSCSI storage provider identity credentials

The iSCSI VDS and VSS storage providers must be configured to run under the administrative credentials of the iSCSI Target Server. You can configure these credentials by using Windows PowerShell or by using Component Services (DcomCnfg). For servers that are not part of a domain, create a local user account with the same user name and password for each server.

To use Component Services to configure credentials

In the left pane, click Computers, click My Computer, and then click DCOM Config..

Right-click WTVdsProv, click Properties, click the Identity tab, click This user, enter the user name and password for the iSCSI Target Server account, and then click OK.

Right-click WTSnapsthoProvider, click Properties, click the Identity tab, click This user, enter the user name and password of the iSCSI Target Server account, and then click OK.

Click Run, and then type regedit. In the left pane, click HKey_Local_Machine, click Software, click Microsoft, click Windows NT, click CurrentVersion, click WTVDSProv, and then click WtServers. . Right-click WtServers, point to New, click String Value, and then type the name of the iSCSI Target Server. (The Data value can remain blank.)