Accessing iSCSI targets from Microsoft Hyper-V

Before connecting an iSCSI initiator of Microsoft Hyper-V to iSCSI targets working in the ALUA mode, you need to install and configure Multipath I/O (MPIO). This feature can be used starting from Windows Server 2008 R2. To connect the initiator, for example, on Microsoft Hyper-V Server 2016, do the following:

  1. Add the MPIO feature:

    1. Open Server Manager, click Manage, and select Add Roles and Features.

    2. In Installation Type, leave Role-based or feature-based installation.

    3. In Server Selection, leave Select a server from the server pool.

    4. In Features, select the Multipath I/O option and click Next to install this feature.

    5. Wait until the installation process is complete, and then close the window.

  2. Connect your iSCSI targets to the iSCSI initiator as follows:

    1. In Server Manager, click Tools, and select iSCSI Initiator to launch it.

    2. In the iSCSI Initiator Properties window, open the Discovery tab and click Discover Portal.

    3. In the Discover Target Portal window, enter the target IP address and click OK. Repeat this step for each target from the target group.

    4. On the Targets tab, click Refresh to discover the added targets.

    5. Click Connect for each target to connect it to the initiator. In the Connect To Target window, select Enable multi-path and click OK.

  3. Configure MPIO settings:

    1. In Server Manager, click Tools, and select MPIO.

    2. In the MPIO Properties window, go to the Discover Multi-Paths tab and select Add support for iSCSI devices.

    3. On the MPIO Devices tab, check the displayed devices and click OK.

Now, you can now check the added devices and their status in Disk Management.

To improve the iSCSI initiator performance, configure Microsoft Windows registry keys as follows:

  1. Open Registry Editor. In the Start menu, type regedit in the search box and press Enter.
  2. Navigate to the following location: [\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e97b-e325-11ce-bfc1-08002be10318}\0004 (Microsoft iSCSI Initiator)\Parameters].
  3. Update the following settings. Right-click on each setting and select Modify. Change Base to Decimal, update the value, and select OK.

    Parameter Value Description
    MaxTransferLength 262144 Sets maximum data the initiator sends in an iSCSI PDU to the target to 256 KB
    MaxBurstLength 262144 Sets the maximum SCSI payload that the initiator negotiates with the target to 256 KB
    FirstBurstLength 262144 Sets maximum unsolicited data the initiator can send in an iSCSI PDU to a target to 256 KB
    MaxRecvDataSegmentLength 262144 Sets maximum data the initiator can receive in an iSCSI PDU from the target to 256 KB
    InitialR2T 0 Disables R2T flow control
    ImmediateData 1 Enables immediate data
    WMIRequestTimeout 30 seconds Sets the timeout value for WMI requests to 30 seconds
    LinkDownTime 30 seconds Sets timeout value for link down time to 30 seconds