iSCSI on Oracle Linux - Quick Start Guide

Linux

Audience
Public
Product
FlashBlade
FlashArray
Technology Integrations
Linux
Source Type
Documentation
Important:

Vendor Documentation Priority: This guide is for reference only. Always consult official vendor documentation for your distribution. Test thoroughly in a lab environment before production use.

Note: For detailed explanations, alternative configurations, and troubleshooting: See iSCSI Best Practices

Prerequisites:

  • Oracle Linux 8.x or 9.x with UEK R7 (5.15+) recommended

  • FlashArray configured with portal IPs and target IQN

  • Dedicated storage network interfaces

  • Root or sudo access

Note:

New to iSCSI? See the Storage Terminology Glossary

Warning:

If using multiple interfaces on the same subnet, configure ARP settings. See ARP Configuration.

  1. Install Packages:
    sudo dnf install -y iscsi-initiator-utils device-mapper-multipath
    sudo systemctl enable --now iscsid multipathd
  2. Configure Network Interfaces:
    # First storage interface
    sudo nmcli connection add type ethernet \
        con-name storage-1 \
        ifname <INTERFACE_NAME_1> \
        ipv4.method manual \
        ipv4.addresses <HOST_IP_1>/<CIDR> \
        ipv4.never-default yes \
        802-3-ethernet.mtu 9000 \
        connection.autoconnect yes
    
    # Second storage interface
    sudo nmcli connection add type ethernet \
        con-name storage-2 \
        ifname <INTERFACE_NAME_2> \
        ipv4.method manual \
        ipv4.addresses <HOST_IP_2>/<CIDR> \
        ipv4.never-default yes \
        802-3-ethernet.mtu 9000 \
        connection.autoconnect yes
    
    # Activate
    sudo nmcli connection up storage-1
    sudo nmcli connection up storage-2
    Warning:

    If both interfaces are on the same subnet, configure ARP settings. See ARP Configuration.

  3. Configure Firewall:

    Add storage interfaces to trusted zone (recommended for dedicated storage networks):

    # Check if firewalld is running (skip if not installed, e.g., minimal/cloud images)
    if systemctl is-active --quiet firewalld; then
        sudo firewall-cmd --permanent --zone=trusted --add-interface=<INTERFACE_NAME_1>
        sudo firewall-cmd --permanent --zone=trusted --add-interface=<INTERFACE_NAME_2>
        sudo firewall-cmd --reload
    else
        echo "firewalld not running - skipping firewall configuration"
    fi
    Note:

    Alternative: For port filtering options, see Best Practices - Firewall Configuration.

  4. Configure iSCSI Initiator:
    # View/generate initiator name
    cat /etc/iscsi/initiatorname.iscsi
    
    # Set automatic startup
    sudo sed -i 's/^node.startup = manual/node.startup = automatic/' /etc/iscsi/iscsid.conf
    sudo systemctl restart iscsid

    Register this initiator IQN on FlashArray.

  5. Create Interface Bindings:
    # Create and bind first interface
    sudo iscsiadm -m iface -I iface0 --op=new
    sudo iscsiadm -m iface -I iface0 --op=update -n iface.net_ifacename -v <INTERFACE_NAME_1>
    
    # Create and bind second interface
    sudo iscsiadm -m iface -I iface1 --op=new
    sudo iscsiadm -m iface -I iface1 --op=update -n iface.net_ifacename -v <INTERFACE_NAME_2>
  6. Discover and Login:
    # Discover targets
    sudo iscsiadm -m discovery -t sendtargets -p <PORTAL_IP_1>:3260
    sudo iscsiadm -m discovery -t sendtargets -p <PORTAL_IP_2>:3260
    
    # Login via each interface to each portal
    sudo iscsiadm -m node -T <TARGET_IQN> -p <PORTAL_IP_1>:3260 -I iface0 --login
    sudo iscsiadm -m node -T <TARGET_IQN> -p <PORTAL_IP_2>:3260 -I iface0 --login
    sudo iscsiadm -m node -T <TARGET_IQN> -p <PORTAL_IP_1>:3260 -I iface1 --login
    sudo iscsiadm -m node -T <TARGET_IQN> -p <PORTAL_IP_2>:3260 -I iface1 --login
    
    # Set automatic login
    sudo iscsiadm -m node -T <TARGET_IQN> --op=update -n node.startup -v automatic
    
    # Verify sessions
    sudo iscsiadm -m session
  7. Configure Multipath:

    Create /etc/multipath.conf:

    sudo tee /etc/multipath.conf > /dev/null <<'EOF'
    defaults {
        find_multipaths      no
        polling_interval     10
        path_selector        "service-time 0"
        path_grouping_policy group_by_prio
        failback             immediate
        no_path_retry        0
    }
    
    # Blacklist local devices and NVMe to prevent dm-multipath management
    # NVMe uses native multipath (nvme_core multipath=Y), not dm-multipath
    blacklist {
        # Local boot devices (adjust patterns for your environment)
        devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
        devnode "^sd[a]$"    # Adjust if boot device differs
    
        # All NVMe devices - use native NVMe multipath instead
        devnode "^nvme"
    
        # Virtual devices
        devnode "^vd[a-z]"
    }
    
    # Add device-specific settings for your storage array
    # Default configurations for many storage arrays are included in the multipath package
    # Example for a storage array supporting ALUA:
    #devices {
    #    device {
    #        vendor           "VENDOR"
    #        product          "PRODUCT"
    #        path_selector    "service-time 0"
    #        hardware_handler "1 alua"
    #        path_grouping_policy group_by_prio
    #        prio             alua
    #        failback         immediate
    #        path_checker     tur
    #        fast_io_fail_tmo 10
    #        dev_loss_tmo     60
    #        no_path_retry    0
    #    }
    #}
    EOF
    
    # Restart multipathd to apply configuration
    sudo systemctl restart multipathd
    
    # Verify multipath devices (should only show iSCSI devices)
    sudo multipath -ll
    Tip:
    • Why blacklist local and NVMe devices?

      • Local devices: Prevents dm-multipath from managing boot drives and local storage

      • NVMe devices: NVMe uses native kernel multipath (nvme_core multipath=Y), not dm-multipath. Managing NVMe with dm-multipath causes conflicts and performance issues.

    • Why find_multipaths no?

      This ensures ALL paths to iSCSI storage devices are claimed by multipath immediately, rather than waiting to detect multiple paths. See iSCSI Best Practices for detailed explanation.

  8. Create LVM Storage:
    # Find multipath device
    sudo multipath -ll
    # Example: mpatha
    
    # Create LVM
    sudo pvcreate /dev/mapper/mpatha
    sudo vgcreate iscsi-storage /dev/mapper/mpatha
    sudo lvcreate -L 500G -n data iscsi-storage
    
    # Format and mount (Oracle Linux: XFS recommended)
    sudo mkfs.xfs /dev/iscsi-storage/data
    sudo mkdir -p /mnt/iscsi-storage
    sudo mount /dev/iscsi-storage/data /mnt/iscsi-storage
    
    # Add to fstab
    echo '/dev/iscsi-storage/data /mnt/iscsi-storage xfs defaults,_netdev 0 0' | sudo tee -a /etc/fstab
  9. Verify Configuration:
    # Check sessions
    sudo iscsiadm -m session
    
    # Check multipath
    sudo multipath -ll
    
    # Verify storage
    df -h | grep iscsi
    Note:

    Quick Reference

    Command Description
    sudo iscsiadm -m session List active iSCSI sessions
    sudo iscsiadm -m discovery -t sendtargets -p <IP>:3260 Discover targets
    sudo iscsiadm -m node -T <IQN> -p <IP>:3260 --login Login to target
    sudo iscsiadm -m node -T <IQN> -p <IP>:3260 --logout Logout from target
    sudo multipath -ll Show multipath devices

For production deployments, see iSCSI Best Practices for:

  • Network design and VLAN configuration

  • Multipath configuration details

  • Security best practices (SELinux, CHAP, firewall options)

  • Monitoring

  • High availability considerations

  • UEK vs RHCK kernel selection

  • Ksplice zero-downtime updates

Additional Resources: