Move /var/svc/log to /var/log/svc
[unleashed/lotheac.git] / share / man / man8 / stmfadm.8
blobb27ac4387dba309e6fcefb21d1f08496d0eee5cf
1 .\"
2 .\" The contents of this file are subject to the terms of the
3 .\" Common Development and Distribution License (the "License").
4 .\" You may not use this file except in compliance with the License.
5 .\"
6 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7 .\" or http://www.opensolaris.org/os/licensing.
8 .\" See the License for the specific language governing permissions
9 .\" and limitations under the License.
10 .\"
11 .\" When distributing Covered Code, include this CDDL HEADER in each
12 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
13 .\" If applicable, add the following below this CDDL HEADER, with the
14 .\" fields enclosed by brackets "[]" replaced with your own identifying
15 .\" information: Portions Copyright [yyyy] [name of copyright owner]
16 .\"
17 .\"
18 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
19 .\" Copyright 2016 Nexenta Systems, Inc.
20 .\"
21 .Dd March 1, 2016
22 .Dt STMFADM 8
23 .Os
24 .Sh NAME
25 .Nm stmfadm
26 .Nd SCSI target mode framework command line interface
27 .Sh SYNOPSIS
28 .Nm
29 .Cm add-hg-member
30 .Fl g Ar host-group
31 .Ar initiator Ns ...
32 .Nm
33 .Cm add-tg-member
34 .Fl g Ar target-group
35 .Ar target Ns ...
36 .Nm
37 .Cm add-view
38 .Op Fl h Ar host-group
39 .Op Fl n Ar lu-number
40 .Op Fl t Ar target-group
41 .Ar lu-name
42 .Nm
43 .Cm create-hg
44 .Ar group-name
45 .Nm
46 .Cm create-lu
47 .Oo Fl p Ar property Ns = Ns Ar value Oc Ns ...
48 .Op Fl s Ar size
49 .Ar lu-file
50 .Nm
51 .Cm create-tg
52 .Ar group-name
53 .Nm
54 .Cm delete-hg
55 .Ar group-name
56 .Nm
57 .Cm delete-lu
58 .Op Fl k
59 .Ar lu-name
60 .Nm
61 .Cm delete-tg
62 .Ar group-name
63 .Nm
64 .Cm import-lu
65 .Ar lu-file
66 .Nm
67 .Cm list-hg
68 .Op Fl v
69 .Oo Ar host-group Oc Ns ...
70 .Nm
71 .Cm list-lu
72 .Op Fl v
73 .Oo Ar lu-name Oc Ns ...
74 .Nm
75 .Cm list-state
76 .Nm
77 .Cm list-target
78 .Op Fl v
79 .Oo Ar target Oc Ns ...
80 .Nm
81 .Cm list-tg
82 .Op Fl v
83 .Oo Ar target-group Oc Ns ...
84 .Nm
85 .Cm list-view
86 .Fl l Ar lu-name
87 .Oo Ar view Oc Ns ...
88 .Nm
89 .Cm modify-lu
90 .Op Fl f
91 .Oo Fl p Ar property Ns = Ns Ar value Oc Ns ...
92 .Op Fl s Ar size
93 .Ar lu-arg
94 .Nm
95 .Cm offline-lu
96 .Ar lu-name
97 .Nm
98 .Cm offline-target
99 .Ar target
101 .Cm online-lu
102 .Ar lu-name
104 .Cm online-target
105 .Ar target
107 .Cm remove-hg-member
108 .Fl g Ar host-group
109 .Ar initiator Ns ...
111 .Cm remove-tg-member
112 .Fl g Ar target-group
113 .Ar target Ns ...
115 .Cm remove-view
116 .Op Fl a
117 .Fl l Ar lu-name
118 .Ar view Ns ...
119 .Sh DESCRIPTION
122 command configures logical units within the SCSI Target Mode Framework
123 .Pq STMF
124 framework.
125 The framework and this man page use the following terminology:
126 .Bl -tag -width Ds
127 .It Sy initiator
128 A device responsible for issuing SCSI I/O commands to a SCSI target and logical
129 unit.
130 .It Sy target
131 A device responsible for receiving SCSI I/O commands for a logical unit.
132 .It Sy logical unit
133 A device within a target responsible for executing SCSI I/O commands.
134 .It Sy logical unit number
135 The identifier of a logical unit within a target.
136 .It Sy host group
137 An host group is a set of one or more initiators that are combined for the
138 purposes of being applied to a
139 .Sy view
140 .Pq see below .
141 An initiator cannot be a member of more than one host group.
142 .It Sy target group
143 A target group is a set of one or more SCSI target ports that are treated the
144 same when creating a
145 .Sy view
146 .Pq see below .
147 The set of logical units that a particular SCSI initiator can see is determined
148 by the combined set of views.
150 Each logical unit has a set of view entries, and each view entry specifies a
151 target group, host group, and a LUN.
152 An initiator from that host group, when connecting through that target group, is
153 able to identify and connect to that logical unit using the specified LUN.
154 You can use views to restrict the set of logical units that a specific initiator
155 can see, and assign the set of LUNs that will be used.
156 .It Sy view
157 A view defines the association of a host group, a target group, and a logical
158 unit number with a specified logical unit.
159 Any view entry added to a logical unit must not be in conflict with existing
160 view entries for that logical unit.
161 A view entry is considered to be in conflict when an attempt is made to
162 duplicate the association of any given host, target and logical unit number.
164 .Ss Logical Unit Properties
165 The following logical unit properties can be set only when creating LU using
166 .Cm create-lu
167 subcommand:
168 .Bl -tag -width Ds
169 .It Sy blk Ns = Ns Ar num
170 Specifies the block size for the device.
171 The default is 512.
172 .It Sy guid Ns = Ns Ar string
173 32 hexadecimal ASCII characters representing a valid NAA Registered Extended
174 Identifier.
175 The default is set by the STMF to a generated value.
176 .It Sy meta Ns = Ns Ar path
177 Metadata file name.
178 When specified, will be used to hold the SCSI metadata for the logical unit.
179 There is no default.
180 .It Sy oui Ns = Ns Ar string
181 Organizational Unique Identifier.
182 Six hexadecimal ASCII characters representing the IEEE OUI company ID
183 assignment.
184 This will be used to generate the device identifier
185 .Pq GUID .
186 The default is
187 .Sy 00144F .
188 .It Sy pid Ns = Ns Ar string
189 16 bytes ASCII string defining Product ID per SCSI SPC-3.
190 This value will be reflected in the Standard INQUIRY data returned for the
191 device.
192 The default is
193 .Sy COMSTAR .
194 .It Sy serial Ns = Ns Ar string
195 Serial Number.
196 Specifies the SCSI Vital Product Data Serial Number
197 .Pq page 80h .
198 It is a character value up to 252 bytes in length.
199 There is no default value.
200 .It Sy vid Ns = Ns Ar string
201 8 bytes ASCII string defining Vendor ID per SCSI SPC-3.
202 This value will be reflected in the Standard INQUIRY data returned for the
203 device.
204 The default is
205 .Sy SUN .
208 The following logical unit properties can be set when creating LU using
209 .Cm create-lu
210 subcommand or modified using
211 .Cm modify-lu
212 subcommand:
213 .Bl -tag -width Ds
214 .It Sy alias Ns = Ns Ar string
215 Up to 255 characters, representing a user-defined name for the device.
216 The default is the name of the backing store.
217 .It Sy mgmt-url Ns = Ns Ar string
218 Up to 1024 characters representing a Management Network Address URL.
219 More than one URL can be passed as a single parameter by using space-delimited
220 URLs enclosed inside a single pair of quotation marks
221 .Pq Sy \(dq .
222 .It Sy wcd Ns = Ns Sy true Ns | Ns Sy false
223 Write-back cache disable.
224 Determines write-back cache disable behavior.
225 The default is the write-back cache setting of the backing store device
226 specified by the
227 .Ar lu-file
228 argument.
229 .It Sy wp Ns = Ns Sy true Ns | Ns Sy false
230 Write-protect bit.
231 Determines whether the device reports as write-protected.
232 The default is
233 .Sy false .
235 .Ss Subcommands
238 command supports the subcommands listed below.
239 .Bl -tag -width Ds
240 .It Xo
242 .Cm add-hg-member
243 .Fl g Ar host-group
244 .Ar initiator Ns ...
246 Add a host group member to a host group.
248 An initiator cannot be a member of more than one host group.
249 .Bl -tag -width Ds
250 .It Fl g Ns , Ns Fl -group-name Ar host-group
251 Specifies group name.
252 .Ar host-group
253 must be an existing group created using the
254 .Cm create-hg
255 subcommand.
257 .It Xo
259 .Cm add-tg-member
260 .Fl g Ar target-group
261 .Ar target Ns ...
263 Add a target group member to a target group.
265 A target cannot be a member of more than one target group.
266 .Bl -tag -width Ds
267 .It Fl g Ns , Ns Fl -group-name Ar target-group
268 Specifies group name.
269 .Ar target-group
270 must be an existing group created using the
271 .Cm create-tg
272 subcommand.
274 .It Xo
276 .Cm add-view
277 .Op Fl h Ar host-group
278 .Op Fl n Ar lu-number
279 .Op Fl t Ar target-group
280 .Ar lu-name
282 Add a logical unit view entry to a logical unit
283 .Ar lu-name ,
284 where
285 .Ar lu-name
286 is the STMF name for the logical unit as displayed by the
287 .Cm list-lu
288 subcommand.
290 .Cm add-view
291 subcommand provides the user with a mechanism to implement access control for a
292 logical unit and also provides a means of assigning a logical unit number to a
293 logical unit for a given set of initiators and targets.
294 A logical unit will not be available to any initiators until at least one view
295 is applied.
296 Each view entry gets assigned an entry name, which can be used to reference the
297 entry in the
298 .Cm list-view
300 .Cm remove-view
301 subcommands.
302 .Bl -tag -width Ds
303 .It Fl h Ns , Ns Fl -host-group Ar host-group
304 .Ar host-group
305 is the name of an host group previously created using
306 .Cm create-hg
307 subcommand.
308 If this option is not specified, the logical unit will be available to all
309 initiators that log in to the STMF framework.
310 .It Fl n Ns , Ns Fl -lun Ar lu-number
311 .Ar lu-number
312 is an integer in the range 0-16383 to be assigned to the logical unit for this
313 view entry.
314 If this option is not specified, a logical unit number will be assigned by the
315 STMF framework.
316 .It Fl t Ns , Ns Fl -target-group Ar target-group
317 .Ar target-group
318 is the name of a target group previously created using
319 .Cm create-tg
320 subcommand.
321 If this option is not specified, the logical unit will be available through all
322 targets.
324 .It Xo
326 .Cm create-hg
327 .Ar group-name
329 Create a host group with the name
330 .Ar group-name .
331 .Ar group-name
332 is a string of Unicode characters with a maximum length of 255.
333 The group name must be unique within the STMF system.
334 .It Xo
336 .Cm create-lu
337 .Oo Fl p Ar property Ns = Ns Ar value Oc Ns ...
338 .Op Fl s Ar size
339 .Ar lu-file
341 Create a logical unit that can be registered with STMF.
342 .Ar lu-file
343 is the file to be used as the backing store for the logical unit.
344 If the
345 .Fl s
346 option is not specified, the size of the specified
347 .Ar lu-file
348 will be used as the size of the logical unit.
350 Logical units registered with the STMF require space for the metadata to be
351 stored.
352 When a
353 .Sy zvol
354 is specified as the backing store device, the default will be to use a special
355 property of the
356 .Sy zvol
357 to contain the metadata.
358 For all other devices, the default behavior will be to use the first 64k of the
359 device.
360 An alternative approach would be to use the
361 .Sy meta
362 property in a
363 .Cm create-lu
364 subcommand to specify an alternate file to contain the metadata.
365 It is advisable to use a file that can provide sufficient storage of the logical
366 unit metadata, preferably 64k.
367 .Bl -tag -width Ds
368 .It Fl p Ns , Ns Fl -lu-prop Ar property Ns = Ns Ar value
369 Set specified logical unit property.
370 Check
371 .Sx Logical Unit Properties
372 for the list of available properties.
373 .It Fl s Ns , Ns Fl -size Ar size
374 .Ar size
375 is an integer followed by one of the following letters, to indicate a unit of
376 size:
377 .Sy k , m , g , t , p , e ,
378 specifying kilobyte, megabyte, gigabyte, terabyte, petabyte and exabyte
379 respectively.
381 .It Xo
383 .Cm create-tg
384 .Ar group-name
386 Create a target group with the name
387 .Ar group-name .
388 .Ar group-name
389 is a string of Unicode characters with a maximum length of 255.
390 The group name must be unique within the STMF system.
391 .It Xo
393 .Cm delete-hg
394 .Ar group-name
396 Delete the host group identified by
397 .Ar group-name .
398 .It Xo
400 .Cm delete-lu
401 .Op Fl k
402 .Ar lu-name
404 Delete an existing logical unit that was created using
405 .Cm create-lu
406 subcommand.
407 This effectively unloads the logical unit from the STMF framework.
408 Any existing data on the logical unit remains intact.
409 .Bl -tag -width Ds
410 .It Fl k Ns , Ns Fl -keep-views
411 Keep view entries for this logical unit.
413 .It Xo
415 .Cm delete-tg
416 .Ar group-name
418 Delete the target group identified by
419 .Ar group-name .
420 .It Xo
422 .Cm import-lu
423 .Ar lu-file
425 Import and load a logical unit into the STMF that was previously created using
426 .Cm create-lu
427 subcommand and was then deleted from the STMF using
428 .Cm delete-lu
429 subcommand.
430 On success, the logical unit is again made available to the STMF.
431 .Ar lu-file
432 is the filename used in the
433 .Cm create-lu
434 subcommand.
435 If this logical unit is using a separate metadata file, the filename in the
436 .Sy meta
437 property value that was used in the
438 .Cm create-lu
439 subcommand must be used here.
440 .It Xo
442 .Cm list-hg
443 .Op Fl v
444 .Oo Ar host-group Oc Ns ...
446 List information for the host group in the system referenced by
447 .Ar host-group .
449 .Ar host-group
450 is not specified, all host groups in the system will be listed.
451 .Bl -tag -width Ds
452 .It Fl v Ns , Ns Fl -verbose
453 Display all host group members.
455 .It Xo
457 .Cm list-lu
458 .Op Fl v
459 .Oo Ar lu-name Oc Ns ...
461 List information for the logical unit in the system referenced by
462 .Ar lu-name .
464 .Ar lu-name
465 is not specified, all logical units in the system will be listed.
466 .Bl -tag -width Ds
467 .It Fl v Ns , Ns Fl -verbose
468 Display verbose information about the logical unit.
470 .It Xo
472 .Cm list-state
474 List the operational and configuration state of the STMF.
475 .It Xo
477 .Cm list-target
478 .Op Fl v
479 .Oo Ar target Oc Ns ...
481 List information for the target port in the system referenced by
482 .Ar target .
483 If target name is not specified, all target ports in the system will be listed.
484 .Bl -tag -width Ds
485 .It Fl v Ns , Ns Fl -verbose
486 Display verbose information about the target along with SCSI session information
487 for logged-in initiators.
489 .It Xo
491 .Cm list-tg
492 .Op Fl v
493 .Oo Ar target-group Oc Ns ...
495 List information for the target group in the system referenced by
496 .Ar target-group .
498 .Ar target-group
499 is not specified, all target groups in the system will be listed.
500 .Bl -tag -width Ds
501 .It Fl v Ns , Ns Fl -verbose
502 Display all group members.
504 .It Xo
506 .Cm list-view
507 .Fl l Ar lu-name
508 .Oo Ar view Oc Ns ...
510 List the view entry for the logical unit referenced by
511 .Ar lu-name .
513 .Ar view
514 is not specified, all view entries for the specified logical unit will be
515 listed.
516 .Bl -tag -width Ds
517 .It Fl l Ns , Ns Fl -lu-name Ar lu-name
518 Specify logical unit.
520 .It Xo
522 .Cm modify-lu
523 .Op Fl f
524 .Oo Fl p Ar property Ns = Ns Ar value Oc Ns ...
525 .Op Fl s Ar size
526 .Ar lu-arg
528 Modify attributes of a logical unit created using the
529 .Cm create-lu
530 subcommand.
532 .Fl f
533 is not specified,
534 .Ar lu-arg
535 is interpreted as
536 .Ar lu-name.
537 .Bl -tag -width Ds
538 .It Fl f Ns , Ns Fl -file
539 If specified,
540 .Ar lu-arg
541 is interpreted as file name.
542 This provides the ability to modify a logical unit that is not currently
543 imported into the STMF.
544 .It Fl p Ns , Ns Fl -lu-prop Ar property
545 Modify specified logical unit property.
547 .Sx Logical Unit Properties
548 for the list of available properties.
549 .It Fl s Ns , Ns Fl -size Ar size
550 .Ar size
551 is an integer followed by one of the following letters, to indicate a unit of
552 size:
553 .Sy k , m , g , t , p , e ,
554 specifying kilobyte, megabyte, gigabyte, terabyte, petabyte and exabyte
555 respectively.
557 .It Xo
559 .Cm offline-lu
560 .Ar lu-name
562 Offline a logical unit currently registered with the STMF.
563 .It Xo
565 .Cm offline-target
566 .Ar target-name
568 Offline the specified target.
569 .It Xo
571 .Cm online-lu
572 .Ar lu-name
574 Online a logical unit currently registered with the STMF.
575 .It Xo
577 .Cm online-target
578 .Ar target
580 Online the specified target.
581 .It Xo
583 .Cm remove-hg-member
584 .Fl g Ar host-group
585 .Ar initiator
587 Remove specified
588 .Ar initiator
589 from host group
590 .Bl -tag -width Ds
591 .It Fl g Ns , Ns Fl -group-name Ar host-group
592 Specifies group name.
593 .Ar host-group
594 must be an existing group created using the
595 .Cm create-hg
596 subcommand.
598 .It Xo
600 .Cm remove-tg-member
601 .Fl g Ar target-group
602 .Ar target
604 Remove specified
605 .Ar target
606 from target group.
607 .Bl -tag -width Ds
608 .It Fl g Ns , Ns Fl -group-name Ar taget-group
609 Specifies group name.
610 .Ar target-group
611 must be an existing group created using the
612 .Cm create-tg
613 subcommand.
615 .It Xo
617 .Cm remove-view
618 .Op Fl a
619 .Fl l Ar lu-name
620 .Ar view Ns ...
622 Remove one or more view entries from a logical unit.
623 .Bl -tag -width Ds
624 .It Fl a Ns , Ns Fl -all
625 Remove all view entries for this logical unit.
626 .It Fl l Ns , Ns Fl -lu-name
627 Specify logical unit.
630 .Sh EXAMPLES
631 .Bl -tag -width Ds
632 .It Sy Example 1 No Creating a Host group with Two Initiator Ports
633 The following commands use the
634 .Cm create-hg
636 .Cm add-hg-member
637 subcommands to create a host group and add two initiator ports to that host
638 group.
639 .Bd -literal
640 # stmfadm create-hg HostA
641 # stmfadm add-hg-member -g HostA wwn.210105b0000d92d0
643 .It Sy Example 2 No Adding a View Entry to a Logical Unit
644 The following command uses the
645 .Cm add-view
646 subcommand to allow access from
647 .Sy HostA
648 to a logical unit.
649 .Bd -literal
650 # stmfadm add-view -h HostA 6000AE40C5000000000046FC4FEA001C
652 .It Sy Example 3 No Listing a View Entry
653 The following command uses the
654 .Cm list-view
655 subcommand to list all view entries for the specified logical unit.
656 .Bd -literal
657 # stmfadm list-view -l 6000AE40C5000000000046FC4FEA001C
658 View Entry: 0
659     Host group   : HostA
660     Target group : All
661     LUN          : 0
664 .Sh INTERFACE STABILITY
665 .Sy Committed
666 .Sh SEE ALSO
667 .Xr sbdadm 8 ,
668 .Xr attributes 5