rhel iscsi multipathing

Red Hat iSCSI Setup mit iscsiadm:

 

 

1. Paket "iscsi-initiator-utils.x86_64" mit iSCSI Tool installieren:
Installing:

  • iscsi-initiator-utils         
  • Installing for dependencies:
  • iscsi-initiator-utils-iscsiuio

2. Eigener Initiatior-Name steht in:


cat /etc/iscsi/initiatorname.iscsi


InitiatorName=iqn.1994-05.com.redhat:f74688615844

3. Auf Target: iGroup erzeugen, Initiatornamen des Clients eintragen, LUN mappen.

 

 

4. lokales iSCSI-Interface erzeugen:

 


iscsiadm -m iface -P 1 -I iscsi1 -o new


dabei wird /var/lib/iscsi/ifaces/iscsi1 angelegt. Inhalt:


# BEGIN RECORD 6.2.0.873-35
iface.iscsi_ifacename = iscsi1
iface.transport_name = tcp
iface.vlan_id = 0
iface.vlan_priority = 0
iface.iface_num = 0
iface.mtu = 0
iface.port = 0
iface.tos = 0
iface.ttl = 0
iface.tcp_wsf = 0
iface.tcp_timer_scale = 0
iface.def_task_mgmt_timeout = 0
iface.erl = 0
iface.max_receive_data_len = 0
iface.first_burst_len = 0
iface.max_outstanding_r2t = 0
iface.max_burst_len = 0
# END RECORD

 

5. Target Discovery starten:
iscsiadm -m discoverydb -P 3 -t sendtargets -p <target ip or FQDN> --discover
iscsiadm -m discoverydb -P 3 -t sendtargets -p <target ip or FQDN> --discover

 

Abfrageergebnis:


iscsiadm -m discovery -P3
SENDTARGETS:
DiscoveryAddress: 172.28.30.140,3260
DiscoveryAddress: 172.28.30.141,3260
Target: iqn.1992-08.com.netapp:sn.86dd44121eab11e7823200a0981d9998:vs.5
        Portal: 172.28.30.141:3260,1029
                Iface Name: iscsi1
        Portal: 172.28.30.142:3260,1030
                Iface Name: iscsi1
DiscoveryAddress: 172.28.30.142,3260
iSNS:
No targets found.
STATIC:
No targets found.
FIRMWARE:
No targets found.

 

 

6. Am Target einloggen:
iscsiadm --mode node --targetname iqn.1992-08.com.netapp:sn.86dd44121eab11e7823200a0981d9998:vs.5 --login
Logging in to [iface: iscsi1, target: iqn.1992-08.com.netapp:sn.86dd44121eab11e7823200a0981d9998:vs.5, portal: 172.28.30.142,3260] (multiple)
Logging in to [iface: iscsi1, target: iqn.1992-08.com.netapp:sn.86dd44121eab11e7823200a0981d9998:vs.5, portal: 172.28.30.141,3260] (multiple)
Login to [iface: iscsi1, target: iqn.1992-08.com.netapp:sn.86dd44121eab11e7823200a0981d9998:vs.5, portal: 172.28.30.142,3260] successful.
Login to [iface: iscsi1, target: iqn.1992-08.com.netapp:sn.86dd44121eab11e7823200a0981d9998:vs.5, portal: 172.28.30.141,3260] successful.

Ergebnis Abfrage:
iscsiadm -m session -P1


Target: iqn.1992-08.com.netapp:sn.86dd44121eab11e7823200a0981d9998:vs.5 (non-flash)
        Current Portal: 172.28.30.142:3260,1030
        Persistent Portal: 172.28.30.142:3260,1030
                **********
                Interface:
                **********
                Iface Name: iscsi1
                Iface Transport: tcp
                Iface Initiatorname: iqn.1994-05.com.redhat:f74688615844
                Iface IPaddress: 172.28.20.16
                Iface HWaddress: <empty>
                Iface Netdev: <empty>
                SID: 1
                iSCSI Connection State: LOGGED IN
                iSCSI Session State: LOGGED_IN
                Internal iscsid Session State: NO CHANGE
        Current Portal: 172.28.30.141:3260,1029
        Persistent Portal: 172.28.30.141:3260,1029
                **********
                Interface:
                **********
                Iface Name: iscsi1
                Iface Transport: tcp
                Iface Initiatorname: iqn.1994-05.com.redhat:f74688615844
                Iface IPaddress: 172.28.20.16
                Iface HWaddress: <empty>
                Iface Netdev: <empty>
                SID: 2
                iSCSI Connection State: LOGGED IN
                iSCSI Session State: LOGGED_IN
                Internal iscsid Session State: NO CHANGE

Es werden direkt für die gemappten LUNs Devices angelegt.

7. Multipathing, DM-Paket installieren:
yum install device-mapper-multipath.x86_64
Installing:

  • device-mapper-multipath     
  • Installing for dependencies:
  • boost-system                
  • boost-thread                
  • device-mapper-multipath-libs
  • librados2                   

8. Kernel-Modul manuell laden:
modprobe dm_multipath
Beispiel Konfigfile nutzen:
cp /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /etc/
lokale Disks in /etc/multipath.conf auf die Blacklist setzen:


blacklist {
        devnode "sda"
}


Multipath-Daemon starten:

systemctl start multipathd.service
Ergebnis überprüfen:
systemctl status multipathd.service
systemctl status multipathd.service -l
? multipathd.service - Device-Mapper Multipath Device Controller
   Loaded: loaded (/usr/lib/systemd/system/multipathd.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2017-04-13 11:11:53 EDT; 3min 44s ago
  Process: 11248 ExecStart=/sbin/multipathd (code=exited, status=0/SUCCESS)
  Process: 11244 ExecStartPre=/sbin/multipath -A (code=exited, status=0/SUCCESS)
  Process: 11242 ExecStartPre=/sbin/modprobe dm-multipath (code=exited, status=0/SUCCESS)
 Main PID: 11251 (multipathd)
   CGroup: /system.slice/multipathd.service
           +-11251 /sbin/multipathd

Apr 13 11:11:53 localhost.localdomain systemd[1]: Starting Device-Mapper Multipath Device Controller...
Apr 13 11:11:53 localhost.localdomain systemd[1]: Started Device-Mapper Multipath Device Controller.
Apr 13 11:11:53 localhost.localdomain multipathd[11251]: 3600a09804d543732425d4a6e58635434: load table [0 10485760 multipath 4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handler 0 2 1 service-time 0 1 1 8:32 1 service-time 0 1 1 8:16 1]
Apr 13 11:11:53 localhost.localdomain multipathd[11251]: 3600a09804d543732425d4a6e58635434: event checker started
Apr 13 11:11:53 localhost.localdomain multipathd[11251]: path checkers start up

9. Pfade abfragen:
multipath -ll


3600a09804d543732425d4a6e58635434 dm-2 NETAPP  ,LUN C-Mode
size=5.0G features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=50 status=active
| `- 34:0:0:0 sdc 8:32 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
  `- 33:0:0:0 sdb 8:16 active ready running

5. Target manuell hinzufügen:
iscsiadm -m node -P 1 -n svm-iscsi -o new -T iqn.1992-08.com.netapp:sn.86dd44121eab11e7823200a0981d9998:vs.5 -p 172.28.30.141:3260 -I iscsi1
iscsiadm -m node -P 1 -n svm-iscsi -o new -T iqn.1992-08.com.netapp:sn.86dd44121eab11e7823200a0981d9998:vs.5 -p 172.28.30.142:3260 -I iscsi1
Ergebnis:
New iSCSI node [tcp:[hw=,ip=,net_if=,iscsi_if=iscsi1] 172.28.30.140,3260,-1 iqn.1992-08.com.netapp:sn.86dd44121eab11e7823200a0981d9998:vs.5] added