Professional Documents
Culture Documents
13/03/15
Petri
Thurrott
Menu
Home Windows Server Windows Server 2012 Setup Windows Server 2012 R2 as an iSCSI Storage Server
What is iSCSI?
iSCSI has been around for a long time, and while it might sound like a technology thats only available
in enterprise-grade hardware, its been supported in W indows since Vista. It is also supported by many
Network Attached Storage (NAS) solutions and works over standard Ethernet.
But what is iSCSI? SCSI interfaces have long been used to connect peripherals, mainly hard drives, to
servers. SCSI is favored in server hardware due to the performance benefits it provides over SATA
interfaces found in most consumer PCs. iSCSI allows remote devices to be connected across Ethernet
networks, but appear as if they are attached locally.
Performance is often better than mapping a drive, and iSCSI provides better compatibility with
applications that dont support mapped network drives. Its also a great solution for extending storage
on devices such as notebooks where there is limited expansion capability.
In this demonstration, Im going to set up W indows Server 2012 R2 with two locally attached disks in a
mirrored pair, and then configure the iSCSI Target Server role to make the storage accessible from
another server. Y ou can adapt the instructions for your home or office lab, or use Azure, remembering
that while you will be able to get this working in the cloud, its not a supported scenario for production
systems.
In my Azure lab, I have two servers: CONTOSOSRV1 will serve as the iSCSI storage array, hosting the
iSCSI Target Server role, and CONTOSOSRV2 will use Microsofts iSCSI initiator to connect to the target
server. Im going to use a mirrored volume on CONTOSOSRV1, but a simple volume can also be used if
fault tolerance isnt required.
13/03/15
information on attaching disks to an Azure virtual machine, and provisioning a mirrored volume using
Storage Spaces, see Provision a Storage Spaces Mirrored Volume in W indows Server using
PowerShell on the Petri I T Know ledgebase.
Sponsored
Once you have a volume provisioned, install the iSCSI Target Server role on CONTOSOSRV1. Open a
PowerShell console with administrative privileges and run the command below:
1 install-w indow sfeature FS-iSCSITarget-Server includemanagementtools
W ait for the server role to install, and then configure a new iSCSI server target. As part of the process,
we need to specify which devices will be allowed to connect to the target server using the initiatorID
parameter. Replace 10.0.0.5, the IP address for CONTOSOSRV2 in my lab, with the IP address for the
equivalent server in your environment.
Ive specified one server by IP address, but you can specify multiple servers or use DNS names, which
is best practice. For example I PAddress:10.0.0.5,I PAddress:10.0.0.6 or
DNSName:contososrv2,DNSName:contososrv3.
Now lets create an iSCSI virtual disk on our volume, and add it to the server target. Im going to
create one iSCSI virtual disk that uses the maximum available space of my volume (E:), but you could
alternatively create several smaller iSCSI virtual disks.
1 New -IscsiVirtualDisk Path E:\iSCSIVirtualDisks\iSCSIdisk1.vhdx size 50GB
2 Add-IscsiVirtualDiskTargetMapping TargetName iSCSITarget1 DevicePath E:\iSCSIVirtualDisks\iSCSIdisk1.vhdx
http://www.petri.com/setup-windows-server-2012-r2-iscsi-storage-server.htm?utm_source=Newsletter&utm_medium=Email&utm_campaign=ENL%20[Petri]%20-%20Mar,%2013th%20(ID:%20632)2 / 7
13/03/15
Starting the iSCSI initiator service and defining the target portal. (I mage Credit:
Russell Smith)
Define the iSCSI storage array we created in the previous steps. 10.0.0.10 is the IP address for
CONTOSOSRV1 in my environment. Its also possible to give a DNS name for the TargetPortalAddress
parameter.
1 New -IscsiTargetPortal TargetPortalAddress 10.0.0.10
Now make a connection to the iSCSI server target using the connect-iscsitarget cmdlet, and make it
persistent so that it will survive server reboots:
1 $target = Get-IscsiTarget
2 Connect-IscsiTarget NodeAddress $target.NodeAddress
3 Get-IscsiSession | Register-IscsiSession
Format the new disk discovered by the initiator. (I mage Credit: Russell Smith)
Finally, check that you can see the iSCSI disk connected to CONTOSOSRV2:
1 Get-Disk | W here-Object BusType eq iSCSI
Sponsored
http://www.petri.com/setup-windows-server-2012-r2-iscsi-storage-server.htm?utm_source=Newsletter&utm_medium=Email&utm_campaign=ENL%20[Petri]%20-%20Mar,%2013th%20(ID:%20632)3 / 7
13/03/15
Share
http://www.petri.com/setup-windows-server-2012-r2-iscsi-storage-server.htm?utm_source=Newsletter&utm_medium=Email&utm_campaign=ENL%20[Petri]%20-%20Mar,%2013th%20(ID:%20632)4 / 7
13/03/15
Sponsors
http://www.petri.com/setup-windows-server-2012-r2-iscsi-storage-server.htm?utm_source=Newsletter&utm_medium=Email&utm_campaign=ENL%20[Petri]%20-%20Mar,%2013th%20(ID:%20632)5 / 7
Tweet
13/03/15
21
http://www.petri.com/setup-windows-server-2012-r2-iscsi-storage-server.htm?utm_source=Newsletter&utm_medium=Email&utm_campaign=ENL%20[Petri]%20-%20Mar,%2013th%20(ID:%20632)6 / 7
13/03/15
http://www.petri.com/setup-windows-server-2012-r2-iscsi-storage-server.htm?utm_source=Newsletter&utm_medium=Email&utm_campaign=ENL%20[Petri]%20-%20Mar,%2013th%20(ID:%20632)7 / 7