san-multipath

JSON

rev 1  |  foxhop  |  1396966479000  |  JSON

empty
rev 1
tt1 
2Multipath
3##########
4 
5What is multipath?
6 In computer storage, multipath I/O is a fault-tolerance and performance
7 enhancement technique whereby there is more than one physical path between
8 the CPU in a computer system and it's mass storage devices through the
9 buses, controllers, switches, and bridge devices connecting them.
10 
11 Futher reading (multipath): http://en.wikipedia.org/wiki/Multipath_I/O  
12 
13What problem does multipath software solve?
14 When we have multiple paths to a disk, our operating system views each
15 path as a separate device.  For example if we have 2 paths to a Logical
16 Unit (LUN), linux will see */dev/sdb* and */dev/sdc*.  We need the operating
17 system to treat these multiple paths as one logical device.  We do this
18 with multipath software.  
19 
20The multipath software will detect multiple paths to the LUN and map these
21paths to one device which we use like a normal disk.
22 
23Multipath Architecture Example
24==============================
25 
26The industry standard for a fabric switched environment is 4 paths to a LUN.
27We describe this fault-tolerant architecture in the example below -
28 
29**lhost999**: an example server with two HBA ports (A & B)
30 
31* HBA *A*
32 
33 - Fabric Switch A
34 
35* HBA *B*
36 
37 - Fabric Switch B
38 
39**SAN**: an example SAN with two Controllers, each with two HBA ports
40 
41* Controller 1
42 
43 - Fabric Switch A
44 - Fabric Switch B
45 
46* Controller 2
47 
48 - Fabric Switch A
49 - Fabric Switch B
50 
51This architecture supplies lhost999 with 4 paths to the disk.  
52 
53We could loose *Controller 2* and *Fabric Switch A* and still
54have a single path to the disk between the host and the LUN::
55 
56  lhost999 -> Fabric Switch B -> Controller 1 -> SAN -> LUN
57 
58Multipathing software not only maintains a logical device for the multiple
59paths, but also gracefully switches between paths during outages.
60 
61Multipath Architecture Definitions
62==================================
63 
64**HBA**
65 In computer hardware, a host controller, host adapter, or host bus adapter
66 connects a host system (the computer) to other network and storage devices.
67 
68 Futher reading (HBA):
69 https://en.wikipedia.org/wiki/Host_adapter
70 
71**Fabric Switch**
72 Switched fabric, switching fabric, or just fabric, is a network topology
73 where network nodes connect with each other via one or more network switches
74 (particularly via crossbar switches, hence the name). 
75 
76 Further reading (Fabric networking): 
77 http://en.wikipedia.org/wiki/Switched_fabric
78 
79 
80Install Multipath Software
81==========================
82 
83The following sub-sections will document how to install multipathing software
84on various operating systems:
85 
86 
87Ubuntu
88------
89 
90The following procedure will install multipathing software on an
91Ubuntu 12.04 LTS server:
92 
93Install Software::
94 
95 apt-get install -y multipath-tools
96 apt-get install -y multipath-tools-boot
97 
98Enable the multipathd service if needed.
99 
100Redhat
101------
102 
103The following procedure will install multipathing sofware on a
104Redhat Enterprise Linux 5 server:
105 
106Install Software::
107 
108 yum install device-mapper-multipath
109 
110Enable the multipathd service if needed.
111 
112Ask for and verify multiple paths
113---------------------------------
114 
115#. After you `Install Multipath Software`_ ask SAN admins to present
116   multiple paths to server or blade profile.  They may ask for
117   the servers HBA WWNs.
118 
119#. Wait for SAN admins to respond in the affirmative.
120 
121#. Scan for SAN presented devices or reboot the host.
122 
123#. Verify 4 paths to the device::
124 
125    multipath -ll
126    multipath -v2
127 
128Admin Commands for SAN device
129=============================
130 
131This section documents a list of useful SAN device administration commands.
132 
133 
134List the HBAs
135-------------
136 
137.. code-block:: bash
138 
139 lspci | grep HBA
140 
141.. code-block:: bash
142 
143 06:00.0 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Expr
 >ess HBA (rev 03)
144 06:00.1 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Expr
 >ess HBA (rev 03)
145 2a:00.0 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Expr
 >ess HBA (rev 03)
146 2a:00.1 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Expr
 >ess HBA (rev 03)
147 
148.. code-block:: bash
149 
150 sudo grep -i qlogic /var/log/dmesg
151 
152.. code-block:: bash
153 
154  QLogic Fibre Channel HBA Driver
155   QLogic Fibre Channel HBA Driver: 8.03.01.04.05.05-k
156    QLogic QLE2462 - QLogic 4GB FC Dual-Port PCI-E HBA for IBM System x
157   QLogic Fibre Channel HBA Driver: 8.03.01.04.05.05-k
158    QLogic QLE2462 - QLogic 4GB FC Dual-Port PCI-E HBA for IBM System x
159   QLogic Fibre Channel HBA Driver: 8.03.01.04.05.05-k
160    QLogic QLE2462 - QLogic 4GB FC Dual-Port PCI-E HBA for IBM System x
161   QLogic Fibre Channel HBA Driver: 8.03.01.04.05.05-k
162    QLogic QLE2462 - QLogic 4GB FC Dual-Port PCI-E HBA for IBM System x
163 
164 
165View the paths and health
166--------------------------
167 
168.. code-block:: bash
169 
170 multipath -ll 
171 multipath -v2
172 
173.. code-block:: bash
174 
175 mpath0 (350002ac0343408b4) dm-6 3PARdata,VV
176 [size=100G][features=1 queue_if_no_path][hwhandler=0]
177 \_ round-robin 0 [prio=0][active]
178  \_ 3:0:0:0 sdb 8:16  [active][undef]
179  \_ 5:0:0:0 sdc 8:32  [active][undef]
180 
181As you can see this server only seems to have 2 paths to the LUN. 
182 
183 
184Determine a LUN identifier
185--------------------------
186 
187.. code-block:: bash
188 
189 ls -hal /dev/disk/by-id/
190 
191 
192Determine scsi_host or fc_host IDs
193----------------------------------
194 
195These ids are used when scanning the bus for devices: 
196 
197.. code-block:: bash
198 
199 ls /sys/class/scsi_host/ | grep host
200 ls /sys/class/fc_host/ | grep host
201 
202Scan for presented devices
203--------------------------
204 
205Any of the following commands may be used to scan storage interconnects:
206 
207 #. Scan or rescan for presented LUNS without rebooting host:
208 
209    .. code-block:: bash
210 
211       echo '- - -' > /sys/class/scsi_host/host0/scan
212       echo '- - -' > /sys/class/scsi_host/host1/scan
213 
214 #. Perform a Loop Initialization Protocol (LIP) which scans the interconnect
215    and causes the SCSI layer to be updated to reflect the devices currently
216    on the bus.
217 
218    .. code-block:: bash
219           
220       sudo echo "1" > /sys/class/fc_host/host3/issue_lip
221       sudo echo "1" > /sys/class/fc_host/host4/issue_lip
222 
223 
224Issue with PXE Booting Debian
225=============================
226 
227On the UCS blade servers, only one path to the boot LUN should be presented
228to a host when pxe-booting.  This only becomes an issue when rebuilding an
229existing system who had multiple paths configured.  To resolve, message SAN
230and ask them to only present one path to the boot LUN.
231 
232 further reading (Debian Installer):
233  https://wiki.debian.org/DebianInstaller/MultipathSupport