Windows Server 2012 – Getting Started With the iSCSI Target Server

It’s really great that Windows Server 2012 can now act as an iSCSI target. Here’s what I’ve learned.

An important note is that Windows Server will not share out a raw disk. It will only share virtual disks (VHDX files) sitting on a file server. If you’re used to iSCSI via other vendors, this will freak you out a little bit. Don’t worry — it’s different but it works well.

Overview:

  1. Install the Role
  2. Create a virtual disk.
  3. Create a new iSCSI target, and map the virtual disks to the target.
  4. Map initiator IQN’s to targets.

Install the Role

It’s easy:

Install-WindowsFeature FS-FileServer,FS-VSS-Agent,FS-iSCSITarget-Server,iSCSITarget-VSS-VDS,Storage-Services -includeManagementTools

Create a virtual disk

mkdir C:\iscsimount
New-IscsiVirtualDisk -path C:\iscsimount\test-disk-1.vhdx -sizebytes 10GB

Create a Target and Mapping

New-iSCSIServerTarget TestTarget1
Add-iSCSIVirtualDiskTargetMapping TestTarget1 C:\iscsimount\test-disk-1.vhdx

Map Initiator IQN’s

On each initiator, run the following command to retrieve the IQN.

(Get-InitiatorPort).NodeAddress

Now, back on the target server, do the following:

Set-IscsiServerTarget -Target TestTarget1 -InitiatorIDs @("IQN://initator1IQN","IQN://initiator2IQN")

You’re good to go. On the initiators, you should now be able to connect to the iSCSI Target and see the disks. Congrats!

Advertisements

One thought on “Windows Server 2012 – Getting Started With the iSCSI Target Server

  1. Pingback: Windows Server 2012 – Getting Started With Failover Clustering | windowsmasher

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s