summaryrefslogtreecommitdiff
path: root/mpathpersist/mpathpersist.8
blob: 7b574592d228d142bc6645e8b778ea2833c42d31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
.\" ----------------------------------------------------------------------------
.\" Update the date below if you make any significant change.
.\" Make sure there are no errors with:
.\" groff -z -wall -b -e -t mpathpersist/mpathpersist.8
.\"
.\" ----------------------------------------------------------------------------
.
.TH MPATHPERSIST 8 2019-05-27 "Linux"
.
.
.\" ----------------------------------------------------------------------------
.SH NAME
.\" ----------------------------------------------------------------------------
.
mpathpersist \- Manages SCSI persistent reservations on dm multipath devices.
.
.
.\" ----------------------------------------------------------------------------
.SH SYNOPSIS
.\" ----------------------------------------------------------------------------
.
.B mpathpersist
.RB [\| OPTIONS \|]
.I device
.
.
.\" ----------------------------------------------------------------------------
.SH DESCRIPTION
.\" ----------------------------------------------------------------------------
.
This utility is used to manage SCSI persistent reservations on Device Mapper
Multipath devices. To be able to use this functionality, the \fIreservation_key\fR
attribute must be defined in the \fI/etc/multipath.conf\fR file. Otherwise the
\fBmultipathd\fR daemon will not check for persistent reservation for newly
discovered paths or reinstated paths.
.
.LP
\fBmpathpersist\fR supports the same command-line options as the
\fBsg_persist\fR utility.
.
Consult the \fBsg_persist (8)\fR manual page for an in-depth discussion of the
various options.
.
.\" ----------------------------------------------------------------------------
.SH OPTIONS
.\" ----------------------------------------------------------------------------
.
.TP
.BI \-verbose|\-v " level"
Verbosity:
.RS
.TP 5
.I 0
Critical messages.
.TP
.I 1
Error messages.
.TP
.I 2
Warning messages.
.TP
.I 3
Informational messages.
.TP
.I 4
Informational messages with trace enabled.
.RE
.
.TP
.BI \--device=\fIDEVICE\fB|\-d " DEVICE"
Query or change DEVICE.
.
.TP
.BI \--batch-file=\fIDEVICE\fB|\-f " FILE"
Read commands from \fIFILE\fR. See section \(dqBATCH FILES\(dq below. This
option can be given at most once.
.
.TP
.B \--help|\-h
Output this usage message.
.
.TP
.B \--hex|\-H
Output response in hex.
.
.TP
.B \--in|\-i
Request PR In command.
.
.TP
.B \--out|\-o
Request PR Out command.
.
.TP
.B \--param-alltgpt|\-Y
PR Out parameter 'ALL_TG_PT'.
.
.TP
.B \--param-aptpl|\-Z
PR Out parameter 'APTPL'.
.
.TP
.B \--read-keys|\-k
PR In: Read Keys.
.
.TP
.BI \--param-rk=\fIRK\fB|\-K " RK"
PR Out parameter reservation key (RK is in hex, up to 8 bytes).
.
.TP
.BI \--param-sark=\fISARK\fB|\-S " SARK"
PR Out parameter service action reservation key (SARK is in hex).
.
.TP
.B \--preempt|\-P
PR Out: Preempt.
.
.TP
.B \--clear|\-C
PR Out: Clear registrations.
.
.TP
.B \--preempt-abort|\-A
PR Out: Preempt and Abort.
.
.TP
.BI \--prout-type=\fITYPE\fB|\-T " TYPE"
PR Out command type.
.
.TP
.B \--read-full-status|\-s
PR In: Read Full Status.
.
.TP
.B \--read-keys|\-k
PR In: Read Keys.
.
.TP
.B \--read-reservation|\-r
PR In: Read Reservation.
.
.TP
.B \--register|\-G
PR Out: Register.
.
.TP
.B \--register-ignore|\-I
PR Out: Register and Ignore.
.
.TP
.B \--release|\-L
PR Out: Release.
.
.TP
.B \--report-capabilities|\-c
PR In: Report Capabilities.
.
.TP
.B \--reserve|\-R
PR Out: Reserve.
.
.TP
.BI \--transport-id=\fITIDS\fB|\-X " TIDS"
TransportIDs can be mentioned in several forms.
.
.TP
.BI \--alloc-length=\fILEN\fB|\-l " LEN"
PR In: maximum allocation length. LEN is a decimal number between 0 and 8192.
.
.
.\" ----------------------------------------------------------------------------
.SH EXAMPLE
.\" ----------------------------------------------------------------------------
.
.PP
Register the key \(dq123abc\(dq for the /dev/mapper/mpath9 device:
.RS
\fBmpathpersist --out --register --param-sark=\fI123abc /dev/mapper/mpath9\fR
.RE
.PP
Read registered reservation keys for the /dev/mapper/mpath9 device:
.RS
\fBmpathpersist -i -k \fI/dev/mapper/mpath9\fR
.RE
.PP
Create a reservation for the /dev/mapper/mpath9 device with the given
reservation key:
.RS
\fBmpathpersist --out --reserve --param-rk=\fI123abc \fB--prout-type=\fI8 \fB-d \fI/dev/mapper/mpath9\fR
.RE
.PP
Read the reservation status of the /dev/mapper/mpath9 device:
.RS
\fBmpathpersist -i -s -d \fI/dev/mapper/mpath9\fR
.RE
.PP
Release the previously created reservation (note that the prout-type needs to
be the same as above):
.RS
\fBmpathpersist --out --release --param-rk=\fI123abc \fB--prout-type=\fI8 \fB-d \fI/dev/mapper/mpath9\fR
.RE
.PP
Remove the current key registered for this host (i.e. reset it to 0):
.RS
\fBmpathpersist --out --register-ignore -K \fI123abc\fB -S \fI0\fB \fI/dev/mapper/mpath9\fR
.RE
.PP
Remove current reservation, and unregister all registered keys from all I_T nexuses:
.RS
\fBmpathpersist -oCK \fI123abc \fI/dev/mapper/mpath9\fR
.RE
.
.
.\" ----------------------------------------------------------------------------
.SH BATCH FILES
.\" ----------------------------------------------------------------------------
.
.PP
The option \fI--batch-file\fR (\fI-f\fR) sets an input file to be processed
by \fBmpathpersist\fR. Grouping commands in batch files can provide a speed
improvement in particular on large installments, because \fBmpathpersist\fR
needs to scan existing paths and maps only once during startup.
.
.PP
The input file is a text file that is parsed
line by line. Every line of the file is interpreted as a command line
(i.e. list of options and parameters) for \fBmpathpersist\fR. Options
and parameters are separated by one or more whitespace characters (space or TAB).
Lines can, but do not have to, begin with the word \(dqmpathpersist\(dq.
The \(dq#\(dq character, either at the beginning of the line or following
some whitespace, denotes the start of a comment that lasts until the end of the
line. Empty lines are allowed. Continuation of mpathpersist commands over
multiple lines is not supported.
.
.PP
All options listed in this man page, except \fI-f\fR and
\fI-v\fR, are allowed in batch files. Both short and long option formats may be used.
Using the \fI-f\fR option inside the batch file is an error. The \fI-v\fR
option is ignored in batch files.
.
.PP
The multipath map on which to act must be specified on every input line, e.g. using the \fI-d\fR option.
Commands acting on different multipath maps may be combined in a
batch file, and multiple commands may act on the same multipath
map. Commands are executed one by one, so
that commands further down in the file see status changes caused by previous
commands.
If \fBmpathpersist\fR encounters an error while processing a line in the
batch file, batch file processing is \fBnot\fR aborted; subsequent commands
are executed nonetheless. The exit status of \fBmpathpersist\fR is the status
of the first failed command, or 0 if all commands succeeded.
.
.PP
If other options and parameters are used along with
\fI-f\fR on the \fBmpathpersist\fR command line, the command line will be executed first, followed
by the commands from the batch file.
.
.PP
Below is an example of a valid batch input file.
.
.PP
.RS
.EX
# This is an mpathpersist input file.
# Short and long forms of the same command
-i -k /dev/dm-1 # short form, this comment is ignored
mpathpersist --in --read-keys --device=/dev/dm-1

# Mixing of long and short options, variable white space
  --out  --register    -S  abcde     /dev/dm-1

# Mixing of commands for different maps
-ir /dev/dm-0
-ir /dev/dm-1

mpathpersist --out --param-rk abcde --reserve --prout-type 5 /dev/dm-1
# This should now show a reservation
-ir /dev/dm-1
-oCK abcde /dev/dm-1
--in --read-reservation /dev/dm-1
.EE
.RE
.
.
.\" ----------------------------------------------------------------------------
.SH "SEE ALSO"
.\" ----------------------------------------------------------------------------
.
.BR multipath (8),
.BR multipathd (8),
.BR sg_persist (8).
.
.
.\" ----------------------------------------------------------------------------
.SH AUTHORS
.\" ----------------------------------------------------------------------------
.
\fImultipath-tools\fR was developed by Christophe Varoqui <christophe.varoqui@opensvc.com>
and others.
.\" EOF