Skip to content

Instantly share code, notes, and snippets.

@amadorpahim
Created November 12, 2013 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amadorpahim/7434709 to your computer and use it in GitHub Desktop.
Save amadorpahim/7434709 to your computer and use it in GitHub Desktop.
[root@rhevm30 ~]# cd /var/lib/iscsi
[root@rhevm30 iscsi]# iscsiadm -m iface -I eth1 --op=new
New interface eth1 added
[root@rhevm30 iscsi]# iscsiadm -m iface -I eth2 --op=new
New interface eth2 added
[root@rhevm30 iscsi]# tree
.
`-- ifaces
|-- eth1 <--------------- Local interfaces to provide multipath
`-- eth2 <---------------
1 directory, 2 files
[root@rhevm30 iscsi]# iscsiadm -m discovery -t sendtargets -p 192.168.25.118 -I eth1 -I eth2 <--------------- Discovery using both interfaces
Starting iscsid: [ OK ]
192.168.25.118:3260,1 iqn.2012-07.com.lenovoemc:storage.ix2-73.engine
192.168.25.118:3260,1 iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev33
192.168.25.118:3260,1 iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev30 <--------------- Through eth1
192.168.25.118:3260,1 iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev302
192.168.25.118:3260,1 iqn.2012-07.com.lenovoemc:storage.ix2-73.engine
192.168.25.118:3260,1 iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev33
192.168.25.118:3260,1 iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev30 <--------------- Through eth2
192.168.25.118:3260,1 iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev302
[root@rhevm30 iscsi]# tree
.
|-- ifaces
| |-- eth1
| `-- eth2
|-- nodes
| |-- iqn.2012-07.com.lenovoemc:storage.ix2-73.engine
| | `-- 192.168.25.118,3260,1
| | |-- eth1
| | `-- eth2
| |-- iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev30
| | `-- 192.168.25.118,3260,1
| | |-- eth1 <--------------- Node per interface
| | `-- eth2 <---------------
| |-- iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev302
| | `-- 192.168.25.118,3260,1
| | |-- eth1
| | `-- eth2
| `-- iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev33
| `-- 192.168.25.118,3260,1
| |-- eth1
| `-- eth2
`-- send_targets
`-- 192.168.25.118,3260
|-- iqn.2012-07.com.lenovoemc:storage.ix2-73.engine,192.168.25.118,3260,1,eth1 -> /var/lib/iscsi/nodes/iqn.2012-07.com.lenovoemc:storage.ix2-73.engine/192.168.25.118,3260,1
|-- iqn.2012-07.com.lenovoemc:storage.ix2-73.engine,192.168.25.118,3260,1,eth2 -> /var/lib/iscsi/nodes/iqn.2012-07.com.lenovoemc:storage.ix2-73.engine/192.168.25.118,3260,1
|-- iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev30,192.168.25.118,3260,1,eth1 -> /var/lib/iscsi/nodes/iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev30/192.168.25.118,3260,1
|-- iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev30,192.168.25.118,3260,1,eth2 -> /var/lib/iscsi/nodes/iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev30/192.168.25.118,3260,1
|-- iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev302,192.168.25.118,3260,1,eth1 -> /var/lib/iscsi/nodes/iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev302/192.168.25.118,3260,1
|-- iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev302,192.168.25.118,3260,1,eth2 -> /var/lib/iscsi/nodes/iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev302/192.168.25.118,3260,1
|-- iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev33,192.168.25.118,3260,1,eth1 -> /var/lib/iscsi/nodes/iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev33/192.168.25.118,3260,1
|-- iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev33,192.168.25.118,3260,1,eth2 -> /var/lib/iscsi/nodes/iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev33/192.168.25.118,3260,1
`-- st_config
20 directories, 11 files
[root@rhevm30 iscsi]# multipath -ll <--------------- Nothing yet
[root@rhevm30 iscsi]# iscsiadm -m node -T iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev30 -l <--------------- Login to the target
Logging in to [iface: eth2, target: iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev30, portal: 192.168.25.118,3260] (multiple) <--------------- Two paths
Logging in to [iface: eth1, target: iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev30, portal: 192.168.25.118,3260] (multiple) <---------------
Login to [iface: eth2, target: iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev30, portal: 192.168.25.118,3260] successful.
Login to [iface: eth1, target: iqn.2012-07.com.lenovoemc:storage.ix2-73.rhev30, portal: 192.168.25.118,3260] successful.
[root@rhevm30 iscsi]# multipath -ll <--------------- Now both paths are available and multipath can make its magic.
35005907f318ca6ca dm-2 LENOVO,LIFELINE-DISK
size=50G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=active
| `- 4:0:0:0 sdb 8:16 active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
`- 3:0:0:0 sda 8:0 active ready running
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment