Connect a network volume to a dedicated server with Linux OS
Learn more about network disks in the General information about the Network Disks product instructions.
- Create a SAN network.
- Connect the network disk to the server.
- Connect the network disk to the server in the server OS.
- Configure MPIO.
- Optional: connect the network disk to another server.
- Prepare the network disk for operation.
1. Create a SAN network
-
In the control panel, in the top menu, click Products and select Dedicated Servers.
-
Go to the Network section → SAN network tab.
-
Click Add SAN network.
-
Select an availability zone.
-
Enter a subnet address from the private IP range (
10.0.0.0/8,172.16.0.0/12,192.168.0.0/16) or leave the default generated subnet. The subnet size must be/20.
Make sure that the subnet is not used in your infrastructure. -
Click Create SAN network.
2. Connect the network volume to the server
-
In the control panel, in the top menu, click Products and select Dedicated servers.
-
Go to Network drives and storage systems → the Network drives tab.
-
Open the drive page → the Connect to server tab.
-
In the Server field, click Select.
-
Select the server to which the network volume will be connected.
-
Click Confirm.
-
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, or192.168.0.0/16.
Make sure that the subnet does not overlap with the SAN network that you created in step 1 and that it is not used 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 a server manually or by using a ready-made script generated in the control panel. The script can only be used on Ubuntu OS.
Connect manually
Connect using a script
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 a single port;
-
if the server has two local ports, use the instructions for two ports.
SAN network
Private network: one port
Private network: two ports
-
Connect to the server via SSH or via the KVM console.
-
Check the name of the
netplanutility configuration file:ls /etc/netplan/The response will show the name of the configuration file. For example:
50-cloud-init.yamlCopy the configuration file name.
-
Open the
netplanutility configuration file with thevitext editor:vi /etc/netplan/<file_name>Specify
<file_name>— the configuration file name that you copied in step 2. -
Add IP addresses to the network interfaces connected to the SAN switch and configure routes to access iSCSI targets:
<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 port of the network card;<ip_address_1>— IP address of the first network card port. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → Network interface setup block → Port IP address column;<destination_subnet_1>— destination subnet for the first network card port. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → Network interface setup block → Destination subnet column;<next_hop_1>— gateway for the first network card port. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → Network interface setup block → Next hop (gateway) column;<eth_name_2>— the name of the second network interface; it is configured on the second port of the network card;<ip_address_2>— IP address of the second network card port. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → Network interface setup block → Port IP address column;<destination_subnet_2>— destination subnet for the second network card port. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → Network interface setup block → Destination subnet column;<next_hop_2>— gateway for the second network card port. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → Network interface setup block → Next hop (gateway) column.
-
Press the ESC key.
-
Exit the
vitext editor saving the changes::wq -
Apply the configuration:
netplan apply -
Display network interface information and make sure that they are configured correctly:
ip a -
Optional: reboot the server.
-
Verify that the speed of each interface is at least 10 Gbps:
ethtool <eth_name_1> | grep -i speedethtool <eth_name_2> | grep -i speedSpecify
<eth_name_1>and<eth_name_2>— the names of the network interfaces that you configured in step 4. -
If the speed is lower than 10 Gbps, submit a ticket.
-
Verify that the iSCSI target is accessible:
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 find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → iSCSI connection setup block → iSCSI target 1 IP address field;<iscsi_target_ip_address_2>— IP address of the second iSCSI target. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → iSCSI connection setup block → iSCSI target 2 IP address field.
-
Enter the iSCSI initiator name:
vi /etc/iscsi/initiatorname.iscsiInitiatorName= <initiator_name>Specify
<initiator_name>— the iSCSI initiator name. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → iSCSI connection setup block → Initiator name field. -
Restart iSCSI:
systemctl restart iscsid.servicesystemctl restart multipathd.service -
Create iSCSI interfaces:
iscsiadm -m iface -I <iscsi_eth_name_1> --op newiscsiadm -m iface -I <iscsi_eth_name_2> --op newSpecify:
<iscsi_eth_name_1>— name of the first iSCSI interface;<iscsi_eth_name_2>— name of the second iSCSI interface.
The names of iSCSI interfaces must not match the names of existing network interfaces. You can view the list of existing network interfaces using the
ip acommand. -
Bind the 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 15;<eth_name_1>— the name of the first network interface that you configured in step 4;<iscsi_eth_name_2>— the name of the second iSCSI interface that you created in step 15;<eth_name_2>— the name of the second network interface that you configured in step 4.
-
Verify the accessibility of the iSCSI target via 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>— IP address of the first iSCSI target. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → iSCSI connection setup block → iSCSI target 1 IP address field;<iscsi_eth_name_1>— the name of the first iSCSI interface that you created in step 15;<iscsi_target_ip_address_2>— IP address of the second iSCSI target. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → iSCSI connection setup block → iSCSI target 2 IP address field;<iscsi_eth_name_2>— the name of the second iSCSI interface that you created in step 15.
The response will show the list of iSCSI targets. For example:
10.100.1.2:3260,1 iqn.2003-01.com.redhat.iscsi-gw:workshop-target10.100.1.6:3260,2 iqn.2003-01.com.redhat.iscsi-gw:workshop-targetWhere:
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 the 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.
-
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 CHAPiscsiadm --mode node -T <iqn> -p <iscsi_target_ip_address_2> --op update -n node.session.auth.authmethod --value CHAPiscsiadm --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>— IQN of the first and second iSCSI targets. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → iSCSI connection setup block → Target name field;<iscsi_target_ip_address_1>— IP address of the first iSCSI target. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → iSCSI connection setup block → iSCSI target 1 IP address field;<iscsi_target_ip_address_2>— IP address of the second iSCSI target. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → iSCSI connection setup block → iSCSI target 2 IP address field;<username>— username for iSCSI initiator authorization. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → iSCSI connection setup block → Username field;<password>— password for iSCSI initiator authorization. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → iSCSI connection setup block → Password field.
-
Authenticate to 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>— IQN of the first and second iSCSI targets. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → iSCSI connection setup block → Target name field;<iscsi_target_ip_address_1>— IP address of the first iSCSI target. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → iSCSI connection setup block → iSCSI target 2 IP address field;<iscsi_eth_name_1>— the name of the first iSCSI interface that you created in step 15;<iscsi_target_ip_address_2>— IP address of the second iSCSI target. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → iSCSI connection setup block → iSCSI target 2 IP address field;<iscsi_eth_name_2>— the name of the second iSCSI interface that you created in step 15.
-
Verify that an iSCSI session has been started for each iSCSI target:
iscsiadm -m sessionThe 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 the iSCSI session numbers. -
Enable automatic disk attachment on server reboot by setting the
node.startupparameter toautomaticmode:iscsiadm --mode node -T <iqn> -p <iscsi_target_ip_address_1> --op update -n node.startup -v automaticiscsiadm --mode node -T <iqn> -p <iscsi_target_ip_address_2> --op update -n node.startup -v automaticsystemctl enable iscsid.servicesystemctl restart iscsid.serviceSpecify:
<iqn>— IQN of the first and second iSCSI targets. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → iSCSI connection setup block → Target name field;<iscsi_target_ip_address_1>— IP address of the first iSCSI target. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → iSCSI connection setup block → iSCSI target 1 IP address field;<iscsi_target_ip_address_2>— IP address of the second iSCSI target. You can find it in the Control panel: in the top menu, click Products → Dedicated Servers → Network Disks and Storage section → Network Disks tab → disk page → iSCSI connection setup block → IP-адрес iSCSI-таргета 1 field.
-
Optional: reboot the server.
4. Configure MPIO
MultiPath-IO (MPIO) is multipath I/O designed to improve the fault tolerance of data transfer to a network disk.
In Ubuntu OS, MPIO is configured by default; verify the settings.
-
Open the
Device Mapper Multipathutility configuration file in thevitext editor:vi /etc/multipath.conf -
Make sure that the
/etc/multipath.conffile contains only the following lines:defaults {user_friendly_names yes} -
Make sure that the
bindingsfile contains information about the block device WWID:cat /etc/multipath/bindingsThe response will display information about the block device WWID. For example:
# Format:# alias wwid#mpatha 3600140530fab7e779fa41038a0a08f8e -
Make sure that the
wwidsfile contains information about the block device WWID:cat /etc/multipath/wwidsThe response will display information about the block device WWID. For example:
# Valid WWIDs:/3600140530fab7e779fa41038a0a08f8e/ -
Verify the network disk connection and make sure that the
policyparameter is set toservice-time 0:multipath -llThe response will display information about devices, paths, and the current policy. For example:
mpatha (3600140530fab7e779fa41038a0a08f8e) dm-0 LIO-ORG,TCMU devicesize=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: attach the network disk to another server
- Attach the network disk to the server in the Control Panel.
- Connect the network disk to the server in the server OS.
- Configure MPIO.
6. Prepare the network disk for use
To share access between multiple servers, we recommend using cluster file systems.
The network disk attached to the server can be formatted to the desired file system:
-
A cluster file system (CFS) is a file system that allows multiple servers (nodes) to simultaneously work with the same data on shared storage. Examples of cluster file systems:
- GFS2 (Global File System 2); for more information, see GFS2 Overview in the official Red Hat documentation;
- OCFS2 (Oracle Cluster File System 2); for more information, see the official Oracle Linux documentation.
-
Logical Volume Manager (LVM) is storage virtualization software designed for flexible management of physical storage devices. For more information, see Configuring and managing logical volumes in the official Red Hat documentation;
-
a standard file system, such as
ext4orXFS. Note that in read-write mode, a standard file system can only be used on one server at a time to avoid data corruption. To speed up the formatting process when creating the file system, use the-Koption, which disables zero-initialization (discard) of disk blocks.Example command to format a file system:
mkfs -t <filesystem> -K /dev/mapper/<block_storage_name>Specify:
<filesystem>— file system type, for example,ext4orxfs;<block_storage_name>— name of the network disk; you can find it using themultipath -llcommand.
-
VMFS (VMware File System) is a cluster file system used by VMware ESXi to store virtual machine files. It supports shared storage access by multiple ESXi hosts. VMFS automatically manages locks — preventing simultaneous modifications of virtual machine files, ensuring data integrity. For more information, see VMware vSphere VMFS in the official VMware Storage documentation.