---
title: "Connect a storage LUN to a server"
sidebar_label: "Connect a storage LUN to a server"
sidebar_position: 1
description: "How to connect a storage LUN to a dedicated server"
---

import Formbricks from '@theme/MDXComponents/Formbricks';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import { TabItemLabel } from '@selectel/docux/components';

# Connect a storage LUN to a server

Once connected, the storage LUN will be available on the server as an unpartitioned disk space.

Data exchange between the storage LUN and the server occurs via the iSCSI protocol using two independent network interfaces. The LUN acts as an iSCSI target connected to a SAN switch, while the server acts as an iSCSI initiator.

Read more about iSCSI connections in the Selectel blog article [iSCSI: How the network storage protocol is organized](https://selectel.ru/blog/iscsi-protocol/).

The storage LUN must be connected to each server individually.

1. [Make sure that you have requested to connect the storage LUN to this server](#check-request-to-connect-lun-to-the-server).
2. [Connect to the server](#connect-to-server).
3. [Install an iSCSI initiator](#install-iscsi-initiator). If the server is running Windows, proceed to step 4.
4. [Display information about the iSCSI initiator](#display-information-about-the-iscsi-initiator).
5. [Request the parameters for connecting the storage LUN to your server](#request-parameters-for-connecting-lun-to-the-server).
6. [Set up an iSCSI connection](#set-up-an-iscsi-connection).
7. [Configure MPIO](#configure-mpio).

## 1. Check the request to connect the storage LUN to the server \{#check-request-to-connect-lun-to-the-server}

Check that you have requested the storage LUN connection to this server in the [service order ticket](https://my.selectel.ru/tickets).

If you did not request to connect this server, [create a ticket](https://my.selectel.ru/tickets/create). In the ticket, specify the server UUID or IP address. You can view it in the [control panel](https://my.selectel.ru/servers): in the top menu, click **Products** and select **Dedicated Servers** → **Servers** → server page → **Operating System** tab → **IP**.

## 2. Connect to the server \{#connect-to-server}

<Tabs queryString="connect-to-server">
  <TabItem value="linux" default>
    <TabItemLabel>
      Linux
    </TabItemLabel>

    [Connect to the server via SSH](/dedicated/manage/connect-to-server.mdx#connect-via-ssh) or using the [KVM console](/dedicated/manage/connect-to-server.mdx#connect-via-kvm-console).
  </TabItem>

  <TabItem value="windows">
    <TabItemLabel>
      Windows
    </TabItemLabel>

    [Connect to the server via RDP](/dedicated/manage/connect-to-server.mdx#connect-via-rdp) or using the [KVM console](/dedicated/manage/connect-to-server.mdx#connect-via-kvm-console).
  </TabItem>
</Tabs>

## 3. Install the iSCSI initiator \{#install-iscsi-initiator}

<Tabs queryString="install-iscsi-initiator">
  <TabItem value="debian-ubuntu" default>
    <TabItemLabel>
      Debian and Ubuntu
    </TabItemLabel>

    ```bash
    apt-get update && apt-get install open-iscsi multipath-tools
    ```
  </TabItem>

  <TabItem value="centos">
    <TabItemLabel>
      CentOS
    </TabItemLabel>

    ```bash
    yum install iscsi-initiator-utils device-mapper-multipath
    ```
  </TabItem>

  <TabItem value="windows">
    <TabItemLabel>
      Windows
    </TabItemLabel>

    The iSCSI initiator is included in the OS. Proceed to [display information about the iSCSI initiator](#display-information-about-the-iscsi-initiator) on step 4.
  </TabItem>
</Tabs>

## 4. Display information about the iSCSI initiator \{#display-information-about-the-iscsi-initiator}

<Tabs queryString="display-information-about-the-iscsi-initiator">
  <TabItem value="linux" default>
    <TabItemLabel>
      Linux
    </TabItemLabel>

    ```bash
    cat /etc/iscsi/initiatorname.iscsi
    ```
  </TabItem>

  <TabItem value="windows">
    <TabItemLabel>
      Windows
    </TabItemLabel>

    1. Run PowerShell as an administrator.
    2. Display information about the iSCSI initiator:

       ```bash
       Get-Service MSiSCSI | Set-Service -StartupType Automatic
       Start-Service MSiSCSI
       (Get-InitiatorPort).NodeAddress

       ```
  </TabItem>
</Tabs>

## 5. Request parameters for connecting the storage LUN to the server \{#request-parameters-for-connecting-lun-to-the-server}

1. [Create a ticket](https://my.selectel.ru/tickets/create) to request parameters for connecting the storage LUN to the server. Provide the iSCSI initiator information you obtained when [displaying iSCSI initiator information](#display-information-about-the-iscsi-initiator).

   Request network settings for iSCSI targets and CHAP authentication settings:

   * IP addresses of iSCSI targets connected to the SAN switch;
   * IP addresses to be configured on the servers for connection to iSCSI targets;
   * username (login) and password for CHAP authentication — the same pair is used for all servers.

2. Wait for a response from a Selectel technician.

## 6. Set up an iSCSI connection \{#set-up-an-iscsi-connection}

<Tabs queryString="set-up-an-iscsi-connection">
  <TabItem value="ubuntu" default>
    <TabItemLabel>
      Ubuntu
    </TabItemLabel>

    All iSCSI connection settings are saved in the iSCSI initiator folder, the `/var/lib/iscsi` directory.

    1. Open the `netplan` configuration file with the `vi` text editor:

       ```bash
       vi /etc/netplan/01-netcfg.yaml
       ```

    2. Set up two network interfaces on the server. Add IP addresses to the network interfaces connected to the SAN switch to gain access to the iSCSI targets:

       ```yaml
       network:
           version: 2
           ethernets:
               <eth_name_1>:
                   mtu: 9000
                   addresses: [<ip_address_1>/<mask_1>]
               <eth_name_2>:
                   mtu: 9000
                   addresses: [<ip_address_2>/<mask_2>]
       ```

       Specify:

       * `<eth_name_1>` — name of the first network interface;
       * `<eth_name_2>` — name of the second network interface;
       * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI. You can find it in the ticket;
       * `<mask_1>` — mask of the first server adapter in the segment for iSCSI. You can find it in the ticket;
       * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI. You can find it in the ticket;
       * `<mask_2>` — mask of the subnet of the second server adapter in the segment for iSCSI. You can find it in the ticket.

    3. Press the **ESC** key.

    4. Exit the `vi` text editor with changes saved:

       ```bash
       :wq
       ```

    5. Apply the configuration:

       ```bash
       netplan apply
       ```

    6. Optional: reboot the server.

    7. Check the speed of each interface. It should be at least 10 Gbps:

       ```bash
       ethtool <eth_name_1> | grep -i speed
       ethtool <eth_name_2> | grep -i speed
       ```

       Specify `<eth_name_1>` and `<eth_name_2>` — the names of the network interfaces configured in step 2.

    8. If the speed is lower than 10 Gbps, create a ticket. If the speed is 10 Gbps or higher, proceed to step 9.

    9. Check that the iSCSI target is available:

       ```bash
       ping -c5 <ip_address_1>
       ping -c5 <ip_address_2>
       ```

       Specify:

       * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI;
       * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI.

    10. Create iSCSI interfaces:

        ```bash
        iscsiadm -m iface -I <iscsi_eth_name_1> --op new
        iscsiadm -m iface -I <iscsi_eth_name_2> --op new
        ```

        Specify:

        * `<iscsi_eth_name_1>` — name of the first iSCSI interface;
        * `<iscsi_eth_name_2>` — name of the second iSCSI interface.

    11. Bind the iSCSI interfaces to the network interfaces configured in step 2:

        ```bash
        iscsiadm -m iface --interface <iscsi_eth_name_1> --op update -n iface.net_ifacename -v <eth_name_1>
        iscsiadm -m iface --interface <iscsi_eth_name_2> --op update -n iface.net_ifacename -v <eth_name_2>
        ```

        Specify:

        * `<iscsi_eth_name_1>` — name of the first iSCSI interface;
        * `<iscsi_eth_name_2>` — name of the second iSCSI interface;
        * `<eth_name_1>` — name of the first network interface configured in step 2;
        * `<eth_name_2>` — name of the second network interface configured in step 2.

    12. Check the availability of the iSCSI target through the iSCSI interfaces:

        ```bash
        iscsiadm -m discovery -t sendtargets -p <ip_address_1> --interface <iscsi_eth_name_1>
        iscsiadm -m discovery -t sendtargets -p <ip_address_2> --interface <iscsi_eth_name_2>
        ```

        Specify:

        * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI;
        * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI;
        * `<iscsi_eth_name_1>` — name of the first iSCSI interface;
        * `<iscsi_eth_name_2>` — name of the second iSCSI interface.

        A list of iSCSI targets will appear in the response.

        For example:

        ```bash
        203.0.113.101:3260,1 iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::20000:203.0.113.101
        203.0.113.102:3260,11 iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::1020000:203.0.113.102
        ```

        Where:

        * `203.0.113.101:3260` — IP address of the first server network adapter in the segment for iSCSI;
        * `iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::20000:203.0.113.101` — IQN of the first iSCSI target;
        * `203.0.113.102:3260` — IP address of the second server network adapter in the segment for iSCSI;
        * `iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::1020000:203.0.113.102` — IQN of the second iSCSI target.

    13. Copy the IQN for each iSCSI target. The IQN (iSCSI Qualified Name) is the full unique identifier of the iSCSI device.

    14. Configure CHAP authentication on the iSCSI initiator:

        ```bash
        iscsiadm --mode node -T <IQN_1> -p <ip_address_1> --op update -n node.session.auth.authmethod --value CHAP
        iscsiadm --mode node -T <IQN_2> -p <ip_address_2> --op update -n node.session.auth.authmethod --value CHAP
        iscsiadm --mode node -T <IQN_1> --op update -n node.session.auth.username --value <username>
        iscsiadm --mode node -T <IQN_2> --op update -n node.session.auth.username --value <username>
        iscsiadm --mode node -T <IQN_1> -p <ip_address_1> --op update -n node.session.auth.password --value <password>
        iscsiadm --mode node -T <IQN_2> -p <ip_address_2> --op update -n node.session.auth.password --value <password>
        ```

        Specify:

        * `<IQN_1>` — IQN of the first iSCSI target;
        * `<IQN_2>` — IQN of the second iSCSI target;
        * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI;
        * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI;
        * `<username>` — username (login) for CHAP authentication. You can find it in the ticket;
        * `<password>` — password for CHAP authentication. You can find it in the ticket.

    15. Log in to the iSCSI target through the iSCSI interfaces:

        ```bash
        iscsiadm --mode node -T <IQN_1> -p <ip_address_1> --login --interface <iscsi_eth_name_1>
        iscsiadm --mode node -T <IQN_2> -p <ip_address_2> --login --interface <iscsi_eth_name_2>
        ```

        Specify:

        * `<IQN_1>` — IQN of the first iSCSI target;
        * `<IQN_2>` — IQN of the second iSCSI target;
        * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI;
        * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI;
        * `<iscsi_eth_name_1>` — name of the first iSCSI interface;
        * `<iscsi_eth_name_2>` — name of the second iSCSI interface.

    16. Check that the iSCSI session for each iSCSI target has started:

        ```bash
        iscsiadm -m session
        ```

        Two active iSCSI sessions will appear in the response. For example:

        ```bash
        tcp: [5] 203.0.113.101:3260,1 iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::20000:203.0.113.101 (non-flash)
        tcp: [6] 203.0.113.102:3260,11 iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::1020000:203.0.113.102 (non-flash)
        ```

        Here `[5]` and `[6]` are the iSCSI session numbers.

    17. Duplicate the iSCSI session for each iSCSI target:

        ```bash
        iscsiadm -m session -r <session_number_1> --op new
        iscsiadm -m session -r <session_number_2> --op new
        ```

        Specify `<session_number_1>` and `<session_number_2>` — the iSCSI session numbers you displayed in step 16.

    18. Check that the SCSI sessions have been duplicated:

        ```bash
        iscsiadm -m session
        ```

        Four active iSCSI sessions will appear in the response.

    19. Ensure that settings will be applied when the server is restarted:

        ```bash
        iscsiadm -m node --loginall=automatic
        systemctl enable iscsi.service
        systemctl enable iscsid.service
        ```

    20. For each target, set up two iSCSI sessions that start automatically when the server is restarted:

        ```bash
        iscsiadm --mode node -T <IQN_1> -p <ip_address_1> --op update -n node.session.nr_sessions --value <number_of_sessions>
        iscsiadm --mode node -T <IQN_2> -p <ip_address_2> --op update -n node.session.nr_sessions --value <number_of_sessions>
        ```

        Specify:

        * `<IQN_1>` — IQN of the first iSCSI target;
        * `<IQN_2>` — IQN of the second iSCSI target;
        * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI;
        * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI;
        * `<number_of_sessions>` — number of iSCSI sessions that will start automatically when the server is restarted.

    21. Optional: reboot the server.
  </TabItem>

  <TabItem value="debian">
    <TabItemLabel>
      Debian
    </TabItemLabel>

    All iSCSI connection settings are saved in the iSCSI initiator folder, the `/var/lib/iscsi` directory.

    1. Open the network interfaces configuration file with the `vi` text editor:

       ```bash
       vi /etc/network/interfaces
       ```

    2. Set up two network interfaces on the server. Add IP addresses to the network interfaces connected to the SAN switch to gain access to the iSCSI targets:

       ```bash
       auto <eth_name_1> <eth_name_2>

       iface <eth_name_1> inet static
           address <ip_address_1>/<mask_1>
           mtu 9000

       iface <eth_name_2> inet static
           address <ip_address_2>/<mask_2>
           mtu 9000
       ```

       Specify:

       * `<eth_name_1>` — name of the first network interface;
       * `<eth_name_2>` — name of the second network interface;
       * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI. You can find it in the ticket;
       * `<mask_1>` — mask of the first server adapter in the segment for iSCSI. You can find it in the ticket;
       * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI. You can find it in the ticket;
       * `<mask_2>` — mask of the subnet of the second server adapter in the segment for iSCSI. You can find it in the ticket.

    3. Press the **ESC** key.

    4. Exit the `vi` text editor with changes saved:

       ```bash
       :wq
       ```

    5. Restart the network:

       ```bash
       service networking restart
       ```

    6. Optional: reboot the server.

    7. Check the speed of each interface. It should be at least 10 Gbps:

       ```bash
       ethtool <eth_name_1> | grep -i speed
       ethtool <eth_name_2> | grep -i speed
       ```

       Specify `<eth_name_1>` and `<eth_name_2>` — the names of the network interfaces configured in step 2.

    8. If the speed is lower than 10 Gbps, create a ticket. If the speed is 10 Gbps or higher, proceed to step 9.

    9. Check that the iSCSI target is available:

       ```bash
       ping -c5 <ip_address_1>
       ping -c5 <ip_address_2>
       ```

       Specify:

       * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI;
       * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI.

    10. Create iSCSI interfaces:

        ```bash
        iscsiadm -m iface -I <iscsi_eth_name_1> --op new
        iscsiadm -m iface -I <iscsi_eth_name_2> --op new
        ```

        Specify:

        * `<iscsi_eth_name_1>` — name of the first iSCSI interface;
        * `<iscsi_eth_name_2>` — name of the second iSCSI interface.

    11. Bind the iSCSI interfaces to the network interfaces configured in step 2:

        ```bash
        iscsiadm -m iface --interface <iscsi_eth_name_1> --op update -n iface.net_ifacename -v <eth_name_1>
        iscsiadm -m iface --interface <iscsi_eth_name_2> --op update -n iface.net_ifacename -v <eth_name_2>
        ```

        Specify:

        * `<iscsi_eth_name_1>` — name of the first iSCSI interface;
        * `<iscsi_eth_name_2>` — name of the second iSCSI interface;
        * `<eth_name_1>` — name of the first network interface configured in step 2;
        * `<eth_name_2>` — name of the second network interface configured in step 2.

    12. Check the availability of the iSCSI target through the iSCSI interfaces:

        ```bash
        iscsiadm -m discovery -t sendtargets -p <ip_address_1> --interface <iscsi_eth_name_1>
        iscsiadm -m discovery -t sendtargets -p <ip_address_2> --interface <iscsi_eth_name_2>
        ```

        Specify:

        * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI;
        * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI;
        * `<iscsi_eth_name_1>` — name of the first iSCSI interface;
        * `<iscsi_eth_name_2>` — name of the second iSCSI interface.

        A list of iSCSI targets will appear in the response.

        For example:

        ```bash
        203.0.113.101:3260,1 iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::20000:203.0.113.101
        203.0.113.102:3260,11 iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::1020000:203.0.113.102
        ```

        Where:

        * `203.0.113.101:3260` — IP address of the first server network adapter in the segment for iSCSI;
        * `iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::20000:203.0.113.101` — IQN of the first iSCSI target;
        * `203.0.113.102:3260` — IP address of the second server network adapter in the segment for iSCSI;
        * `iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::1020000:203.0.113.102` — IQN of the second iSCSI target.

    13. Copy the IQN for each iSCSI target. The IQN (iSCSI Qualified Name) is the full unique identifier of the iSCSI device.

    14. Configure CHAP authentication on the iSCSI initiator:

        ```bash
        iscsiadm --mode node -T <IQN_1> -p <ip_address_1> --op update -n node.session.auth.authmethod --value CHAP
        iscsiadm --mode node -T <IQN_2> -p <ip_address_2> --op update -n node.session.auth.authmethod --value CHAP
        iscsiadm --mode node -T <IQN_1> --op update -n node.session.auth.username --value <username>
        iscsiadm --mode node -T <IQN_2> --op update -n node.session.auth.username --value <username>
        iscsiadm --mode node -T <IQN_1> -p <ip_address_1> --op update -n node.session.auth.password --value <password>
        iscsiadm --mode node -T <IQN_2> -p <ip_address_2> --op update -n node.session.auth.password --value <password>
        ```

        Specify:

        * `<IQN_1>` — IQN of the first iSCSI target;
        * `<IQN_2>` — IQN of the second iSCSI target;
        * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI;
        * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI;
        * `<username>` — username (login) for CHAP authentication. You can find it in the ticket;
        * `<password>` — password for CHAP authentication. You can find it in the ticket.

    15. Log in to the iSCSI target through the iSCSI interfaces:

        ```bash
        iscsiadm --mode node -T <IQN_1> -p <ip_address_1> --login --interface <iscsi_eth_name_1>
        iscsiadm --mode node -T <IQN_2> -p <ip_address_2> --login --interface <iscsi_eth_name_2>
        ```

        Specify:

        * `<IQN_1>` — IQN of the first iSCSI target;
        * `<IQN_2>` — IQN of the second iSCSI target;
        * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI;
        * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI;
        * `<iscsi_eth_name_1>` — name of the first iSCSI interface;
        * `<iscsi_eth_name_2>` — name of the second iSCSI interface.

    16. Check that the iSCSI session for each iSCSI target has started:

        ```bash
        iscsiadm -m session
        ```

        Two active iSCSI sessions will appear in the response. For example:

        ```bash
        tcp: [5] 203.0.113.101:3260,1 iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::20000:203.0.113.101 (non-flash)
        tcp: [6] 203.0.113.102:3260,11 iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::1020000:203.0.113.102 (non-flash)
        ```

        Here `[5]` and `[6]` are the iSCSI session numbers.

    17. Duplicate the iSCSI session for each iSCSI target:

        ```bash
        iscsiadm -m session -r <session_number_1> --op new
        iscsiadm -m session -r <session_number_2> --op new
        ```

        Specify `<session_number_1>` and `<session_number_2>` — the iSCSI session numbers you displayed in step 21.

    18. Check that the SCSI sessions have been duplicated:

        ```bash
        iscsiadm -m session
        ```

        Four active iSCSI sessions will appear in the response.

    19. Ensure that settings will be applied when the server is restarted:

        ```bash
        iscsiadm -m node --loginall=automatic
        systemctl enable iscsi.service
        systemctl enable iscsid.service
        ```

    20. For each target, set up two iSCSI sessions that start automatically when the server is restarted:

        ```bash
        iscsiadm --mode node -T <IQN_1> -p <ip_address_1> --op update -n node.session.nr_sessions --value <number_of_sessions>
        iscsiadm --mode node -T <IQN_2> -p <ip_address_2> --op update -n node.session.nr_sessions --value <number_of_sessions>
        ```

        Specify:

        * `<IQN_1>` — IQN of the first iSCSI target;
        * `<IQN_2>` — IQN of the second iSCSI target;
        * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI;
        * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI;
        * `<number_of_sessions>` — number of iSCSI sessions that will start automatically when the server is restarted.

    21. Optional: reboot the server.
  </TabItem>

  <TabItem value="centos">
    <TabItemLabel>
      CentOS
    </TabItemLabel>

    All iSCSI connection settings are saved in the iSCSI initiator folder, the `/var/lib/iscsi` directory.

    1. Output information about the network interfaces:

       ```bash
       ip address
       ```

    2. Create a configuration file for the first network interface connected to the SAN switch to get access to the iSCSI target:

       ```bash
       vi /etc/sysconfig/network-scripts/ifcfg-<eth_name_1>
       ```

       Specify `<eth_name_1>` — name of the first network interface.

    3. Add or change the values of the network interface settings:

       ```bash
       NAME=<eth_name_1>
       ONBOOT=yes
       BOOTPROTO=none
       IPADDR=<ip_address_1>
       NETMASK=<mask_1>
       MTU=9000
       ```

       Specify:

       * `<eth_name_1>` — name of the first network interface;
       * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI. You can find it in the ticket;
       * `<mask_1>` — mask of the first server adapter in the segment for iSCSI. You can find it in the ticket.

    4. Press the **ESC** key.

    5. Exit the `vi` text editor with changes saved:

       ```bash
       :wq
       ```

    6. Create a configuration file for the second network interface connected to the SAN switch: to get access to the iSCSI target:

       ```bash
       vi /etc/sysconfig/network-scripts/ifcfg-<eth_name_2>
       ```

       Specify `<eth_name_2>` — name of the second network interface.

    7. Add or change the values of the network interface settings:

       ```bash
       NAME=<eth_name_2>
       ONBOOT=yes
       BOOTPROTO=none
       IPADDR=<ip_address_2>
       NETMASK=<mask_2>
       MTU=9000
       ```

       Specify:

       * `<eth_name_2>` — name of the second network interface;
       * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI. You can find it in the ticket;
       * `<mask_2>` — mask of the subnet of the second server adapter in the segment for iSCSI. You can find it in the ticket.

    8. Press the **ESC** key.

    9. Exit the `vi` text editor with changes saved:

       ```bash
       :wq
       ```

    10. Restart the network:

        ```bash
        systemctl restart network
        ```

    11. Optional: reboot the server.

    12. Check the speed of each interface. It should be at least 10 Gbps:

        ```bash
        ethtool <eth_name_1> | grep -i speed
        ethtool <eth_name_2> | grep -i speed
        ```

        Specify `<eth_name_1>` and `<eth_name_2>` — the names of the network interfaces configured in steps 2 and 6.

    13. If the speed is lower than 10 Gbps, create a ticket. If the speed is 10 Gbps or higher, proceed to step 14.

    14. Check that the iSCSI target is available:

        ```bash
        ping -c5 <ip_address_1>
        ping -c5 <ip_address_2>
        ```

        Specify:

        * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI;
        * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI.

    15. Create iSCSI interfaces:

        ```bash
        iscsiadm -m iface -I <iscsi_eth_name_1> --op new
        iscsiadm -m iface -I <iscsi_eth_name_2> --op new
        ```

        Specify:

        * `<iscsi_eth_name_1>` — name of the first iSCSI interface;
        * `<iscsi_eth_name_2>` — name of the second iSCSI interface.

    16. Bind the iSCSI interfaces to the network interfaces configured in steps 2 and 6:

        ```bash
        iscsiadm -m iface --interface <iscsi_eth_name_1> --op update -n iface.net_ifacename -v <eth_name_1>
        iscsiadm -m iface --interface <iscsi_eth_name_2> --op update -n iface.net_ifacename -v <eth_name_2>
        ```

        Specify:

        * `<iscsi_eth_name_1>` — name of the first iSCSI interface;
        * `<iscsi_eth_name_2>` — name of the second iSCSI interface;
        * `<eth_name_1>` — name of the first network interface configured in step 3;
        * `<eth_name_2>` — name of the second network interface configured in step 7.

    17. Check the availability of the iSCSI target through the iSCSI interfaces:

        ```bash
        iscsiadm -m discovery -t sendtargets -p <ip_address_1> --interface <iscsi_eth_name_1>
        iscsiadm -m discovery -t sendtargets -p <ip_address_2> --interface <iscsi_eth_name_2>
        ```

        Specify:

        * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI;
        * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI;
        * `<iscsi_eth_name_1>` — name of the first iSCSI interface;
        * `<iscsi_eth_name_2>` — name of the second iSCSI interface.

        A list of iSCSI targets will appear in the response.

        For example:

        ```bash
        203.0.113.101:3260,1 iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::20000:203.0.113.101
        203.0.113.102:3260,11 iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::1020000:203.0.113.102
        ```

        Where:

        * `203.0.113.101:3260` — IP address of the first server network adapter in the segment for iSCSI;
        * `iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::20000:203.0.113.101` — IQN of the first iSCSI target;
        * `203.0.113.102:3260` — IP address of the second server network adapter in the segment for iSCSI;
        * `iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::1020000:203.0.113.102` — IQN of the second iSCSI target.

    18. Copy the IQN for each iSCSI target. The IQN (iSCSI Qualified Name) is the full unique identifier of the iSCSI device.

    19. Configure CHAP authentication on the iSCSI initiator:

        ```bash
        iscsiadm --mode node -T <IQN_1> -p <ip_address_1> --op update -n node.session.auth.authmethod --value CHAP
        iscsiadm --mode node -T <IQN_2> -p <ip_address_2> --op update -n node.session.auth.authmethod --value CHAP
        iscsiadm --mode node -T <IQN_1> --op update -n node.session.auth.username --value <username>
        iscsiadm --mode node -T <IQN_2> --op update -n node.session.auth.username --value <username>
        iscsiadm --mode node -T <IQN_1> -p <ip_address_1> --op update -n node.session.auth.password --value <password>
        iscsiadm --mode node -T <IQN_2> -p <ip_address_2> --op update -n node.session.auth.password --value <password>
        ```

        Specify:

        * `<IQN_1>` — IQN of the first iSCSI target;
        * `<IQN_2>` — IQN of the second iSCSI target;
        * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI;
        * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI;
        * `<username>` — username (login) for CHAP authentication. You can find it in the ticket;
        * `<password>` — password for CHAP authentication. You can find it in the ticket.

    20. Log in to the iSCSI target through the iSCSI interfaces:

        ```bash
        iscsiadm --mode node -T <IQN_1> -p <ip_address_1> --login --interface <iscsi_eth_name_1>
        iscsiadm --mode node -T <IQN_2> -p <ip_address_2> --login --interface <iscsi_eth_name_2>
        ```

        Specify:

        * `<IQN_1>` — IQN of the first iSCSI target;
        * `<IQN_2>` — IQN of the second iSCSI target;
        * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI;
        * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI;
        * `<iscsi_eth_name_1>` — name of the first iSCSI interface;
        * `<iscsi_eth_name_2>` — name of the second iSCSI interface.

    21. Check that the iSCSI session for each iSCSI target has started:

        ```bash
        iscsiadm -m session
        ```

        Two active iSCSI sessions will appear in the response. For example:

        ```bash
        tcp: [5] 203.0.113.101:3260,1 iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::20000:203.0.113.101 (non-flash)
        tcp: [6] 203.0.113.102:3260,11 iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::1020000:203.0.113.102 (non-flash)
        ```

        Here `[5]` and `[6]` are the iSCSI session numbers.

    22. Duplicate the iSCSI session for each iSCSI target:

        ```bash
        iscsiadm -m session -r <session_number_1> --op new
        iscsiadm -m session -r <session_number_2> --op new
        ```

        Specify `<session_number_1>` and `<session_number_2>` — the iSCSI session numbers you displayed in step 21.

    23. Check that the SCSI sessions have been duplicated:

        ```bash
        iscsiadm -m session
        ```

        Four active iSCSI sessions will appear in the response.

    24. Ensure that settings will be applied when the server is restarted:

        ```bash
        iscsiadm -m node --loginall=automatic
        systemctl enable iscsi.service
        systemctl enable iscsid.service
        ```

    25. For each target, set up two iSCSI sessions that start automatically when the server is restarted:

        ```bash
        iscsiadm --mode node -T <IQN_1> -p <ip_address_1> --op update -n node.session.nr_sessions --value <number_of_sessions>
        iscsiadm --mode node -T <IQN_2> -p <ip_address_2> --op update -n node.session.nr_sessions --value <number_of_sessions>
        ```

        Specify:

        * `<IQN_1>` — IQN of the first iSCSI target;
        * `<IQN_2>` — IQN of the second iSCSI target;
        * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI;
        * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI;
        * `<number_of_sessions>` — number of iSCSI sessions that will start automatically when the server is restarted.

    26. Optional: reboot the server.
  </TabItem>

  <TabItem value="windows">
    <TabItemLabel>
      Windows
    </TabItemLabel>

    1. Check if MPIO is installed on your server:

       ```bash
       Get-WindowsFeature -Name Multipath-IO
       ```

       Example output if MPIO is installed:

       ```bash
       Display Name                            Name          Install State
       ------------                            ----          --------------
       [X] Multipath I/O                       Multipath-IO  Installed
       ```

    2. If MPIO is installed on the server, remove it:

       ```bash
       Remove-WindowsFeature -Name Multipath-IO
       ```

    3. Download and install [UltraPath](https://support.huawei.com/enterprise/en/flash-storage/ultrapath-pid-8576127/software/256976833?idAbsPath=fixnode01|7919749|8573842|9523109|8576127) for Windows — this is Huawei software for managing multipath access to storage (multipathing). UltraPath is used to ensure fault tolerance and load balancing when accessing storage arrays over a SAN network. Read more in the [OceanStor UltraPath for Windows](https://support.huawei.com/enterprise/en/doc/EDOC1100287086).

    4. Restart the server.

    5. Run PowerShell as an administrator.

    6. Configure two network interfaces on the server. Add the IP addresses of the iSCSI targets connected to the SAN switch to the network interfaces:

       ```bash
       Get-NetIPInterface
       New-NetIPAddress -InterfaceAlias "<eth_name_1>" -IPAddress <ip_address_1> -PrefixLength <mask_1>
       New-NetIPAddress -InterfaceAlias "<eth_name_2>" -IPAddress <ip_address_2> -PrefixLength <mask_2>
       ```

       Specify:

       * `<eth_name_1>` — name of the first network interface;
       * `<eth_name_2>` — name of the second network interface;
       * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI. You can find it in the [ticket](#request-parameters-for-connecting-lun-to-the-server);
       * `<mask_1>` — mask of the first server adapter in the segment for iSCSI. You can find it in the [ticket](#request-parameters-for-connecting-lun-to-the-server);
       * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI. You can find it in the [ticket](#request-parameters-for-connecting-lun-to-the-server);
       * `<mask_2>` — mask of the subnet of the second server adapter in the segment for iSCSI. You can find it in the [ticket](#request-parameters-for-connecting-lun-to-the-server).

    7. Set the MTU on the network interfaces:

       ```bash
       Set-NetIPInterface -InterfaceAlias "<eth_name_1>" -AddressFamily IPv4 -NlMtuBytes 9000
       Set-NetIPInterface -InterfaceAlias "<eth_name_2>" -AddressFamily IPv4 -NlMtuBytes 9000
       ```

       Specify:

       * `<eth_name_1>` — name of the first network interface;
       * `<eth_name_2>` — name of the second network interface.

    8. Check that the speed of each interface is at least 10 Gbps:

       ```bash
       Get-NetAdapter | Where-Object { $_.Name -eq "<eth_name_1>" } | Select-Object -Property Name,LinkSpeed
       Get-NetAdapter | Where-Object { $_.Name -eq "<eth_name_2>" } | Select-Object -Property Name,LinkSpeed
       ```

       Specify `<eth_name_1>` and `<eth_name_2>` — the names of the network interfaces configured in step 6.

    9. If the speed is lower than 10 Gbps, create a ticket.

    10. Check that the target is available:

        ```bash
        ping <ip_address_1>
        ping <ip_address_2>
        ```

        Specify:

        * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI. You can find it in the ticket;
        * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI. You can find it in the ticket.

    11. Connect iSCSI target portals:

        ```bash
        New-IscsiTargetPortal -TargetPortalAddress <ip_address_portal_1> -TargetPortalPortNumber 3260 -InitiatorPortalAddress <ip_address_1>
        New-IscsiTargetPortal -TargetPortalAddress <ip_address_portal_2> -TargetPortalPortNumber 3260 -InitiatorPortalAddress <ip_address_2>
        ```

        Specify:

        * `<ip_address_1>` — IP address of the first server network adapter in the segment for iSCSI;
        * `<ip_address_2>` — IP address of the second server network adapter in the segment for iSCSI;
        * `<ip_address_portal_1>` — IP address of the first iSCSI target portal. You can find it in the ticket;
        * `<ip_address_portal_2>` — IP address of the second iSCSI target portal. You can find it in the ticket.

    12. Output the list of targets:

        ```bash
        Get-IscsiTarget
        ```

    13. Configure authentication on the target via the iSCSI interfaces:

        ```bash
        $iusr="<username>"
        $ipasswd="<password>"
        $sts=$(Get-IscsiTarget | Select-Object -ExpandProperty NodeAddress)

        foreach ($st in $sts) {
            $tpaddr=($st -split ":")[-1]
            Connect-IscsiTarget -NodeAddress $st -TargetPortalAddress $tpaddr -TargetPortalPortNumber 3260 -IsPersistent $true -AuthenticationType ONEWAYCHAP -ChapUsername $iusr -ChapSecret $ipasswd
        }
        ```

        Specify:

        * `<username>` — username (login) for CHAP authentication. You can find it in the ticket;
        * `<password>` — password for CHAP authentication. You can find it in the ticket.

    14. Output the list of targets:

        ```bash
        Get-IscsiTarget
        ```

        Example output:

        ```bash
        IsConnected NodeAddress                                                                PSComputerName
        ----------- -----------                                                                --------------
            True iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::20000:203.0.113.101
            True iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::1020001:203.0.113.102
        ```

    15. Ensure that the `IsConnected` parameter is set to `True`.

    16. Launch UltraPath Console.

    17. In the navigation tree, select **Host** → **Disk array**.

    18. Select the LUN disk array.

    19. Ensure that the LUN is available via two paths: select the disk and open the **Path** tab.
  </TabItem>
</Tabs>

## 7. Configure MPIO \{#configure-mpio}

Configuring MPIO combines multiple I/O paths between the server and the storage LUN into one.

<Tabs queryString="configure-mpio">
  <TabItem value="linux" default>
    <TabItemLabel>
      Linux
    </TabItemLabel>

    1. Open the `Device Mapper Multipath` configuration file with the `vi` text editor.

       ```bash
       vi /etc/multipath.conf
       ```

    2. Add a devices section. For the Huawei OceanStor Dorado 5000 V6 storage LUN, we recommend using the parameter values from the example.

       Example of a devices section:

       ```bash
       devices {
           device {
                       vendor                      "HUAWEI"
                       product                     "XSG1"
                       path_grouping_policy         multibus
                       path_checker                tur
                       prio                        const
                       path_selector               "service-time 0"
                       failback                    immediate
                       dev_loss_tmo                30
                       fast_io_fail_tmo            5
                       no_path_retry               15
       }
       }
       ```

    3. Exit the `vi` text editor with changes saved:

       ```bash
       :wq
       ```

    4. Enable and start the service:

       ```bash
       systemctl enable --now multipathd.service
       systemctl status multipathd
       ```

    5. Check the availability of the storage LUN:

       ```bash
       multipath -ll
       ```

       A message about the topology of the multipath device connection will appear in the response.
  </TabItem>
</Tabs>

<Formbricks />
