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 window, make sure that Microsoft iSCSI Initiator Service is running and its startup type is set to Automatic.

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

    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.

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

    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.

    7. On the Targets tab, click Devices.., select the connected LUN, and click MPIO...

    8. Make sure the connected LUN has several paths.

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.

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

  3. Partition and format the disk as usual.