3 out of 5 rated this helpful - Rate this topic

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.

noteNote
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.

Before configuring for block storage, you will need to:

  • Set up two or more servers, each running Windows Server 2012

Using Windows PowerShell commands, install the required role service and features:

  1. 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.

  2. Add the iSCSI Target Server role service by typing the following command:

    PS C:\> Add-WindowsFeature fs-iscsitarget-server
    
  3. Verify that the iSCSI Target Server role service is installed by typing the following command:

    PS C:\> Get-WindowsFeature fs-iscsitarget-server
    
    "[X]" indicates that the role service is installed.

  4. Install failover clustering by typing the following on the cluster node:

    PS C:\> Add-WindowsFeature failover-clustering
    
  5. Verify that the feature is installed on both nodes by typing the following command:

    PS C:\> Get-WindowsFeatures failover-clustering
    
    "[X]" indicates that the feature is installed.

  1. On the iSCSI initiator computer, start the iSCSI Initiator Properties applet. From Server Manager, click the Tools menu, and then choose iSCSI Initiator.

  2. Click the Targets tab, and type the iSCSI target IP address. Choose Quick Connect.

  3. 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:

  1. From Windows PowerShell, type:

    New-IscsiTargetPortal –TargetPortalAddress <IP_address>
    $t = Get-IscsiDiscoveredTarget
    Connect-IscsiDiscoveredTarget –NodeAddress $t.NodeAddress
    Get-IscsiPersistentTarget
    
    noteNote
    If there is no record returned, you can register the iSCSI target by typing:

    Register-IscsiPersistentTarget –TargetName $t.NodeAddress
    
  2. Bring the disk online and create a volume on it:

    Get-disk
    
noteNote
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:

  1. Open Failover Cluster Manager.

  2. Right-click Roles and then choose Configure Role. The High Availability wizard, Select Service or Application page appears.

  3. Select iSCSI Target Server. The Client Access Point page appears.

  4. Type the service or application name and the IP address for the iSCSI Target Server high availability instance.

  5. Select the Networks Address checkbox, and then choose Next. The Select Storage page appears.

    noteNote
    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.

  6. 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.

  7. Return to the High Availability Wizard, and select the checkbox for this storage volume. Choose Next. The Confirmation page appears.

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

noteNote
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

  1. Open Component Services.

  2. In the left pane, expand folders to Computers\My Computer\DCOM Config.

  3. 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.

  4. 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.

  5. 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.

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.