Skip to main content

Connect the network volume to a dedicated server with Linux OS

Read more about network volumes in the guide General information about the Network Volumes product.

  1. Create a SAN network.
  2. Connect the network volume to the server.
  3. Connect the network volume to the server in the server OS.
  4. Configure MPIO.
  5. Optional: connect the network volume to another server.
  6. Prepare the network volume for operation.

1. Create a SAN network

  1. In the Control panel, on the top menu, click Products and select Dedicated Servers.

  2. Go to the Network → tab SAN network.

  3. Click Add SAN network.

  4. Select an availability zone.

  5. Enter a subnet address from the private range (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) or keep the default subnet. The subnet size must be /20.
    Ensure that the subnet is not used in your infrastructure.

  6. Click Create SAN network.

2. Connect the network volume to the server

  1. In the Control panel, on the top menu, click Products and select Dedicated Servers.

  2. Go to the Network Volumes and Storage section → Network Volumes tab.

  3. Open the volume page → Connect to Server tab.

  4. In the Server field, click Select.

  5. Select the server to which the network volume will be connected.

  6. Click Confirm.

  7. If you are connecting a network volume to a server with a private network, configure the network:

    7.1. Select a VLAN.

    7.2. Enter the subnet CIDR from the private address range 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16.
    Ensure that the subnet does not overlap with the SAN network you created in step 1 and that you are not using it elsewhere in your infrastructure.

    7.3. Enter the Next hop 1 and Next hop 2 addresses from the selected private subnet.

    7.4. Click Configure.

3. Connect the network volume to the server in the server OS

You can connect a network volume to the server manually or with the help of a ready-made script, which is formed in the control panel. The script can be used only on Ubuntu OS.

You can connect a network volume via a SAN network or through a private network.

The process of connecting a network volume in the server OS through a private subnet depends on the number of ports:

  • if the server has only one local port or MC-LAG is configured, use the instructions for one port;

  • if the server has two local ports, use the instructions for two ports.

    1. Connect to the server via SSH or through the KVM console.

    2. Open the configuration file of the netplan utility with the vi text editor:

      vi /etc/netplan/50-cloud-init.yaml
    3. Add IP addresses and define routes to access iSCSI targets on the network interfaces connected to the SAN switch:

      <eth_name_1>:
      addresses:
      - <ip_address_1>
      routes:
      - to: <destination_subnet_1>
      via: <next_hop_1>
      <eth_name_2>:
      addresses:
      - <ip_address_2>
      routes:
      - to: <destination_subnet_2>
      via: <next_hop_2>

      Specify:

      • <eth_name_1> — the name of the first network interface; it is configured on the first network card port;
      • <ip_address_1> — the IP address of the first network card port. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring network interfaces → column Port IP address;
      • <destination_subnet_1> — the destination subnet for the first network card port. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring network interfaces → column Destination Subnet;
      • <next_hop_1> — the gateway for the first network card port. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring network interfaces → column Next hop (gateway);
      • <eth_name_2> — the name of the second network interface; it is configured on the second network card port;
      • <ip_address_2> — the IP address of the second network card port. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring network interfaces → column Port IP address;
      • <destination_subnet_2> — the destination subnet for the second network card port. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring network interfaces → column Destination Subnet;
      • <next_hop_2> — the gateway for the second network card port. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring network interfaces → column Next hop (gateway).
    4. Exit the vi text editor with your changes saved:

      :wq
    5. Apply the configuration:

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

      ip a
    7. Optional: reboot the server.

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

      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 you configured in step 3.

    9. If the speed is lower than 10 Gbit/s, create a ticket.

    10. Verify that the iSCSI target is available:

      ping -c5 <iscsi_target_ip_address_1>
      ping -c5 <iscsi_target_ip_address_2>

      Specify:

      • <iscsi_target_ip_address_1> — the IP address of the first iSCSI target. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field IP address of the iSCSI target 1;
      • <iscsi_target_ip_address_2> — the IP address of the second iSCSI target. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field IP address of the iSCSI target 2.
    11. Enter the iSCSI initiator name:

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

      Specify <initiator_name> – the iSCSI initiator name. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field Initiator name.

    12. Restart iSCSI:

      systemctl restart iscsid.service
      systemctl restart multipathd.service
    13. Create iSCSI interfaces:

      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.
    14. Bind iSCSI interfaces to network interfaces:

      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> — the name of the first iSCSI interface that you created in step 13;
      • <eth_name_1> — the name of the first network interface that you configured in step 3;
      • <iscsi_eth_name_2> — the name of the second iSCSI interface that you created in step 13;
      • <eth_name_2> — the name of the second network interface that you configured in step 3.
    15. Verify the availability of the iSCSI target via the iSCSI interfaces:

      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> — the IP address of the first iSCSI target. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field IP address of the iSCSI target 1;
      • <iscsi_eth_name_1> — the name of the first iSCSI interface that you created in step 13;
      • <iscsi_target_ip_address_2> — the IP address of the second iSCSI target. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field IP address of the iSCSI target 2;
      • <iscsi_eth_name_2> — the name of the second iSCSI interface that you created in step 13.

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

      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 — the IP address of the first iSCSI target;
      • iqn.2003-01.com.redhat.iscsi-gw:workshop-target — the IQN of the first iSCSI target. IQN (iSCSI Qualified Name) is the full unique identifier of an iSCSI device;
      • 10.100.1.6:3260 — the IP address of the second iSCSI target;
      • iqn.2003-01.com.redhat.iscsi-gw:workshop-target — the IQN of the second iSCSI target.
    16. Configure CHAP authentication on the iSCSI initiator:

      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:

      • <iqn> — the IQN of the first and second iSCSI target. You can view them in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field Target name;
      • <iscsi_target_ip_address_1> — the IP address of the first iSCSI target. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field IP address of the iSCSI target 1;
      • <iscsi_target_ip_address_2> — the IP address of the second iSCSI target. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field IP address of the iSCSI target 2;
      • <username> — the iSCSI initiator authorization username. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field Username;
      • <password> — the iSCSI initiator authorization password. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field Password.
    17. Authorize the iSCSI target via the iSCSI interfaces:

      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> — the IQN of the first and second iSCSI target. You can view them in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field Target name;
      • <iscsi_target_ip_address_1> — the IP address of the first iSCSI target. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field IP address of the iSCSI target 2;
      • <iscsi_eth_name_1> — the name of the first iSCSI interface that you created in step 13;
      • <iscsi_target_ip_address_2> — the IP address of the second iSCSI target. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field IP address of the iSCSI target 2;
      • <iscsi_eth_name_2> — the name of the second iSCSI interface that you created in step 13.
    18. Verify that the iSCSI session for each iSCSI target has started:

      iscsiadm -m session

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

      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)

      Where [1] and [3] are iSCSI session numbers.

    19. Enable automatic disk connection when the server reboots; to do this, set the node.startup parameter to automatic mode:

      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> — the IQN of the first and second iSCSI target. You can view them in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field Target name;
      • <iscsi_target_ip_address_1> — the IP address of the first iSCSI target. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field IP address of the iSCSI target 1;
      • <iscsi_target_ip_address_2> — the IP address of the second iSCSI target. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field IP address of the iSCSI target 1.
    20. Optional: reboot the server.

4. Configure MPIO

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

In Ubuntu, MPIO is configured by default; check the settings.

  1. Open the configuration file of the Device Mapper Multipath utility with the vi text editor:

    vi /etc/multipath.conf
  2. Make sure the /etc/multipath.conf file contains only the following lines:

    defaults {
    user_friendly_names yes
    }
  3. Make sure the bindings file contains information about the WWID of the block device:

    cat /etc/multipath/bindings

    The response will display information about the WWID of the block device. For example:

    # Format:
    # alias wwid
    #
    mpatha 3600140530fab7e779fa41038a0a08f8e
  4. Make sure the wwids file contains information about the WWID of the block device:

    cat /etc/multipath/wwids

    The response will display information about the WWID of the block device. For example:

    # Valid WWIDs:
    /3600140530fab7e779fa41038a0a08f8e/
  5. Check the network volume connection and make sure that the policy parameter is set to service-time 0:

    multipath -ll

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

    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

5. Optional: connect the network volume to another server

  1. Connect the network volume to the server in the control panel.
  2. Connect the network volume to the server in the server OS.
  3. Configure MPIO.

6. Prepare the network volume for operation

For shared access between multiple servers, we recommend using cluster file systems.

You can format the network volume that you connected to the server to the desired file system:

  • a cluster file system (CFS) is a file system that allows multiple servers (nodes) to work simultaneously with the same data on shared storage. Examples of cluster file systems:

    • GFS2 (Global File System 2); for more details, see GFS2 Overview in the official Red Hat documentation;
    • OCFS2 (Oracle Cluster File System 2); for more details, see the official Oracle Linux documentation.
  • Logical Volume Manager (LVM) is software for storage virtualization, designed for flexible management of physical storage devices. For more details, see the Configuring and managing logical volumes instructions in the official Red Hat documentation;

  • a standard file system, for example, ext4 or XFS. Note that a standard file system can be used on only one server at a time in read-write mode to prevent data corruption. To speed up the formatting process when creating a file system, use the -K option, which disables zeroing (discard) of disk blocks.

    Example command for formatting the file system:
    mkfs -t <filesystem> -K /dev/mapper/<block_storage_name>

    Specify:

    • <filesystem> — the file system type, for example, ext4 or xfs;
    • <block_storage_name> — the name of the network volume; you can view it using the multipath -ll command.
  • VMFS (VMware File System) is a cluster file system used by VMware ESXi to store virtual machine files. It supports shared access to storage by multiple ESXi hosts. VMFS automatically manages locks, which prevents virtual machine files from being modified simultaneously, ensuring data integrity. For more details, see the VMware vSphere VMFS instructions in the official VMware Storage documentation.