3.3. 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. Run Windows PowerShell with administrator privileges and install MPIO.

    > Enable-WindowsOptionalFeature –Online –FeatureName MultiPathIO
    

    Your server will automatically reboot to finalize the installation.

  2. In the Windows PowerShell console, configure MPIO as follows:

    1. Enable support for iSCSI disks:

      > Enable-MSDSMAutomaticClaim -BusType iSCSI
      
    2. Set the failover policy to Fail Over Only. The policy uses a single active path for sending all I/O, and all other paths are standby. If the active path fails, one of the standby paths is used. When the path recovers, it becomes active again.

      > Set-MSDSMGlobalDefaultLoadBalancePolicy -Policy FOO
      
    3. Enable path verification. By default, the initiator will verify each path every 30 seconds.

      > Set-MPIOSetting -NewPathVerificationState Enabled
      
    4. Reboot the server.

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

    1. In the Control Panel > System and Security > Administrative Tools > Services windows, make sure that Microsoft iSCSI Initiator Service is running and its startup type is set to Automatic.

      ../_images/stor_image167_1.png
    2. Launch iSCSI Initiator.

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

      ../_images/stor_image167_2.png
    4. In the Discover Target Portal window, enter the target IP address and click OK. Repeat this step for each target from the target group.

      ../_images/stor_image167_3.png
    5. On the Targets tab, click Refresh to discover the added targets.

      ../_images/stor_image167_4.png
    6. Click Connect for each target to connect it to the initiator. In the Connect To Target window, select the Enable multi-path checkbox and click OK.

      ../_images/stor_image167_5.png
    7. On the Targets tab, click Devices.., select the connected LUN, and click MPIO...

      ../_images/stor_image167_6.png
    8. Make sure the connected LUN has several paths.

      ../_images/stor_image167_7.png

You can now initialize the newly added disk for use in Microsoft Hyper-V. Do the following:

  1. Open Disk Management, right-click the added disk, and choose Properties from the drop-down menu.

    ../_images/stor_image167_8.png
  2. Check the settings on the MPIO tab. The first connected target becomes Active/Optimized and the preferred path.

    ../_images/stor_image167_9.png
  3. Partition and format the disk as usual.

    ../_images/stor_image167_10.png