---
title: "Connect a network volume to a dedicated server with Proxmox OS"
sidebar_label: "Connect a network volume to a server with Proxmox OS"
description: "How to connect a network volume to a dedicated server with Proxmox OS"
sidebar_position: 3
toc_max_heading_level: 2
---

import Formbricks from '@theme/MDXComponents/Formbricks';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import { TabItemLabel } from '@selectel/docux/components';
import CopyIcon from '@selectel/docux/icons/copy';
import SanBlockStorage from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/dedicated/block-storage/san-of-block-storage.mdx';
import ConnectBlockStorageInPanel from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/dedicated/block-storage/connect-block-storage-to-server-in-panel.mdx';

# Connect a network volume to a dedicated server with Proxmox OS

Learn more about network volumes in the [General information about the Network Volumes product](/block-storage/about/about-block-storage.mdx) guide.

1. [Create a SAN network](#create-san).
2. [Connect a network volume to the server](#connect-block-storage-to-server-in-panel).
3. [Connect the network volume to the server in the server OS](#connect-block-storage-to-server-in-os).
4. [Configure MPIO](#configure-mpio).
5. [Add the disk to ProxmoxVE](#add-disk).
6. [Optional: connect a network volume to another server](#connect-block-storage-to-additional-server).

## 1. Create a SAN network \{#create-san}

<SanBlockStorage />

## 2. Connect a network volume to the server \{#connect-block-storage-to-server-in-panel}

<ConnectBlockStorageInPanel />

## 3. Connect the network volume to the server in the server OS \{#connect-block-storage-to-server-in-os}

You can connect a network volume to a server manually or by using a ready-made script generated in the control panel. The script can only be used on Ubuntu OS — see the instructions [Connect a network volume to a dedicated Linux server](/block-storage/manage/connect-block-storage-to-linux.mdx).

<Tabs queryString="configuration-setting">
  <TabItem value="configuration-san" default>
    <TabItemLabel>
      SAN network
    </TabItemLabel>

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

    2. Open the configuration file `/etc/network/interfaces.d/01-san` with the text editor `vi`:

       ```bash
       vi /etc/network/interfaces.d/01-san
       ```

    3. Add IP addresses and routes to the network interfaces connected to the SAN switch to gain access to the iSCSI targets:

       ```bash
       auto <eth_name_1>
       iface <eth_name_1> inet static
           address <ip_address_1>
           up ip route add <destination_subnet_1> via <next_hop_1> dev <eth_name_1>

       auto <eth_name_2>
       iface <eth_name_2> inet static
           address <ip_address_2>
           up ip route add <destination_subnet_2> via <next_hop_2> dev <eth_name_2>
       ```

       Specify:

       * `<eth_name_1>` — the name of the first network interface; it is configured on the first network card port;
       * `<eth_name_2>` — the name of the second network interface; it is configured on the second network card port;
       * `<ip_address_1>` — IP address of the first network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network Volumes and Storage** → tab **Network Volumes** → disk page → block **Network interface configuration** → column **Port IP address**;
       * `<ip_address_2>` — IP address of the second network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network Volumes and Storage** → tab **Network Volumes** → disk page → block **Network interface configuration** → column **Port IP address**;
       * `<destination_subnet_1>` — destination subnet for the first network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network Volumes and Storage** → tab **Network Volumes** → disk page → block **Network interface configuration** → column **Destination subnet**;
       * `<destination_subnet_2>` — destination subnet for the second network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network Volumes and Storage** → tab **Network Volumes** → disk page → block **Network interface configuration** → column **Destination subnet**;
       * `<next_hop_1>` — gateway for the first network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network Volumes and Storage** → tab **Network Volumes** → disk page → block **Network interface configuration** → column **Next hop (gateway)**;
       * `<next_hop_2>` — gateway for the second network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network Volumes and Storage** → tab **Network Volumes** → disk page → block **Network interface configuration** → column **Next hop (gateway)**.

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

       ```bash
       :wq
       ```

    5. Apply the configuration by restarting the network:

       ```bash
       systemctl restart networking
       ```

    6. Display information about network interfaces and verify that they are configured correctly:

       ```bash
       ip a
       ```

    7. Optional: reboot the server.

    8. Check that the speed of each interface is at least 10 Gbit/s:

       ```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 3.

    9. If the speed is lower than 10 Gbit/s, [create a ticket](https://my.selectel.ru/tickets/create).

    10. Check that the iSCSI target is available:

        ```bash
        ping -c5 <iscsi_target_ip_address_1>
        ping -c5 <iscsi_target_ip_address_2>
        ```

        Specify:

        * `<iscsi_target_ip_address_1>` — IP address of the first iSCSI target. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network Volumes and Storage** → tab **Network Volumes** → disk page → block **iSCSI connection configuration** → field **iSCSI target IP address 1**;
        * `<iscsi_target_ip_address_2>` — IP address of the second iSCSI target. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network Volumes and Storage** → tab **Network Volumes** → disk page → block **iSCSI connection configuration** → field **iSCSI target IP address 2**.

    11. Enter the iSCSI initiator name:

        ```bash
        vi /etc/iscsi/initiatorname.iscsi
        InitiatorName= <initiator_name>
        ```

        Specify `<initiator_name>` — iSCSI initiator name. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network Volumes and Storage** → tab **Network Volumes** → disk page → block **iSCSI connection configuration** → field **Initiator name**.

    12. Restart iSCSI:

        ```bash
        systemctl restart iscsid.service
        ```

    13. 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>` — the name of the first iSCSI interface;
        * `<iscsi_eth_name_2>` — the name of the second iSCSI interface.

        iSCSI interface names must not match the names of existing network interfaces. You can view the list of existing network interfaces using the `ip a` command.

    14. Bind the iSCSI interfaces to the network interfaces you configured in step 3:

        ```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 you created in step 13;
        * `<iscsi_eth_name_2>` — name of the second iSCSI interface you created in step 13;
        * `<eth_name_1>` — name of the first network interface you configured in step 3;
        * `<eth_name_2>` — name of the second network interface you configured in step 3.

    15. Check the accessibility of the iSCSI target via the iSCSI interfaces:

        ```bash
        iscsiadm -m discovery -t sendtargets -p <iscsi_target_ip_address_1> --interface <iscsi_eth_name_1>
        iscsiadm -m discovery -t sendtargets -p <iscsi_target_ip_address_2> --interface <iscsi_eth_name_2>
        ```

        Specify:

        * `<iscsi_target_ip_address_1>` — IP address of the first iSCSI target;
        * `<iscsi_target_ip_address_2>` — IP address of the second iSCSI target;
        * `<iscsi_eth_name_1>` — name of the first iSCSI interface you created in step 13;
        * `<iscsi_eth_name_2>` — name of the second iSCSI interface you created in step 13.

        The response will show a list of iSCSI targets. For example:

        ```bash
        10.100.1.2:3260,1 iqn.2003-01.com.redhat.iscsi-gw:workshop-target
        10.100.1.6:3260,2 iqn.2003-01.com.redhat.iscsi-gw:workshop-target
        ```

        Where:

        * `10.100.1.2:3260` — IP address of the first iSCSI target;
        * `iqn.2003-01.com.redhat.iscsi-gw:workshop-target` — IQN of the first iSCSI target. IQN (iSCSI Qualified Name) is the full unique identifier of an iSCSI device;
        * `10.100.1.6:3260` — IP address of the second iSCSI target;
        * `iqn.2003-01.com.redhat.iscsi-gw:workshop-target` — IQN of the second iSCSI target.

    16. Configure CHAP authentication on the iSCSI Initiator:

        ```bash
        iscsiadm --mode node -T <iqn> -p <iscsi_target_ip_address_1> --op update -n node.session.auth.authmethod --value CHAP
        iscsiadm --mode node -T <iqn> -p <iscsi_target_ip_address_2> --op update -n node.session.auth.authmethod --value CHAP
        iscsiadm --mode node -T <iqn> --op update -n node.session.auth.username --value <username>
        iscsiadm --mode node -T <iqn> -p <iscsi_target_ip_address_1> --op update -n node.session.auth.password --value <password>
        iscsiadm --mode node -T <iqn> -p <iscsi_target_ip_address_2> --op update -n node.session.auth.password --value <password>
        ```

        Specify:

        * `<iscsi_target_ip_address_1>` — IP address of the first iSCSI target;
        * `<iscsi_target_ip_address_2>` — IP address of the second iSCSI target;
        * `<iqn>` — IQN of the first and second iSCSI target. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network Volumes and Storage** → tab **Network Volumes** → disk page → block **iSCSI connection configuration** → field **Target name**;
        * `<username>` — username for iSCSI initiator authorization. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network Volumes and Storage** → tab **Network Volumes** → disk page → block **iSCSI connection configuration** → field **Username**;
        * `<password>` — password for iSCSI initiator authorization. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network Volumes and Storage** → tab **Network Volumes** → disk page → block **iSCSI connection configuration** → field **Password**.

    17. Authorize on the iSCSI target via the iSCSI interfaces:

        ```bash
        iscsiadm --mode node -T <iqn> -p <iscsi_target_ip_address_1> --login --interface <iscsi_eth_name_1>
        iscsiadm --mode node -T <iqn> -p <iscsi_target_ip_address_2> --login --interface <iscsi_eth_name_2>
        ```

        Specify:

        * `<iqn>` — IQN of the first and second iSCSI target;
        * `<iscsi_target_ip_address_1>` — IP address of the first iSCSI target;
        * `<iscsi_target_ip_address_2>` — IP address of the second iSCSI target;
        * `<iscsi_eth_name_1>` — name of the first iSCSI interface;
        * `<iscsi_eth_name_2>` — name of the second iSCSI interface.

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

        ```bash
        iscsiadm -m session
        ```

        The response will show two active iSCSI sessions. For example:

        ```bash
        tcp: [1] 10.100.1.2:3260,1 iqn.2003-01.com.redhat.iscsi-gw:workshop-target (non-flash)
        tcp: [3] 10.100.1.6:3260,2 iqn.2003-01.com.redhat.iscsi-gw:workshop-target (non-flash)
        ```

        Here, `[1]` and `[3]` are the iSCSI session numbers.

    19. Enable automatic connection of disks when the server reboots; to do this, set the `node.startup` parameter to automatic:

        ```bash
        iscsiadm --mode node -T <iqn> -p <iscsi_target_ip_address_1> --op update -n node.startup -v automatic
        iscsiadm --mode node -T <iqn> -p <iscsi_target_ip_address_2> --op update -n node.startup -v automatic
        systemctl enable iscsid.service
        systemctl restart iscsid.service
        ```

        Specify:

        * `<iqn>` — IQN of the first and second iSCSI target;
        * `<iscsi_target_ip_address_1>` — IP address of the first iSCSI target;
        * `<iscsi_target_ip_address_2>` — IP address of the second iSCSI target.

    20. Optional: reboot the server.
  </TabItem>
</Tabs>

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

MultiPath-IO (MPIO) is a multi-path I/O mechanism used to improve the fault tolerance of data transfer to a network volume.

1. Update the package list:

   ```bash
   apt update
   apt upgrade
   ```

2. Install multipath:

   ```bash
   apt install multipath-tools
   ```

3. Open the `/etc/multipath.conf` configuration file using the `vi` text editor:

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

4. Insert the following parameters into the configuration file:

   ```bash
   defaults {
       user_friendly_names yes
       find_multipaths yes
   }

   blacklist {
   }
   ```

5. Exit the `vi` text editor and save your changes:

   ```bash
   :wq
   ```

6. Apply the configuration by restarting multipath:

   ```bash
   systemctl restart multipathd
   ```

7. Check the network volume connection and make sure that the `policy` parameter is set to `service-time 0`:

   ```bash
   multipath -ll
   ```

   The command output will display information about devices, paths, and the current policy. For example:

   ```bash
   mpatha (3600140530fab7e779fa41038a0a08f8e) dm-0 LIO-ORG,TCMU device
   size=20G features='0' hwhandler='1 alua' wp=rw
   |-+- policy='service-time 0' prio=10 status=active
   | `- 8:0:0:0 sdc 8:32 active ready running
   `-+- policy='service-time 0' prio=10 status=enabled
   `- 9:0:0:0 sdd 8:48 active ready running
   ```

8. Make sure the `bindings` file contains the WWID of the block device:

   ```bash
   cat /etc/multipath/bindings
   ```

   The command output will display information about the block device WWID. For example:

   ```bash
   # Format:
   # alias wwid
   #
   mpatha 3600140530fab7e779fa41038a0a08f8e
   ```

9. Make sure the `wwids` file contains the WWID of the block device:

   ```bash
   cat /etc/multipath/wwids
   ```

   The command output will display information about the block device WWID. For example:

   ```bash
   # Valid WWIDs:
   /3600140530fab7e779fa41038a0a08f8e/
   ```

## 5. Add a disk to ProxmoxVE \{#add-disk}

1. Open the following page in your browser:

   ```bash
   https://<ip_address>:8006
   ```

   Specify `<ip_address>` — public IP address of the server. You can copy it in the [control panel](https://my.selectel.ru/cloud-servers/): in the top menu, click **Products** → **Dedicated Servers** → server page → tab **Operating System** → in the **IP** field, click <CopyIcon />.

2. In the menu on the left, go to **Datacenter** → **Storage**.

3. In the **Add** field, select **iSCSI**.

4. In the **ID** field, enter a connection name.

5. In the **Portal** field, enter the iSCSI target IP address. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network Volumes and Storage** → tab **Network Volumes** → disk page → block **iSCSI connection configuration** → field **iSCSI target IP address**.

6. In the **Target** field, select the iSCSI target IQN. IQN (iSCSI Qualified Name) is the full unique identifier of an iSCSI device.

7. If there is no iSCSI target IQN in the **Target** field, add it manually:

   7.1. Open the configuration file `/etc/pve/storage.cfg` with the `vi` text editor:

   ```bash
   vi /etc/pve/storage.cfg
   ```

   7.2. Add two connections:

   ```bash
   iscsi: <iscsi_target_name_1>
           portal <iscsi_target_ip_address_1>
           target <iqn>
           content none

   iscsi: <iscsi_target_name_2>
           portal <iscsi_target_ip_address_2>
           target <iqn>
           content none
   ```

   Specify:

   * `<iscsi_target_name_1>` — name of the first connection;
   * `<iscsi_target_ip_address_1>` — IP address of the first iSCSI target. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network Volumes and Storage** → tab **Network Volumes** → disk page → block **iSCSI connection configuration** → field **iSCSI target IP address 1**;
   * `<iscsi_target_name_2>` — name of the second connection;
   * `<iscsi_target_ip_address_2>` — IP address of the second iSCSI target. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network Volumes and Storage** → tab **Network Volumes** → disk page → block **iSCSI connection configuration** → field **iSCSI target IP address 2**;
   * `<iqn>` — IQN of the iSCSI target. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network Volumes and Storage** → tab **Network Volumes** → disk page → block **iSCSI connection configuration** → field **Target name**.

     7.3. Exit the `vi` text editor saving the changes:

   ```bash
   :wq
   ```

8. select the **Enabled** checkbox.

9. select the **Use LUNs directly** checkbox.

10. Click **Add**.

11. In the menu on the left, go to **Datacenter** → **Storage**.

12. Click **Add** and select **LVM**.

13. In the **ID** field, enter the volume name.

14. In the **Base storage** field, select the connection name specified in step 4.

15. In the **Base volume** field, select the network volume.

16. In the **Volume group** field, enter the volume group name.

17. select the **Enable** checkbox.

18. select the **Shared** checkbox.

19. Click **Add**.

## 6. Optional: connect a network volume to another server \{#connect-block-storage-to-additional-server}

1. [Connect the network volume to the server in the control panel](#connect-block-storage-to-server-in-panel).
2. [Connect the network volume to the server in the server OS](#connect-block-storage-to-server-in-os).
3. [Configure MPIO](#configure-mpio).
4. [add the disk in Proxmox VE](#add-disk).

<Formbricks />
