Windows mpio round robin

Установка и настройка MPIO в Windows Server 2016/2012R2

В этой статье мы рассмотрим особенности реализации, установки и настройки MPIO в Windows Server 2016/2012 R2. MPIO (MultiPath Input Output) или многопутевой ввод-вывод, это технология для построения отказоустойчивого транспорта к системе хранения данных (СХД) или выполняющему эти функции серверу за счет использования избыточных путей. Дополнительные пути между сервером и хранилищем создаются с использованием избыточных физических компонентов (коммутаторы, кабели, адаптеры или сетевые карты). Обратная сторона такой избыточности – операционная система может видеть один и тот же LUN по разным путям и считать их разными устройствами.

На следующем скриншоте видно (список подключенных дисков можно вывести с помощью get-disk), что Windows видит без MPIO видит 2 диска по разным путям, которые по факту являются одним LUN:

Если ОС поддерживает MPIO, она будет видеть каждый из презентованных ей дисков в одном экземпляре. При включенном MPIO сервер может обращаться к данным на СХД по нескольким путям, что увеличивает скорость доступа к подключенному LUN и позволяет задействовать для доступа несколько сетевых или HBA-адаптеров.
MPIO может задействовать альтернативный логический путь при выходе из строя одного/нескольких компонентов, заставив операционную систему использовать для доступа к логическому диску (LUN) резервный маршрут, сохраняя непрерывность доступа к данным. Таким образом MPIO является важным компонентом при реализации отказоустойчивой системы доступа к данным, кроме того входящие в состав MPIO модули позволяют распределять нагрузку между различными путями к одному и тому же LUN-у.

Установка MPIO в Windows Server 2016/2012R2

Windows Server поддерживает многопутевой ввод-вывода MPIO начиная с версии Windows Server 2008 R2. Технология Microsoft MPIO позволяет обеспечить высокую доступность и балансировку нагрузки посредством возможности организации нескольких подключений к СХД, не зависит от протоколов и поддерживает подключение дисковых массивов и хранилищ по iSCSI, Fiber Channel и хранилищ SAS.

MPIO-модуль в Windows Server по умолчанию не включен. Установить его в Windows Server 2016 можно двумя способами:

  • Из графического интерфейса с использованием консоли Server Manager
  • Из командной строки Powershell

Установка MPIO с помощью консоли Server Manager

  1. Откройте консоль Server Manager;
  2. В списке компонентов (Features) найдите и активируйте опцию Multipath I/O;
  3. Завершите установку компонента MPIO и перезагрузите сервер.

Установка MPIO с помощью Powershell

Запустите консоль PowerShell с правами администратора и для установки компонента выполните команду:

Add-WindowsFeature -Name ‘Multipath-IO’

Чтобы убедиться, что модуль MPIO установлен в вашем Windows Server, выполните:

Get-WindowsFeature -Name ‘Multipath-IO’

Remove-WindowsFeature -Name ‘Multipath-IO’

Настройка MPIO в Windows Server 2016

После установки MPIO модуля, необходимо активировать его для LUN, которые доступны по нескольким путям. По умолчанию ОС видит каждое подключение к диску как разные логические диски (LUN).

Читайте также:  Обход лицензии windows 10

Разрешите модулю DSM от Microsoft (MSDSM) автоматически объединять SAN диски в зависимости от типа подключений. MSDSM автоматически определяет наличие LUN, имеющих несколько путей к СХД и поддерживает большинство популярных систем хранения.

Сделать это можно из командной строки:

  • Для SAS дисков: Enable-MSDSMAutomaticClaim -BusType SAS
  • Для iSCSI дисков: Enable-MSDSMAutomaticClaim -BusType iSCSI

mpclaim.exe -r -i -a «»

Также вы можете включить DSM через графический интерфейс. Откройте консоль управления Server Manager и в меню Tools выберите пункт MPIO (или выполните команду mpiocpl).

Перейдите на вкладку Discover MultiPaths, включите опцию Add support for SAS devices (или Add support for iSCSI devices, если вы используете iSCSI хранилище) и нажмите Add. После этого перезагрузите сервер.

После перезагрузки откройте диспетчер устройств или диспетчер дисков и убедитесь, что количество подключенных дисков (LUN), доступных серверу уменьшилось в 2 раза (при наличии подключений к СХД по двум путям).

Вы можете управлять списком устройств, для которых включена поддержка MPIO на вкладке MPIO Devices (или командой Get-MSDSMSupportedHw ).

Вы можете добавить новые MPIO устройства, нажав кнопку Add или из PowerShell:

New-MSDSMSupportedHw -VendorId -ProductId

Если вы подключаете iSCSI таргет по 2 путям и хотите использовать MPIO для этого подключения, нужно при подключении Target выбрать iSCSI LUN, нажать кнопку Connect и включить опцию Enable multipath.

Затем нажмите на кнопку Advanced и привяжите разные IP адреса инициатора к разным IP адресами target.

С помощью PowerShell можно получить текущие настройки MPIO:

Можно изменить настройки MPIO таймеров так (например, установим рекомендованные настройки для flash массива):

Set-MPIOSetting -NewPathRecoveryInterval 20 -CustomPathRecovery Enabled -NewPDORemovePeriod 30 -NewDiskTimeout 60 -NewPathVerificationState Enabled

Доступны следующие политики балансировки MPIO:

  • FOO — Fail Over Only
  • RR — Round Robin
  • LQD — Least Queue Depth
  • LB — Least Blocks

Чтобы задать политику балансировки (например, Round Robin):

Set-MSDSMGlobalLoadBalancePolicy -Policy RR

Также политику балансировки можно изменить в свойствах подключенного LUN на вкладке MPIO. В этом примере для массива выбрана политика Round Robin.

Чтобы увидеть полный список PowerShell команд, доступных в модуле MPIO, выполните команду:

Get-Command –Module Mpio

SAN Policy

В Windows имеется специальная политика дисков (SAN Policy), которая определяет, нужно ли автоматически монтировать диски при их подключении к хосту.

Текущую настройку SAN Policy можно получить с помощью diskpart. По умолчанию используется SAN политика Offline Shared.

Чтобы автоматически монтировать диски, нужно изменить значение SAN Policy на OnlineAll.

Setting the MPIO Policy

Currently viewing public documentation. Please login to access the full scope of documentation.

Overview

The Multipath-IO (MPIO) Policy defines how the host distributes IOs across the available paths to the storage. There are several policy options available as shown in the table below.

Parameter Value Description
FOO Fail Over Only — Policy that does not perform load balancing. This policy uses a single active path, and the rest of the paths are standby paths. The active path is used for sending all I/O. If the active path fails, then one of the standby paths is used. When the path that failed is reactivated or reconnected, the standby path that was activated returns to standby.
RR Round Robin — Load balancing policy that allows the Device Specific Module (DSM) to use all available paths for MPIO in a balanced way. This is the default policy that is chosen when the storage controller follows the active-active model, no other default has been set, and the management application does not specifically choose a load-balancing policy.
LQD Least Queue Depth — Load balancing policy that sends I/O down the path with the fewest currently outstanding I/O requests. For example, consider that there is one I/O that is sent to LUN 1 on Path 1, and the other I/O is sent to LUN 2 on Path 1. The cumulative outstanding I/O on Path 1 is 2, and on Path 2, it is 0. Therefore, the next I/O for either LUN will process on Path 2.
LB Least Blocks — Load balancing policy that sends I/O down the path with the least number of data blocks currently being processed. For example, consider that there are two I/Os: one is 10 bytes and the other is 20 bytes. Both are in process on Path 1, and both have completed Path 2. The cumulative outstanding amount of I/O on Path 1 is 30 bytes. On Path 2, it is 0. Therefore, the next I/O will process on Path 2.
None Any currently configured default load balance policy. This is the default Global Load Balancing Policy.

Round Robin and Least Queue Depth

The Round Robin (RR) policy distributes IOs evenly across all Active/Optimized paths and suitable for most environments. Least Queue Depth (LQD), is similar to RR in that IOs are distributed across all available Active/Optimized paths, however it provides some additional benefits. LQD will bias IOs towards paths that are servicing IO quicker (paths with lesser queues). In the event that one path becomes intermittently disruptive or is experiencing higher latency, LQD will prevent the utilization of that path reducing the effect of the problem path. In some situations, usually involving complex storage topologies using multiple hops between server and storage, LQD can cause some paths to be almost entirely avoided. This reduces maximum throughput and in those environments, RR may perform better. When attempting to maximize throughput, both RR and LQD should be tested to see which MPIO policy performs best.

Best practice recommendations for setting MPIO policy based on testing in Pure labs are as follows. As with all best practices, this is a general guideline and specific testing in the customer environment should be the final determinant. For hosts with 10 or fewer paths to a FlashArray volume, Pure Storage recommends using either Round Robin (RR) or Least Queue Depth (LQD). For hosts which have more than 10 paths to the volume, LQD should be used. Alternatively, Round Robin With Subset (RRWS) can be used to reduce the number of active paths. RRWS cannot be set as a default policy, and must be explicitly set for each volume. When using RRWS, a subset of paths can be designated as active/optimized and will be used for IO to the volume. Paths which have been set as active/unoptimized will be tried when none of the active/optimized paths are available.

Viewing an individual Pure Storage FlashArray volume’s multi-path disk device properties is only possible if a volume is connected using Fibre Channel or iSCSI. If there are not connected volumes to the Windows Server host review the following topics before proceeding:

It is possible to set the MPIO Policies using Windows PowerShell for the Windows Server host before any volumes are connected. If this is the case skip to the Using Windows PowerShell section.

When altering the MPIO Policy settings, testing has found that a host reboot is not required and these policy changes are non-disruptive in nature. However, Pure Storage does recommend that you should verify that the policies have taken effect by viewing the Disk Properties (as shown below).

Once the FlashArray volumes are presented to the host and added via the Disk Management console, the policy of Round Robin is applied to those volumes unless another policy type has been set as the Global default.

Setup using Windows Disk Management

  1. Open Computer Management using the Tools menu in Server Manager. Select Disk Management from the left-hand node tree. This will display the currently connected Logical Units (LUNs) to the Windows Server host.
  2. Right-click on Disk 1 (or whatever Disk # represents the newly connected LUN) and select Properties from the menu. This will open the properties dialog for the PURE FlashArray Multi-Path Disk Device. Each of the device paths has a Path State of Active/Optimized.

Using Windows PowerShell

The below PowerShell shows running the Load Balance Policy cmdlet to retrieving the current default Multipath-IO Policy. On a newly installed Windows Server running Get-MSDSMGlobalDefaultLoadBalancePolicy results in None because no default policy has been set as Multipath-IO has just been installed.

Retrieving the Default MPIO Policy

The next sections walk through each of these management tasks using the graphical user interface (GUI) or Windows PowerShell.

Setting the Default MPIO Policy

When setting the default load balance policy the -Policy parameter provides a ValidateSet which includes the following:

When using the Windows PowerShell entering tab after the -Policy parameter will cycle through the different options.

The below PowerShell shows setting the new Multipath-IO Policy Load Balance Policy then retrieving it to ensure it was set properly.

Volumes connected after the default MPIO policy has been set will use that policy unless explicitly configured to use an alternate policy.

When configuring a single host that is connected to Pure Storage and DellEMC, please refer to the following article Windows Server MPIO and DellEMC PowerPath Coexistence.

Читайте также:  Смартфон с windows 64 bit
Оцените статью