Connect a network volume to a dedicated server with Proxmox 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.
- Add the disk to ProxmoxVE.
- Optional: connect the network disk to another server.
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 a 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 disk to the server manually or using a ready-made script generated in the control panel. The script can only be used on Ubuntu OS — for details, see the Connect a network disk to a Linux dedicated server instructions.
SAN network
-
Connect to the server via SSH or via the KVM console.
-
Open the configuration file
/etc/network/interfaces.d/01-sanwith thevitext editor:vi /etc/network/interfaces.d/01-san -
Add IP addresses and routes to the network interfaces connected to the SAN switch to gain access to the iSCSI targets:
auto <eth_name_1>iface <eth_name_1> inet staticaddress <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 staticaddress <ip_address_2>up ip route add <destination_subnet_2> via <next_hop_2> dev <eth_name_2>Specify:
<eth_name_1>— name of the first network interface configured on the first port of the network card;<eth_name_2>— name of the second network interface configured on the second port of the network card;<ip_address_1>— IP address of the first port of the network card. 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 section → Port IP address column;<ip_address_2>— IP address of the second port of the network card. 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 section → Port IP address column;<destination_subnet_1>— destination subnet for the first port of the network card. 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 section → Destination subnet column;<destination_subnet_2>— destination subnet for the second port of the network card. 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 section → Destination subnet column;<next_hop_1>— gateway for the first port of the network card. 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 section → Next hop (gateway) column;<next_hop_2>— gateway for the second port of the network card. 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 section → Next hop (gateway) column.
-
Exit the
vitext editor saving changes::wq -
Apply the configuration by restarting the network:
systemctl restart networking -
Display information about network interfaces and verify that they are configured correctly:
ip a -
Optional: reboot the server.
-
Check that the speed of each interface is at least 10 Gbit/s:
ethtool <eth_name_1> | grep -i speedethtool <eth_name_2> | grep -i speedSpecify
<eth_name_1>and<eth_name_2>— names of the network interfaces configured in step 3. -
If the speed is below 10 Gbps, create a ticket.
-
Check 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>— 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 section → IP address of iSCSI target 1 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 section → IP address of iSCSI target 2 field.
-
Enter the iSCSI initiator name:
vi /etc/iscsi/initiatorname.iscsiInitiatorName= <initiator_name>Specify
<initiator_name>– name of the iSCSI initiator. 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 section → Initiator name field. -
Restart iSCSI:
systemctl restart iscsid.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.
iSCSI interface names 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 the network interfaces you configured in step 3:
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.
-
Check the accessibility 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>— 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:
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:
<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 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 section → Target name 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 section → 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 section → Password field.
-
Authorize on 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 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.
-
Check that the iSCSI session for each iSCSI target has started:
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)Here,
[1]and[3]are the iSCSI session numbers. -
Enable automatic connection of disks upon server reboot by setting the
node.startupparameter to automatic: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 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.
-
Optional: reboot the server.
4. 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.
-
Update the package list:
apt updateapt upgrade -
Install multipath:
apt install multipath-tools -
Open the configuration file
/etc/multipath.confwith thevitext editor:vi /etc/multipath.conf -
Insert the following parameters into the configuration file:
defaults {user_friendly_names yesfind_multipaths yes}blacklist {} -
Exit the
vitext editor saving changes::wq -
Apply the configuration by restarting multipath:
systemctl restart multipathd -
Check the network disk connection and make sure that the
policyparameter is set toservice-time 0:multipath -llThe command output 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 -
Make sure that the
bindingsfile contains information about the block device WWID:cat /etc/multipath/bindingsThe command output 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 command output will display information about the block device WWID. For example:
# Valid WWIDs:/3600140530fab7e779fa41038a0a08f8e/
5. Add a disk to ProxmoxVE
-
Open the following page in your browser:
https://<ip_address>:8006Specify
<ip_address>— the server's public IP address. You can copy it in the control panel: in the top menu, click Products → Dedicated Servers → server page → Operating System tab → in the IP field, click . -
In the left-hand menu, go to Datacenter → Storage.
-
In the Add field, select iSCSI.
-
In the ID field, enter the connection name.
-
In the Portal field, enter the iSCSI target IP address. 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 section → IP address of iSCSI target field.
-
In the Target field, select the iSCSI target IQN. IQN (iSCSI Qualified Name) is the full unique identifier of the iSCSI device.
-
If there is no iSCSI target IQN in the Target field, add it manually:
7.1. Open the configuration file
/etc/pve/storage.cfgwith thevitext editor:vi /etc/pve/storage.cfg7.2. Add two connections:
iscsi: <iscsi_target_name_1>portal <iscsi_target_ip_address_1>target <iqn>content noneiscsi: <iscsi_target_name_2>portal <iscsi_target_ip_address_2>target <iqn>content noneSpecify:
-
<iscsi_target_name_1>— name of the first connection; -
<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 section → IP address of iSCSI target 1 field; -
<iscsi_target_name_2>— name of the second connection; -
<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 section → IP address of iSCSI target 2 field; -
<iqn>— IQN of the 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 section → Target name field.7.3. Exit the
vitext editor saving changes:
:wq -
-
Select the Enabled checkbox.
-
Select the Use LUNs directly checkbox.
-
Click Add.
-
In the left-hand menu, go to Datacenter → Storage.
-
Click Add and select LVM.
-
In the ID field, enter the volume name.
-
In the Base storage field, select the connection name specified in step 4.
-
In the Base volume field, select the network disk.
-
In the Volume group field, enter the volume group name.
-
Select the Enable checkbox.
-
Select the Shared checkbox.
-
Click Add.