Протокол iSCSI (Internet Small Computer System) представляет собой протокол SCSI, работающий с системами хранения данных поверх протокола IP. С помощью iSCSI вы сможете подключать ваши сервера к сетевым хранилищам по обычной TCP/IP сеть без использования FC. В этой статье мы рассмотрим, как настроить iSCSI-хранилище на одном Windows Server 2019 и использовать его на других серверах(в Windows Server 2016 и 2012 R2 все настраивается аналогично). Первый пример использования iSCSI: файловому серверу необходимо дополнительное место, и мы по сети подключаем к нему виртуальный диск с другого сервера-хранилища по iSCSI. Другой пример – построение отказоустойчивого кластера, когда для нескольких серверов необходимо общее хранилище.
Для использования ISCSI-диска нужно на сервере-хранилище настроить виртуальный диск (это обычный vhd/vhdx файл) и опубликовать его в виде iSCSI таргета, к которому подключаются iSCSI инициаторы (другие сервера и устройства).
Содержание:
- Настройка iSCSI target в Windows Server
- Настройка iSCSI Initiator в Windows Server 2019
Настройка iSCSI target в Windows Server
Сначала нужно включить iSCSI target (активировать роль iSCSI Target Server), зайдя в File and Storage Services -> File and iSCSI Services.
Теперь на iSCSI сервере нужно создать виртуальный диск. Для этого необходимо зайти в Server Manager -> File and Storage Services -> iSCSI, нажать To create an iSCSI virtual disk, start the New iSCSI Virtual Disk Wizard.
В мастере создания виртуального iSCSI диска нужно выбрать физический раздел, на котором его нужно разместить. Далее нужно присвоить имя iSCSI диска, указать размер диска и его тип (Fixed Size, Dynamically expanding или Differencing), имя iSCSI таргета.
На шаге Access Servers нужно указать серверы (iSCSI инициаторы), которые смогут подключаться к данному iSCSI таргет, выбрав один из вариантов подключения:
- IQN (придется сначала включить iSCSI initiator на сервере и скопировать IQN);
- DNS Name
- IP Address;
- MAC Address.
Пусть используется вариант с IP-адресом.
Следующий шаг в этом мастере – это настройка протокола аутентификации CHAP. Его следует использовать, если необходимо проверять подлинность подключения от инициатора. Далее он включается, вписывается имя пользователя и 12-значный пароль (или длиннее), затем Next -> Next -> Finish. Проверьте, что виртуальный диск iscsiDisk2.vhdx создался в каталоге D:\iSCSIVirtualDisks.
Можно создать iSCSI диск с помощью PowerShell. Создадим виртуальный диск размером 200 Гб:
New-IscsiVirtualDisk -Path С:\iSCSIVirtualDisks\iscsiDisk2.vhdx -Size 200GB.
По умолчанию создается динамический диск размером 4,096 Кб, независимо от того, сколько было указано параметром Size. Динамический диск будет расширяться по мере необходимости.
Если нужно использовать диск фиксированного размера (такие диске резервируют место на физическом носителе при создании), то его создать той же командой с дополнительным параметром UseFixed:
New-IscsiVirtualDisk -Path С:\iSCSIVirtualDisks\iscsiDisk2.vhdx -Size 200GB –UseFixed
Для дисков с высокой активностью и повышенными требованиями к IOPS нужно использовать диски фиксированного размера, т.к. для динамических дисков расходуются дополнительные ресурсы на операции приращения.
Далее таргету присваивается имя, здесь же можно разрешить к нему доступ с IP-адреса сервера-инициатора:
New-IscsiServerTarget -TargetName "iscsiTarget33" -InitiatorId @("IPAddress:172.17.244.8")
При желании вместо IP-адреса можно использовать IQN имя (iSCSI Qualified Name – уникальный идентификатор iSCSI устройства в сети):
New-IscsiServerTarget -TargetName iscsiTarget33 -InitiatorIds “IQN: 1991-05.com.microsoft:win2019test.ddd.com”
Затем желательно проверить результат:
Get-IscsiServerTarget | fl TargetName, LunMappings
Получить полное имя таргета можно с помощью командлета
Get-IscsiTarget
, а затем подключить таргет:
Connect-IscsiTarget -NodeAddress iqn.1991-05.com.microsoft:win2019test-iscsitarget33-target
Настройка iSCSI Initiator в Windows Server 2019
Следующий шаг – подключение к созданному iSCSI диску со второго сервера-инициатора. Перейдите в панель управления Control Panel, запустите iSCSI initiator (или выполните команду
iscsicpl.exe
).
В консоли управления службами services.msc поставьте автоматический тип запуска для службы Microsoft iSCSI Initiator Service, Или используйте команду:
Set-Service -Name MSiSCSI -StartupType Automatic
Перейдите на вкладку Discovery, нажмите на кнопку Discover Portal и введите ввести IP-адрес первого сервера (iSCSI-таргет). Чтобы трафик ходил только через определённый сетевой интерфейс, нужно нажать кнопку Advanced, и изменить значения по умолчанию в выпадающих списках: Local Adapter –> Microsoft iSCSI Initiator, Initiator IP –> 172.17.244.8.
Для подключения к iSCSI хранилищу необходимо открыть порты 860 и 3260 в Windows Firewall.
Теперь переключитесь на первую вкладку Targets, на ней появится новое подключение. Чтобы включить его, нажмите Connect -> Advanced, выберите значения из выпадающих полей, включите галочку Enable CHAP log on, укажите имя пользователя и 12-значный пароль.
Осталось инициализировать сам iSCSI-диск, который сначала находится в состоянии Offline. Для этого на сервере-инициаторе необходимо в консоли Disk Management в контекстном меню нового диска выбрать пункт Online, а затем – Initialize Disk. Создайте на новом диске один или несколько разделов, присвойте метку и букву диска. Отформатируйте в файловой системе NTFS.
Для быстрой инициализации и форматирования нового диска можно использовать следующий однострочный PowerShell (см. пример в статье об управления дисками и разделами из PowerShell):
Get-Disk |Where-Object PartitionStyle -eq 'RAW' |Initialize-Disk -PartitionStyle MBR -PassThru |New-Partition -AssignDriveLetter -UseMaximumSize |Format-Volume -FileSystem NTFS -Confirm:$false
Примечание: iSCSI-диски не поддерживают файловую систему ReFS.
Теперь этот виртуальный диск, подключенный с другого сервера по протоколу iSCSI можно использовать как обычный локально подключенный диск.
Также вы можете подключить iSCSI диск на инициаторе из PowerShell. Чтобы получить IQN таргета, используйте командлет
Get-iSCSITarget
.
Чтобы подключится к iSCSI таргет выполните команду:
Connect-IscsiTarget –IsPersistent $False и введите IQN.
Если использовалась дополнительная проверка аутентификации CHAP, то необходимо будет это указать, используя следующую конструкцию:
Get-iScsiTarget | Connect-iScsitarget –AuthenticationType ONEWAYCHAP –ChapUserName <username> -ChapSecret <secret>
Если вы хотите обеспечить высокую доступность и балансировку нагрузки для iSCSI дисков, можно использовать несколько избыточные сетевые компоненты (сетевые карты, коммутаторы) и модуль MPIO.
Internet Small Computer Systems Interface (iSCSI) is a storage networking resource that employs Internet Protocol connectivity to link up data storage facilities.
It provides block-level access to storage locations via TCP/IP network-carried SCSI commands. The iSCSI target is the network location (storage) and it appears as a local hard drive to the iSCSI initiator.
Basically, an iSCSI initiator is a client that connects to an iSCSI target.
When enabled and configured, an iSCSI Target Server turns a Windows Server OS computer into a network storage device.
Network-accessible storage is important in testing applications before installing them on a Storage Area Network (SAN).
How to install iSCSI target on Windows Server 2019
To perform this installation, you’ll need to have unrestricted administrative privileges to a computer running Windows 2019 server OS.
Step 1: Run the Server Manager on your Windows 2019 server OS
Step 2: Select the ‘Add Roles and Features’ tab
You can choose to skip the ‘Before you begin’ step by checking the small square selection box at the bottom of the page.
Click ‘Next’ to continue the installation wizard.
Step 3: Define the type of iSCSI target installation you want
Here, check the ‘Role-based or Feature-based installation’ button and click ‘Next’ to continue.
Step 4: Select a Host for your iSCSI target’s roles and services
This may be your local server or a virtual hard drive on your server. In our case, we’ll use the local server.
Hit ‘Next’ to continue.
Step 5: Select the iSCSI Server Roles
In this step, we’ll define a list of server roles to install for the iSCSI target.
Click on the “Files and Storage Services” tab to expand it.
Select “File and iSCSI Services” then check the box against “iSCSI Target Server”.
Step 6: Add features for your iSCSI target
When you select “iSCSI Target Server” in the previous step, a pop-up window titled “Add features that are required for iSCSI Target Server?” will open.
Here, click on the “Add Features” tab then hit “Next”.
Step 7: Select features
Check all additional features required to install the iSCSI target server and click ‘Next’.
Step 8: Confirm your installation selections
Confirm that iSCSI Target Server and the other selections you have made in the steps above are listed, then select “Install”.
Step 9: Complete the iSCSI target server installation
When the installation of selected roles, features, and services is complete, click “Close” to complete your installation of iSCSI Target Server.
How to configure iSCSI target on Windows Server 2019
To configure our iSCSI target on Windows Server 2019, we first need to create a folder that initiators will connect to.
You may create a folder or directory in any of your preferred disk partitions.
Step 1: Run your Windows 2019 server manager and select “File and Storage Services”
Step 2: Choose “iSCSI” from the expanded menu on the left of the pane
Click on the “To create an iSCSI virtual disk, start the New iSCSI Virtual Disk Wizard” link on the right of the window and a configuration wizard will pop up.
Step 3: Specify the server and disk volume to set the iSCSI disk
In our case, we selected “Type a custom path” then browsed to the folder we created before starting the iSCSI target configuration process.
You can select the folder and hit ‘Next’.
Step 4: Specify your virtual disc
Name and describe your virtual disk then click ‘Next’ to proceed.
Step 5: Set the iSCSI virtual disk size
Besides determining the size of the virtual disk, choose the most suitable disc mode depending on your iSCSI targets’ needs.
Check one option from the three options and click ‘Next’ to continue.
Step 6: Choose the iSCSI target for your virtual disc
Specify the iSCSI target you want to assign your virtual disc.
Since we’re configuring a new iSCSI target, proceed as shown below:
Stage 7: Specify the iSCSI target name
Simply name and describe the iSCSI target and proceed with the configuration.
Step 8: Specify access servers for this iSCSI target
To control access and maximize security, you should allow iSCSI target access to only known initiators.
Then, select the ‘Add’ tab to continue.
Step 9: Choose a verification method for the initiators
Under ‘Type’, choose ‘IP Address’ from the drop-down menu and key in the initiator’s IP address under the ‘Value’ field, then hit ‘OK’.
Step 10: Configure an authentication method between the initiator and your iSCSI target
Choose the ‘CHAP’ option, then set a username and password to control the initiator’s connection to the target.
Click ‘Next’ to proceed.
Step 11: Confirm selections to finish the iSCSI target configuration
Check that all selections are as you desire, then click ‘Create’.
Step 12: Complete the iSCSI target configuration
When all progress bars indicate ‘completed’, click ‘Close’ to wind up the configuration and exit the wizard.
Step 13: View the new virtual disc in the Server Manager as shown below
You have successfully installed an iSCSI target Server and created a target virtual disk on Windows Server 2019.
You may now proceed to configure an iSCSI initiator on your Windows 2019 Server.
Final Takeaway
The use of iSCSI Target on Windows 2019 Server is a welcome revolution to Storage Area Networks (SAN).
It not only amplifies the efficiency of Network-based and diskless boot performance but also accelerates the process. You can even leverage software loaders or boot-capable network adapters to deploy and use numerous diskless servers.
Opting for differentiating virtual hard disks saves around 90% of storage space consumed by OS images. Further, iSCSI target servers provide constantly available block storage for server applications.
And, if you are looking to optimize sharable server storage, Heterogeneous storage iSCSI target server is your ideal choice, as it allows interaction with even non-Microsoft iSCSI initiators.
Introduction:
In our previous post, we have learned the steps to install and configure the iSCSI Target Server role in Windows Server 2019. After creating iSCSI virtual Disk with iSCSI Target, the next step will be configuring iSCSI Initiator to connect iSCSI Storage Server.
To connect the iSCSI Target virtual disk created on iSCSI Storage Server, we can use iSCSI initiator. But before we can use it, we need to configure iSCSI initiator on the server where the iSCSI Storage should be accessible.
In this guide, we will learn the required steps to connect to the iSCSI Storage server by configuring iSCSI initiator on Windows Server 2019.
Test Lab Setup:
Note: For this, we will use the virtual test lab created in VirtualBox.
- WS2K19-DC01: iSCSI Storage Server (DC and DNS)
- WS2K19-SRV02: Member Server (iSCSI Initiator)
Configure iSCSI Initiator on Windows Server 2019:
1. Logon to the WS2K19-SRV02 member server and open Server Manager Console.
2. Click on Tools and select iSCSI Initiator.
3. A pop-up window will come up. Click on Yes to start iSCSI service and change its startup mode to Automatic.
4. On iSCSI Initiator properties, click on the Discovery tab. Click on Discover Portal.
5. Enter the IP Address or FQDN of iSCSI Target Server. Click on Advanced.
6. Choose the Local Adapter as Microsoft iSCSI Initiator and the Initiator IP Address from the drop-down list. Click OK.
7. Click on OK.
8. Click on the Target tab. Select the discovered target and click Quick Connect.
9. Click on Advanced.
10. Set up the options as mentioned below:
- Local Adapter: Microsoft iSCSI Initiator
- Initiator IP: 172.18.72.9 (IP Address of WS2K19-SRV02)
- Target Portal IP: 172.18.72.5 (IP Address of WS2K19-DC01)
11. Click OK when you are ready.
12. Click OK
13. After a successful connection, verify the target status is Connected.
Initialize the Disk and Create Volume:
14. Open Disk Management console.
15. Right-click on the iSCSI (Disk1) and choose Online.
16. Right-click on the iSCSI (Disk1) again and choose Initialize Disk.
17. Please select a partition style as per your requirement. Click on OK.
18. Right-click on the new disk, select New Simple Volume.
19. Click Next.
20. Specify Volume size and click Next.
21. Assign a drive letter for the new volume then click on Next.
22. Select File System to format the volume and click Next
23. Click on Finish.
24. Verify the newly created volume in disk management console.
In this article, we have learned the steps to configure iSCSI initiator on Windows Server to connect iSCSI Target Storage Server.
Thank you for reading.
Video Guide on How to Install and Configure iSCSI Storage and Initiator in Windows Server 2019:
Post Views: 3,538
Internet Small Computer Systems Interface (iSCSI) is a storage network resource that uses Internet Protocol connectivity to link data storage facilities.
It provides block-level (block) access to storage locations via SCSI commands. iSCSI Target is the network (memory) location and it appears as a local hard drive to the iSCSI Initiator. Basically, the iSCSI Initiator is a client that connects to the iSCSI Target.
When activated and configured, iSCSI Target Server turns Windows Server operating system computers into network storage devices.
Install iSCSI Target
Step 1 – To install iSCSI Target, go to “Server Manager” choose to Manage then click to Add Roles and Features.
Step 2 – Click Next in the window as shown below.
Step 3 – Select the Role-based or feature-based installation option and then click Next.
Step 4: Select a host for the iSCSI Target roles and services.
This can be a local server or a virtual hard drive on the server. In the example case, the local server will be used.
Click Next to continue.
Step 5: Select the iSCSI Server Roles
In this step, we will define a list of server roles to install for the iSCSI Target.
Click the Files and Storage Services tab to expand it.
Select iSCSI Target Server, then check the box iSCSI Target Server
Step 6: Add features to iSCSI Target.
When you selected the iSCSI Target Server in the previous step, a pop-up window titled Add features that are required for iSCSI Target Server? will open.
Here, click the Add Features tab and then click Next.
Step 7: Select features.
Check all the additional features required to install iSCSI Target Server and click Next
Step 8: Confirm installation selection.
Confirm that the iSCSI Target Server and other choices you made in the steps above are listed, then select Install.
Step 9: Complete the installation of iSCSI Target Server.
When the installation of the selected roles, features, and services is complete, click Close to complete the iSCSI Target Server installation.
Configure iSCSI Target
Step 1: Configure iSCSI Target Folder
We are now going to configure a folder that we shall be connected to by initiators. Create a directory/folder in your desired disk partition. We will create iSCSI-Test in C partition.
Head over to “Server Manager“. Click “File and Storage Services” and select iSCSI from the expanded menu. You will see “To create an iSCSI virtual disk, start the New iSCSI Virtual Disk Wizard” link on the right pane. Click on it. A wizard pops-up.
Step 2: Choose the folder we created
Select “Type a custom path” and browse for the folder we created earlier. Click “Next” after that.
Step 3: Name and describe your virtual disk
This is an easy step of just naming and describing your virtual disk. Click on “Next” after you are done.
Step 4: Set the size of the virtual disk
In this step, apart from setting the size of the virtual disk, you have the option of choosing if the disk will be fixed, dynamically grow or in differencing modes. All of the three are described adequately in the window. Select the one that makes more sense in your set-up and click “Next“
Step 5: Assign iSCSI Target
Since this is a new target, select “New iSCSI target” and click “Next“
Step 6: Name and describe your target
This is yet another easy step of just naming and describing your target. Click on “Next” after you are done.
Step 7: Specify access servers
For security, we have to explicitly allow known initiators to our targets. This page gives us that opportunity. Click on “Add” which opens “Add Initiator ID” pop-up window. For simplicity, use “Enter a value for the selected type” and under “Type” choose IP Address from the drop-down menu. Key-in your initiator IP Address and click “OK“.
Step 8: Authentication between initiator and Target
You can use either of the two CHAP options provided which are well described in this step. Enter username and passwords. Click on “Next” after you are done.
Step 9: Confirm selections and create
On this following page confirm your selections, click create and wait for it to finish.
You should see your virtual disk created in the server manager.
That’s all we guide you in this article !
In this tutorial, we would learn how to configure iSCSI disks in Windows Server 2019 and setup a iSCSI target server. The following would be covered:
- What is iSCSI?
- Adding Virtual Disks to VM in VirtualBox
- iSCSI Target vs iSCSI Initiator
- Configure the iSCSI Initiators
- Installing and Configuring iSCSI Target
- Connect the iSCSI Initiators to the Target
- Access the Local Disks
Video Tutorial here
1. What is iSCSI?
iSCSI stands for Internet Small Computer Systems Interface. It is a standard network-based storage. iSCSI allows you to create storage devices on the network that are accessible via Internet Protocol. The storage disks are provisioned using the iSCSI protocol and are accessible to computers on the network as if they are local to that computer. In other works, network computer see iSCSI disks as local disks.
In this demo, we will setup virtual machines using VirtualBox. Then we add disks to one of the nodes (NODE3). These disk would then be configured to be used by the network as iSCSI disks.
2. Adding Virtual Disks to VM in VirtualBox
I have setup VirtualBox with some nodes shown below.
Let’s now add some disks to Node3.
Step 1 – With Node3 selected, click on settings and choose Storage.
Step 2 – Click on the Add Disk icon at the lower end and follow the procedure to add a new disk
Step 3 – Repeat the process to add 3 more disks
Step 4 – After adding the disks, power up the computer. Go to Computer Management > Disk Management and you will see the three disks as shown below:
Step 5 – Bring the three disks online and assign then drive letters.
We would now configure these disks to be used an an iSCSI disk. But before then, let’s first understand two terms: iSCSI target and iSCSI initiator.
3. iSCSI Target vs iSCSI Initiator
An iSCSI target is a source of the iSCSI storage services. This is normally where the iSCSI storage disks in hosted. In this demo, this would be a VM with Windows Server 2019 which has been configured as an iSCSI target.
A iSCSI initiator is a device that consumes the storage service provided by the iSCSI target. In this demo, we would use configure Node1 and Node2 as iSCSI initiator to access the iSCSI target disks. Both Node1 and Node2 are run Window Server 2019.
4. Configure the iSCSI Initiators
As mentioned before, Nod1 and Node2 would be used as the initiators. So we need to configure them as iSCSI initiators. To do that, follow the steps below:
Step 1 – Log in to Node1. Click on tools on the upper right and select iSCSI initiator as shown below:
Step 2 – Click ok in the dialog box that appears
Step 3 – In the iSCSI Properties windows, select the Configuration tab and take note of the Initiator name.
Step 4 – Repeat the same for Node2.
5. Installing and Configuring iSCSI Target
To setup Node3 as an iSCSI target, follow the steps below:
Step 1 – Log in to the Node2 and click on Add roles and features
Step 2 – Find the iSCSI Target Server under File and iSCSI Services. See figure below:
Step 3 – After the installation complete, goto the File and Storage Services > iSCSI. Click on the link “To create and iSCSI virtual disk, start..“. See figure below:
Step 4 – Select drive D. Follow the and go Next. Follow the wizard steps to complete the Virtual disk creation. You will need the following
iSCSI virtual disk name: I named it VDiskD
Disk size: enter the size same as the Free space
iSCSI target: select New iSCSI target. I named it Node3Target
Access Servers: Click on Add > Select ‘Enter a value for the selected type’. The type should be IQN. In the value enter the IQN value. You get this from the Node1 and Node2 as explained in the previous part.
Step 5 – Repeat the same steps for Drive E and Drive F.
At this point, you will have the output shown in the figure below:
You can see that the disks are not connected. You need to connect them from the initiators.
6. Connect the iSCSI Initiators to the Target
Follow the steps below to connect the iSCSI initiators to the target.
Step 1: Now you need to go to the iSCSI initiators (Node1 and Node2) and open the initiator properties window.
Step 2: Enter the name of the target, that is NODE3 and click on Quick Connect. If you get it right, then the connection succeeds
Step 3: Click on the Volume and Devices tab and click on Auto Configure. You will see that the three disks connects as shown below.
Step 4: Click OK and exit
Step 5: Repeat steps 1 to step 4 for Node2
7. Connect to the Local Disks
Finally we would have access this disk on Node1 and Node2 just like local disk. To get that done we need to take these final few steps:
Step 1: On Node1, go to Computer Management > Disk Management. You will see the three disks. However, they are not offline and not initialised.
Step 2: Right-click on the Disk an choose Online
Step 3: Right-click again and choose Initialise
Step 4: You can then create a simple volume using the disk
Step 5: Repeat steps 2 to 4 for the two other disk
Step 6: Repeat steps 1 to 5 for the Node2
At this point, you have successfully completed setup of iSCSI in Windows Server 2019. If you have challenges do let me know.
And finally, i recommend you watch the video explanation on my Channel here.