Complete the following windows powershell commandlet to install iscsi target server:

Complete the following windows powershell commandlet to install iscsi target server:

In this time, I will show you how to create and configure an iSCSI target server on Windows Server 2016. Internet Small Computer System Interface (iSCSI) is a way of connecting storage devices over a network using TCP/IP. It can be used over a local area network (LAN), a wide area network (WAN), or the Internet. iSCSI devices are disks, tapes, CDs, and other storage devices on another networked computer that you can connect to.

Install iSCSI Role on Windows Server 2016

Using Server Manager (GUI)

iSCSI Target can be enabled using Add roles and features in the Server Manager:

Complete the following windows powershell commandlet to install iscsi target server:

  1. Choose the Role-based or feature-based installation option.
  2. Select the server you want to enable iSCSI Target.
  3. Select the iSCSI Target Role. Select “File Server” Role and “iSCSI Target Server” role.
  4. Confirm the installation.

Using PowerShell

Open the PowerShell cmdlet window, and run the following cmdlet:
Install-WindowsFeature -Name FS-Fileserver, FS-iSCSITarget-Server

Create iSCSI LUN

To share storage, the first thing is to create an iSCSI LUN (aka. iSCSI virtual disk).

Using Server Manager (GUI)

On the Server Manager, select “File and Storage Services” on the left panel and click “iSCSI” menu. On the main panel, you click the link “To create an iSCSI virtual disk, start the new iSCSI virtual Disk Wizard”

Complete the following windows powershell commandlet to install iscsi target server:

Select the virtual disk location.
Complete the following windows powershell commandlet to install iscsi target server:

Specify the Virtual Disks Name.
Complete the following windows powershell commandlet to install iscsi target server:

Specify the iSCSI virtual disk size.
Complete the following windows powershell commandlet to install iscsi target server:

Now, you will need to create or use the existing iSCSI target. To create a new iSCSI target, select “New iSCSI Target” option.
Complete the following windows powershell commandlet to install iscsi target server:

Give the Target a name. This name will be discovered by the iSCSI initiator, and use for the connection.
Complete the following windows powershell commandlet to install iscsi target server:

This page allows you to specify the initiators which can access the virtual disk, by allowing the Target to be discovered by defined list of initiators. You can use IQN, DNS Name, or IP Address.
Complete the following windows powershell commandlet to install iscsi target server:

CHAP is an authentication mechanism defined by the iSCSI standard to secure access to the target. It allows the initiator to authenticate to the Target, and in reverse allowing the Target to authenticate against the initiator.
Complete the following windows powershell commandlet to install iscsi target server:

Note: You cannot retrieve the CHAP information once it is set. If you lose the CHAP information, it will need to be set again.
Confirm the setup.
Complete the following windows powershell commandlet to install iscsi target server:

Using PowerShell

Create LUN
New-IscsiVirtualDisk -Path "C:\iSCSI\iscsi.vhdx" -Size 10GB.
Create iSCSI Target
New-IscsiServerTarget –TargetName iSCSI-target –InitiatorIds “IQN:iqn.1991-05.com.Microsoft:VM1.contoso.com”
Assign the VHDX to the iSCSI Target
Add-IscsiVirtualDiskTargetMapping -TargetName iSCSI-target –Path "C:\iSCSI\iscsi.vhdx"
And the iSCSI Target server is ready to use. You can set the iSCSI Initator and connect to the iSCSI Target Server

In this article, I am going to explain how we can install and configure the iSCSI Target Server Role on Windows Server 2016. iSCSI stands for Internet Small Computer System Interface and iSCSI Target Server allows you to boot multiple computers from a single operating system (OS) image.

To demonstrate the deployment process, I have created two virtual machines on my workstation. I have installed Windows Server 2016 on the virtual machines. Following is the configuration of the virtual machines.

Host Name

IP Address

Operating System

Role

DC.Local

192.168.0.100

Windows Server 2016

iSCSI initiator

SAN.Dc.Local

192.168.0.130

Windows Server 2016

iSCSI Target Server

First, let us create an iSCSI server. To do that, we must install the iSCSI server role.

Create and configure the iSCSI target server role

To configure the iSCSI target server, we must install the “File and iSCSI Services” role in Windows Server. To do that, Open Server Manager and click on “Manage” and select “Add roles and features.” See the following image.

Complete the following windows powershell commandlet to install iscsi target server:

On Add Roles and Features Wizard screen, you can see the detailed information about the wizard. We can skip this screen by checking on “Skip this page by default” checkbox. Click Next. See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

On Select Installation Type screen, you can choose to install a role on a dedicated computer or install a role on a virtual hard disk. We want to install the iSCSI service on a virtual machine; therefore, choose “Role-based or feature-based installation” Click on Next. See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

On the “Select destination server” screen, we can choose the server or the virtual disk on which we want to install the desired role or feature. We want to install the iSCSI services on SAN.DC.Local hence, choose SAN.DC.Local from the list of servers within Server Pool.

Complete the following windows powershell commandlet to install iscsi target server:

On the “Select server roles” screen, we can choose the desired role from the list of roles. We want to install File and iSCSI Services. To do that, expand, File and Storage Services, expand “File and iSCSI Services” and select “iSCSI Target Server”. See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

On the “Select features” screen, we can choose the required feature that we want to install. We do not want to install any feature, hence click on Next. See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

On Confirm installation selections screen, you can see the summary of the roles and the list of features that you are going to install on the server. Some roles and features require to restart the server during the installation process so you can enable the option to restart the server automatically during installation. Review the details of roles and click on Install. See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

Once installation completes, click on Close.

Complete the following windows powershell commandlet to install iscsi target server:

To verify that the iSCSI target server role has been installed successfully, open Server Manager and expand “File and Storage Services.” See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

In the left pan, you can view the iSCSI target server that has been installed. See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

Creating iSCSI Virtual disks

Once the iSCSI target server has been configured, let us create an iSCSI virtual disk. To do that,

  1. Launch Server Manager – expand “File and Storage services
  2. Click on “iSCSI
  3. On the right pan, click on “Start the new iSCSI virtual disk wizard

See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

New iSCSI disk wizard starts. On the “Select iSCSI virtual disk location” screen, you can choose the location of the virtual disk. If you have installed the iSCSI Target Server role on multiple servers, then you can choose the desired server from the list. The list of servers with the iSCSI target role will be populated automatically in the “Servers” text box. The disk volume can be selected from the “Select by Volume” list. You can also provide the custom path in the “Type a custom path” text box. We are going to create a virtual disk on the C drive of the SAN.DC.Local, hence choose C: from the “Select by Volume” textbox. Click on Next. See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

On the “Specify iSCSI virtual disk name” screen, you can provide the desired name of the virtual disk name. Click on Next. See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

On the “Specify iSCSI virtual disk size” screen, you can specify the size of the virtual disk. You can create any of the following disk types:

  1. Fixed Size: When we choose the fixed size, the wizard creates the disk that has the size specified in the “Size” textbox. This disk type is useful when you want to run the application that involves high disk activity. When you add or remove the data from the disk, the size of the disk does not change
  2. Dynamically expanding: When we choose dynamically expanding disk type, the wizard creates a disk with a small size. Later, the size of the disk increases based on the volume of the data that has been added
  3. Differencing: If you have a scenario when you want to create multiple child virtual disk in one parent disk. The changes should be made in child disks, and those changes can be revert. This setup can be configured using the differencing disk type

We want to create a disk that can be expanded based on the amount of the data added to the disk hence, choose “Dynamically expanding” disk type, enter the desired size of the disk in the “Size” textbox and click on Next. See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

On the “Assign iSCSI target” screen, we can provide the desired name of the iSCSI target. The iSCSI target name is used by the iSCSI initiators to identify the specific target. If you have created an iSCSI target, you can choose it from “Existing iSCSI target.” We have not created any target yet, so select “New iSCSI target” and click on “Next.” See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

On the “Specify target name” screen, you can provide the name of the target that can be used by iSCSI initiators. Provide the desired name in “Name” textbox and click on Next. See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

On the “Specify Server Access” screen, you can specify the list of iSCSI initiators that can access the virtual disk. To add the iSCSI initiators, click on Add. See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

By default, the iSCSI initiator cannot connect to the target server. We must install/enable iSCSI initiators. To connect to the iSCSI target server, we can use any of the following:

  1. Query initiator for computer ID: In “Query initiator for computer ID” text box, you can specify the fully qualified hostname of the computer that has iSCSI initiator. This method is supported by windows server 2008 R2 OR windows 7 or later operating systems
  2. IQN: You can specify the IQN of the machine that has an iSCSI initiator. IQN is a qualified name of the iSCSI. The format of the IQN is “<Type>.<Date>.<Naming Authority>.<string defined by naming authority>
  3. DNS Name: You can specify the DNS name of the computer where the iSCSI initiator has been installed
  4. IP Address: If you want to use the iSCSI target from outside of the domain, we can specify the IP Address of the computer that has iSCSI initiator
  5. Mac Address: Youcan also specify the MAC address of the computer that has an iSCSI initiator

We are going to connect the iSCSI target from DC. Local computer. To do that, on “Select a method to identify the initiator” screen, choose “DNS Name” from the type drop-down box and enter “DC.Local” in “Value” text box and click on OK to close the screen. See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

Back to the “Specify Server access” screen, you can see that the initiator has been added to the list. Click on Next. See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

If you want to enable CHAP (Challenge-handshake authentication protocol) or reverse CHAP, click on “Enable CHAP” and “Enable reverse CHAP” and provide username and password. We do not want to enable CHAP or Reverse CHAP, hence click on Next. See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

On confirm selection screen, review all the settings, and click on “Create” to create an iSCSI virtual disk. See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

On the “View Result” screen, you can see that disk has been created successfully. You can close the window. See the following image:

Complete the following windows powershell commandlet to install iscsi target server:

Once the disk has been created, you can see the list of iSCSI virtual disks in the server manager. See the following image.

Complete the following windows powershell commandlet to install iscsi target server:

Summary

In this article, I have explained how we can install the iSCSI Target Server Role and configure the iSCSI Target Server on Windows Server 2016. In my next article, I will explain that how we can configure the iSCSI initiator and use it to connect to the iSCSI virtual disk. Stay tuned!

  • Author
  • Recent Posts

Complete the following windows powershell commandlet to install iscsi target server:

Nisarg Upadhyay is a SQL Server Database Administrator and Microsoft certified professional who has more than 8 years of experience with SQL Server administration and 2 years with Oracle 10g database administration.

He has expertise in database design, performance tuning, backup and recovery, HA and DR setup, database migrations and upgrades. He has completed the B.Tech from Ganpat University. He can be reached on

Complete the following windows powershell commandlet to install iscsi target server:

What is the correct IQN format for Windows iSCSI initiators?

IQN: You can specify the IQN of the machine that has an iSCSI initiator. IQN is a qualified name of the iSCSI. The format of the IQN is “<Type>. <Date>.

How do I use iSCSI targets on Windows Server?

Connect the iSCSI target on Windows.
Launch the iSCSI initiator at Control Panel > Tools..
On the iSCSI Initiator Properties page, click Discovery..
Enter the IP address of the NAS and then click OK..
Click Targets and then select the available iSCSI targets that you want to connect..
Click Connect..
Click OK..

How do I create an iSCSI server in Windows 10?

Establish iSCSI connections.
Log in to your Windows..
Open iSCSI Initiator from Control Panel > Administrative Tools..
Under the Discovery tab, click Discover Portal..
Enter the IP address or DNS name of your Synology NAS and click OK..
Go to the Target tab and click Refresh..

How do I create an iSCSI server?

From Server Manager, navigate to File and Storage Services and select iSCSI. Click on the link “To create an iSCSI virtual disk, start the New iSCSI Virtual Disk Wizard”. (Alternatively, select New iSCSI Virtual Disk from the TASKS drop-down menu on the upper right of the screen.)