Skip to main content

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.

The storage LUN must be connected to each server individually.

  1. Make sure you have requested to connect the storage LUN to this server.
  2. Connect to the server.
  3. Install the iSCSI initiator. If Windows is installed on the server, go to step 4.
  4. Display information about the iSCSI initiator.
  5. Request parameters for connecting the storage LUN to the server.
  6. Set up the iSCSI connection.
  7. Configure MPIO.

1. Check the request to connect the storage LUN to the server

Check that in the ticket for ordering the service, you requested to connect the storage LUN to this server.

If you did not request connecting this server, create a ticket. In the ticket, specify the server UUID or IP address. You can find it in the Control panel: in the top menu, click Products and select Dedicated Servers → Servers → server page → Operating system tab → IP field.

2. Connect to the server

3. Install the iSCSI initiator

apt-get update && apt-get install open-iscsi multipath-tools

4. Display information about the iSCSI initiator

cat /etc/iscsi/initiatorname.iscsi

5. Request parameters for connecting the storage LUN to the server

  1. Create a ticket requesting parameters for connecting the storage LUN to the server. Specify the information about the iSCSI initiator that you obtained when displaying 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 Servercore technician.

6. Set up an iSCSI connection

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

  1. View the name of the netplan utility configuration file:

    ls /etc/netplan/

    The response will show the name of the configuration file. For example:

    50-cloud-init.yaml

    Copy the name of the configuration file.

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

    vi /etc/netplan/<file_name>

    Specify <file_name> — the name of the configuration file that you copied in step 1.

  3. Configure two network interfaces on the server. Add IP addresses to the network interfaces connected to the SAN switch to get access to the iSCSI targets:

    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 server's first network adapter in the iSCSI segment. You can find it in the ticket;
    • <mask_1> — subnet mask of the server's first adapter in the iSCSI segment. You can find it in the ticket;
    • <ip_address_2> — IP address of the server's second network adapter in the iSCSI segment. You can find it in the ticket;
    • <mask_2> — subnet mask of the server's second adapter in the iSCSI segment. You can find it in the ticket.
  4. Press ESC.

  5. Exit the vi text editor saving the changes:

    :wq
  6. Apply the configuration:

    netplan apply
  7. Optional: reboot the server.

  8. Check the speed of each interface. It must be at least 10 Gbps:

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

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

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

  10. Check that the iSCSI target is available:

    ping -c5 <ip_address_1>
    ping -c5 <ip_address_2>

    Specify:

    • <ip_address_1> — IP address of the server's first network adapter in the iSCSI segment;
    • <ip_address_2> — IP address of the server's second network adapter in the iSCSI segment.
  11. 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> — name of the first iSCSI interface;
    • <iscsi_eth_name_2> — name of the second iSCSI interface.
  12. Bind the iSCSI interfaces to the network interfaces 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;
    • <iscsi_eth_name_2> — name of the second iSCSI interface;
    • <eth_name_1> — name of the first network interface that you configured in step 3;
    • <eth_name_2> — name of the second network interface that you configured in step 3.
  13. Check the availability of the iSCSI target via the iSCSI interfaces:

    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 server's first network adapter in the iSCSI segment;
    • <ip_address_2> — IP address of the server's second network adapter in the iSCSI segment;
    • <iscsi_eth_name_1> — name of the first iSCSI interface;
    • <iscsi_eth_name_2> — name of the second iSCSI interface.

    The response will show a list of iSCSI targets.

    For example:

    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 server's first network adapter in the iSCSI segment;
    • 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 server's second network adapter in the iSCSI segment;
    • iqn.2006-08.com.huawei:oceanstor:2100d859825625ee::1020000:203.0.113.102 — IQN of the second iSCSI target.
  14. Copy the IQN of each iSCSI target. IQN (iSCSI Qualified Name) is the full unique identifier of an iSCSI device.

  15. Configure CHAP authentication on the iSCSI initiator:

    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 server's first network adapter in the iSCSI segment;
    • <ip_address_2> — IP address of the server's second network adapter in the iSCSI segment;
    • <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.
  16. Log in to the iSCSI target via the iSCSI interfaces:

    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 server's first network adapter in the iSCSI segment;
    • <ip_address_2> — IP address of the server's second network adapter in the iSCSI segment;
    • <iscsi_eth_name_1> — name of the first iSCSI interface;
    • <iscsi_eth_name_2> — name of the second iSCSI interface.
  17. Check that the iSCSI session has started for each iSCSI target:

    iscsiadm -m session

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

    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)

    Where [5] and [6] are the iSCSI session numbers.

  18. Duplicate the iSCSI session for each iSCSI target:

    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 that you retrieved in step 17.

  19. Check that the SCSI sessions have been duplicated:

    iscsiadm -m session

    The response will show four active iSCSI sessions.

  20. Make sure that the settings will be applied when the server restarts:

    iscsiadm -m node --loginall=automatic
    systemctl enable iscsi.service
    systemctl enable iscsid.service
  21. For each target, configure two iSCSI sessions that start automatically when the server is rebooted:

    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 server's first network adapter in the iSCSI segment;
    • <ip_address_2> — IP address of the server's second network adapter in the iSCSI segment;
    • <number_of_sessions> — the number of iSCSI sessions to start automatically when the server is rebooted.
  22. Optional: reboot the server.

7. Configure MPIO

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

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

    vi /etc/multipath.conf
  2. Add the devices section. For the Huawei OceanStor Dorado 5000 V6 storage LUN, we recommend using parameter values from the example.

    Example of the devices section:

    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 saving the changes:

    :wq
  4. Enable and start the service:

    systemctl enable --now multipathd.service
    systemctl status multipathd
  5. Check the availability of the storage LUN:

    multipath -ll

    The response will display a message about the multipath device connection topology.