Windows Server

How to install and configure iSCSI Target Server and iSCSI Initiator on a Windows Server

iscsi

iSCSI is an acronym for Internet Small Computer System Interface. It is a network protocol that encapsulates storage device communication data into IP packets for transmission over an Ethernet connection. This allows the IP-connected hosts to access the Storage Area Network (SAN). iSCSI Target Server also enables admins to run/boot multiple devices on a network from a single operating system image that’s stored in a central location. Traditional Storage Area Networks are based on Fiber Channel. Fiber Channel SANs are very fast but they’re also expensive. iSCSI will provide us with most of the benefits of a Fiber Channel SAN without all the cost associated with Fiber Channel SAN. iSCSI is the most frequently used solution and it enables us to create a very reliable and fast SAN using ethernet hardware. It will also be nice to emphasize that, iSCSI does not run as fast as a Fiber Channel SAN and the associated offered by Fiber Channel SAN can not be achieved by iSCSI. Here are some guides you may be interested in: Initialize and format a virtual disk: How to add and remove a new virtual disk from a VM on VMware Workstation, how to scale up and scale out on Azure, how to track your device performance and health via Windows Security in Windows 10, and Unable to access files in Synology Disk station from Windows 10.

iSCSI allows access to a remote server (target) disk by making it virtually available as a local disk. When you configure iSCSI SAN, the iSCSI target Server is configured and therefore offers access to the shared storage. The server that connects to the iSCSI Target is referred to as the iSCSI Initiator. The advantage of iSCSI over Fiber Channel is the cost as Fibre Channel is relatively very expensive to implement. By imploying iSCSI, we can create a SAN that runs at a relatively low cost which requires no additional interface cards, fiber optic cabling, no fiber-optic switches etc, therfore,, ensuring everything run as software. Below is a table showing some iSCSI terminologies.
NameDescription
IQNThe is referred to as the iSCSI qualified name. It is unique name that is used for identifying targets as well as initiators
Backend StorageThe storage location on the iSCSI target that the iSCSI target component is providing access to
TargetThe service on an iSCSi server that gives access to backend storage devices.
InitiatorThe iSCSi client that connects to a target and is identified by IQN
AClThe access control list that is based on the iSCSI initiator IQN and used to provide access to specific user
LUNA Logical Unit Number. The backend storage devices that are shared through the target. This can be any device that supports read/write operations, such as disk, partitions, logical volumes, files or tape drves
DiscoveryThe process whereby an initiator finds the targets that are configured on a portal and stores the information locally for future reference.

Part A – Install iSCSI Server (Role): There are quite a few different ways to add the iSCSI Target server on a Windows device.
– To do this via PowerShell, run the command below

Install-WindowsFeature -Name FS-iSCSITarget-Server

– Via the Server Manager: Click on the Dashboard on the Server Manager and click on Add roles and features as shown below.

Screenshot-2021-07-13-at-04.04.50

On the “Before you begin” page, you can just click on Next. If you do not want the page to appear subsequent times, check the button to skip the page by default.

Screenshot-2021-07-13-at-04.05.22

On the next Window “Select installation type“, select “Role-based or feature-based installation” and click on “Next“.

Screenshot-2021-07-13-at-04.05.43

If you have multiple servers, please ensure you select the right server to have the iSCSI Target Server installed.
– Click on Next to continue

Screenshot-2021-07-13-at-04.06.05

Expand and check the the iSCSI Target Server box as shown below. As you can see, it has not previously been installed.
– When you are done checking the box, click on Next to continue

On the Features page, we do not have to select any Feature, simply click on Next to continue as shown below.

Screenshot-2021-07-13-at-04.08.24

To avoid restarting the Server yourself when a restart is needed, you can check the button “Restart the destination server automatically if required”. For this setp, a restart is not required, therefore I will still not check it.
– Confirm you have selected the right role (iSCSI Target Server) and click on Install as shown below.

Screenshot-2021-07-13-at-04.09.41

Once your installation is complete, click on “Close”. You can also click on close while the installation is going on.

Part B – Create an iSCSI target: Now that the iSCSI Target Server has been installed, we will configure a new iSCSI Target. You can create an iSCSI disk (virtual disk)using PowerShell.

New-IscsiVirtualDisk -Path c:\xxxxxxxxxx\TechDASAN.vhdx -Size 10GB

Via the Server Manager: To do this, click on File and Storage Services as shown below.

Screenshot-2021-07-13-at-04.26.23

Click To create an iSCSI virtual disk, click on iSCSI and under iSCSI Virtual Disks. Click on the Task dropdown menu and
– Click on “New iSCSI Virtual Disk” Wizard

Screenshot-2021-07-13-at-04.27.06

Select a volume and click on Next to proceed as shown below.

Screenshot-2021-07-13-at-04.28.06

Enter the the iSCSI Virtual Disk name and description. When you done, click on Next to continue.

Screenshot-2021-07-13-at-04.31.20

Enter the size of the desired Virtual Disk GB. Also, select the vDisk type (Fixed Size, Dynamically expanding or Differencing) as shown below .
– I am going with the Dynmaically exapning as shown below.
– Click next to proceed.

Screenshot-2021-07-13-at-04.32.54

Select New iSCSI target and click Next to continue.

Screenshot-2021-07-13-at-04.33.45

Under Target Name and Access, enter a name to identify the disk by Target servers. Therefore, type a Name, description and click on Next

Screenshot-2021-07-13-at-04.34.56

At the Access Servers step, specify the servers (iSCSI initiators) that will be able to connect to the iSCSI target by selecting one of the following connection options: IQN (This requires that you configure iSCSI initiator on your server before you the IQN can be copied), Server Name (DNS Name), IP Address, MAC Address.
– To proceed, click on “Browse” as shown below.

Screenshot-2021-07-13-at-04.36.01

As you can see below, I am using the DNS name “HyperV“. I will enter my Server Name and click on check names and when fund, I will click on Ok to complete close the “Select Computer” wizard.

Ensure on the target server that you have enabled the iSCSI initiator service as well. Click on Ok on cloe the window below.

Screenshot-2021-07-13-at-04.38.49

As you can see below, the creation of the iSCSI Target and Initiator are currently being saved.

Screenshot-2021-07-13-at-04.39.06

Click on Next to continue.
– Note: You  can click on Add. This will Add the Servers which will be accessing this disk.

Screenshot-2021-07-13-at-04.39.32

On the Enable Authentication window, as you can see, this is optional. This is a Lab task and therefore, I will not be needing to authenticate the initiator’s connection.
– Click on Next to continue.

Screenshot-2021-07-13-at-04.40.02

Confirm the iSCSI virtual disk settings and click Create.

Screenshot-2021-07-13-at-04.40.42

As you can see, the iSCSI virtual Virtual Disk has been successfully created.

Screenshot-2021-07-13-at-04.41.07

You can follow the steps mentioned in creating an iSCSI Virtual Disk. As you can see below, you can perform the following settings you can perform for the iSCSI Virtual Disks and iSCSI Targets.

As yu can see in the figure below, here are the iSCSI Target Properties window.

Screenshot-2021-07-13-at-05.22.10

Part C – Install and Configure iSCSI Initiator: In this step, we will be connecting to the virtual iSCSI disk from another server (iSCSI initiator). Also, there are different ways to launch the iSCSI Initiator.
– First, launch the Control Panel and start the iSCSI initiator (or run iscsicpl.exe) from the run dialogbox.
– Alternatively, you can launch the Server Manager and click on Tools and then on the iSCSI Initiator.

Note: To connect to the iSCSI storage, you may need to open TCP ports 860 and 3260 in Windows Firewall. iSCSI target servers listen on port 3260 and initiators connect using port 860.
Screenshot-2021-07-13-at-05.30.17

On the prompt, click on YES to automatically start t he Microsoft iSCSI service as shown below.

Screenshot-2021-07-13-at-05.30.46

In the window below, click on the Target tab and this will open up the iSCSI initiator properties. Here, we will need to enter the DNS Name or IP Address of the iSCSI target configured in Part B above and then click on Quick Connect to automatically connect to the discovered targets.
– As you can see below, the iSCSI targets was discovered and connected. If you find an inactive iSCSI Target, select it and click on Connect.
– Navigate to the Volume and Devices Tab, click on Auto Configure to configure the volumes so upon restart, the it is readily available for use.

Note: It is also possible to connect an iSCSI disk on the initiator host via PowerShell. To get the target IQN, use the Get-iSCSITarget cmdlet as shown below. If you are using CHAP authentication, the command will be different. This is not covered in this guide.

Connect-IscsiTarget –IsPersistent $False and enter the IQN.

Part D – Initialize and Format the vDisk: To do this, open disk management via the Server Manager or Windows Administrative Tools. Here is a similar guide on how to do this: How to initialize and format a virtual disk. I will be showing you how to launch this via Windows Administrative Tools “Control Panel\System and Security\Administrative Tools\Computer Management.lnk”.
– Click on Computer Management

Screenshot-2021-07-13-at-05.07.25

As you can see below,  there is a new volume in the Disk Management panel of the client PC. You can format it and adminsister it just like other volumes.

Screenshot-2021-07-13-at-05.38.14

Right-click the disk and select bring it online.
– If you do not find the drive yet, please under “Actions” > Rescan Disks“. If you on working on a cloud platform such as AWS, you may have to rescan in order to see the attached disk.

Screenshot-2021-07-13-at-05.38.56

Right-click the disk to be initialized and then click Initialize Disk. Windows prompts you to initialize the disk before the Logical Disk Manager can access it.

Screenshot-2021-07-13-at-05.39.22

I will be selecting MBR but I recommend you select GPT.
– Kindly refer to this link. GPT is the abbreviation of GUID Partition Table, which is a standard for the layout of the partition table on a physical hard disk, using globally unique identifiers (GUID). MBR is another kind of partition table format. It is short for the master boot record. Comparatively, the MBR is older than the GPT

Screenshot-2021-07-13-at-05.40.02

Right-click the unallocated space and click New Simple Volume.

Screenshot-2021-07-13-at-05.40.27

Click on Next to continue

Screenshot-2021-07-13-at-05.40.50

Enter the size of the partition (in MB) and click Next. I will leave it as default to use all available disk space.

Screenshot-2021-07-13-at-05.41.07

Select a drive letter and click Next.

Screenshot-2021-07-13-at-05.41.39

Select the file system type and volume label. For me as you can see below, I entered a Volume name “TechDAStorage”.

Screenshot-2021-07-13-at-05.42.37

Click on Finish to complete the process.

Screenshot-2021-07-13-at-05.43.13

As you can see below, we have our newly created virtual disk available on our VM.

Screenshot-2021-07-13-at-05.43.33

iSCSI allows access to a remote server (target) disk by making it virtually available as a local disk. Note that accessing an entire disk is quite different than accessing file/folders over CIFS(Windows file sharing or Samba) or NFS. In case of iSCSI the client can choose any file-system supported by client and setup their own ACLs. Further the same iSCSI disk cane be accessed by multiple clients to have some kind of distributed or clustered filesystem for High-Availability (HA).
– iSCSI Target Server has the ability to boot hundreds of computers using just a single OS image.

Screenshot-2021-07-14-at-11.54.29

I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x