iSCSI Target Block Storage, How To
Published: February 29, 2012
Updated: February 29, 2012
Applies To: Windows Server 2012
With iSCSI Target Server, any Windows Server 2012 computer can become a storage device.
-
Prerequisites
-
Step 1: Install iSCSI Target Server and failover clustering
-
Step 2: Configure the iSCSI initiator
-
Step 3: Create the high availability iSCSI Target Server role service
-
Step 4: Configure iSCSI storage provider identity credentials
Note |
|---|
| This topic includes sample Windows PowerShell cmdlets that you can use to automate some of the procedures described. For more information, see How to Run a Windows PowerShell Cmdlet. |
Using Windows PowerShell commands, install the required role service and features:
-
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 typing the following command:
PS C:\> Add-WindowsFeature fs-iscsitarget-server
-
Verify that the iSCSI Target Server role service is installed by typing the following command:
"[X]" indicates that the role service is installed.PS C:\> Get-WindowsFeature fs-iscsitarget-server
-
Install failover clustering by typing the following on the cluster node:
PS C:\> Add-WindowsFeature failover-clustering
-
Verify that the feature is installed on both nodes by typing the following command:
"[X]" indicates that the feature is installed.PS C:\> Get-WindowsFeatures failover-clustering
-
On the iSCSI initiator computer, start the iSCSI Initiator Properties applet. From Server Manager, click the Tools menu, and then choose iSCSI Initiator.
-
Click the Targets tab, and type the iSCSI target IP address. Choose Quick Connect.
-
Choose the Connect button.
Once a connection has been established, you can use Windows PowerShell cmdlets to bring the disks online.
To use PowerShell cmdlets to bring the disks online:
-
From Windows PowerShell, type:
New-IscsiTargetPortal –TargetPortalAddress <IP_address> $t = Get-IscsiDiscoveredTarget Connect-IscsiDiscoveredTarget –NodeAddress $t.NodeAddress Get-IscsiPersistentTarget
Note If there is no record returned, you can register the iSCSI target by typing: Register-IscsiPersistentTarget –TargetName $t.NodeAddress
-
Bring the disk online and create a volume on it:
Get-disk
Note |
|---|
| To manage iSCSI Target Server on a cluster, you will need to use Server Manager or Windows PowerShell cmdlets. |
To create the iSCSI Target Server role service on a cluster to ensure transparent failover, follow these steps:
-
Open Failover Cluster Manager.
-
Right-click Roles and then choose Configure Role. The High Availability wizard, Select Service or Application page appears.
-
Select iSCSI Target Server. The Client Access Point page appears.
-
Type the service or application name and the IP address for the iSCSI Target Server high availability instance.
-
Select the Networks Address checkbox, and then choose Next. The Select Storage page appears.
Note Each time, you assign storage to the cluster nodes, by default, the disk will be offline. You will need to manually bring it online. To bring the disk online, leave the High Availability wizard open (you will return to it shortly) and open the Disk Management tool. -
Right click the disks and 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, select Storage, and then select Add Disk.
-
Return to the High Availability Wizard, and select the checkbox for this storage volume. Choose Next. The Confirmation page appears.
-
Return to the Failover Cluster Manager tool and verify that the storage volume was created successfully.
Note |
|---|
| To manage iSCSI Target Server on a cluster, you will need to use Server Manager or Windows PowerShell cmdlets. |
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 using either 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 username and password for each server.
To use Windows PowerShell to configure credentials
From Windows PowerShell, type:
$PsCred = Get-Credential
$PrvdIdentityPath = New-Object System.Management.ManagementPath("root\wmi:WT_iSCSIStorageProviderIdentity")
$PrvdIdentityClass = New-Object System.Management.ManagementClass($PrvdIdentityPath)
$PrvdIdentityClass.SetProviderIdentity("{88155B26-CE61-42FB-AF31-E024897ADEBF}",$PsCred.UserName,$PsCred.GetNetworkCredential().Password)
$PrvdIdentityClass.SetProviderIdentity("{9D884A48-0FB0-4833-AB70-A19405D58616}",$PsCred.UserName,$PsCred.GetNetworkCredential().Password)
To use Component Services to configure credentials
-
Open Component Services.
-
In the left pane, expand folders to Computers\My Computer\DCOM Config.
-
Right-click WTVdsProv, click Properties, click the Identity tab, click This user, enter the username and password of the iSCSI target server account, and then click OK.
-
Right-click WTSnapsthoProvider, click Properties, click the Identity tab, click This user, enter the username and password of the iSCSI target server account, and then click OK.
-
Click Run and type regedit. In the left pane, expand folders to HKey_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\WTVDSProv\WtServers. Right-click WtServers, point to New, click String Value, then type the computer name of the iSCSI target server. The Data value can remain blank.
