1stmfadm(1M) System Administration Commands stmfadm(1M)
2
3
4
6 stmfadm - SCSI target mode framework command line interface
7
9 stmfadm add-hg-member -g, --group-name group-name group-member...
10
11
12 stmfadm add-tg-member -g, --group-name group-name group-member...
13
14
15 stmfadm add-view [-n, --lun logical-unit-number
16 -t, --target-group group-name -h, --host-group group-name] lu-name
17
18
19 stmfadm create-hg group-name
20
21
22 stmfadm create-lu [-p, --lu-prop logical-unit-property=val
23 -s, --size size] lu-file
24
25
26 stmfadm create-tg group-name
27
28
29 stmfadm delete-hg group-name
30
31
32 stmfadm delete-lu lu-name
33
34
35 stmfadm delete-tg group-name
36
37
38 stmfadm import-lu lu-file
39
40
41 stmfadm list-hg [-v] [host-group-name...]
42
43
44 stmfadm list-tg [-v] [target-group-name...]
45
46
47 stmfadm list-lu [-v] [lu-name...]
48
49
50 stmfadm list-target [-v] [target-name...]
51
52
53 stmfadm list-view -l, --lu-name lu-name [entry-name...]
54
55
56 stmfadm list-state
57
58
59 stmfadm modify-lu [-p, --lu-prop logical-unit-property=val
60 -s, --size size, -f, --file] lu-name|lu-file
61
62
63 stmfadm online-lu lu-name
64
65
66 stmfadm offline-lu lu-name
67
68
69 stmfadm online-lu target-name
70
71
72 stmfadm offline-lu target-name
73
74
75 stmfadm remove-hg-member -g, --group-name group-name group-member...
76
77
78 stmfadm remove-tg-member -g, --group-name group-name group-member...
79
80
81 stmfadm remove-view -l, --lu-name lu-name entry-name
82
83
85 The stmfadm command configures logical units within the SCSI Target
86 Mode Framework (STMF) framework. The framework and this man page use
87 the following terminology:
88
89 initiator
90
91 A device responsible for issuing SCSI I/O commands to a SCSI target
92 and logical unit.
93
94
95 target
96
97 A device responsible for receiving SCSI I/O commands for a logical
98 unit.
99
100
101 logical unit
102
103 A device within a target responsible for executing SCSI I/O com‐
104 mands.
105
106
107 logical unit number
108
109 The identifier of a logical unit within a target.
110
111
112 initiator group
113
114 An initiator group is a set of one or more initiators that are com‐
115 bined for the purposes of being applied to a view (see below). An
116 initiator cannot be a member of more than one initiator group.
117
118
119 target group
120
121 A target group is a set of one or more SCSI target ports that are
122 treated the same when creating a view (see below). The set of logi‐
123 cal units that a particular SCSI initiator can see is determined by
124 the combined set of views.
125
126 Each logical unit has a set of view entries, and each view entry
127 specifies a target group, host group, and a LUN. An initiator from
128 that host group, when connecting through that target group, is able
129 to identify and connect to that logical unit using the specified
130 LUN. You can use views to restrict the set of logical units that a
131 specific initiator can see, and assign the set of LUNs that will be
132 used.
133
134
135 view
136
137 A view defines the association of an initiator group, a target
138 group, and a logical unit number with a specified logical unit. Any
139 view entry added to a logical unit must not be in conflict with
140 existing view entries for that logical unit. A view entry is con‐
141 sidered to be in conflict when an attempt is made to duplicate the
142 association of any given initiator, target and logical unit number.
143 As an example, logical unit LU_0 has the following view entry asso‐
144 ciated with it:
145
146 Logical Unit: LU_0
147 View Entry: 0
148 initiator group: HostA
149 target group: All targets
150 logical unit number: 32
151
152
153 If you attempted the following:
154
155 # stmf add-view -n 31 -h HostA LU_0
156
157
158 ...the operation would return an error with a message indicating
159 that the view entry is in conflict with one or more existing view
160 entries. This conflict arises because the existing view entry, 0,
161 already has mapped LU_0 to logical unit number 32 for the initiator
162 group HostA.
163
164
166 The stmfadm command supports the subcommands listed below.
167
168 add-view [-n, --lun logical-unit-number -t, --target-group group-name
169 -h, --host-group group-name] lu-name
170
171 Adds a logical unit view entry to a logical unit lu-name, where lu-
172 name is the STMF name for the logical unit as displayed by the
173 list-lu subcommand. The add-view subcommand provides the user with
174 a mechanism to implement access control for a logical unit and also
175 provides a means of assigning a logical unit number to a logical
176 unit for a given set of initiators and targets. A logical unit will
177 not be available to any initiators until at least one view is
178 applied. Each view entry gets assigned an entry name, which can be
179 used to reference the entry in the remove-view and list-view sub‐
180 commands.
181
182 add-view supports the following options:
183
184 -n, --lun logical-unit-number
185
186 logical-unit-number is an integer in the range 0-16383 to be
187 assigned to the logical unit for this view entry. If this
188 option is not specified, a logical unit number will be assigned
189 by the STMF framework.
190
191
192 -t, --target-group group-name
193
194 group-name is the name of a target group previously created
195 using the STMF create-tg subcommand. If this option is not
196 specified, the logical unit will be available through all tar‐
197 gets.
198
199
200 -h, -host-group group-name
201
202 group-name is the name of an host group previously created
203 using the STMF create-hg subcommand. If this option is not
204 specified, the logical unit will be available to all initiators
205 that log in to the STMF framework.
206
207
208
209 add-hg-member -g group-name group member...
210
211 Add a host group member to a host group. group-name must be an
212 existing group created using the create-hg subcommand. group member
213 can be specified as name_type.name_value, where name_type can be
214 one of the following:
215
216 wwn
217 iqn
218 eui
219
220
221 ...and name_value is the value of the initiator name. As an exam‐
222 ple, to add a fibre channel initiator port world-wide name
223 200000e08b909221 to the host group HostA, the command would be:
224
225 # stmfadm add-hg-member -g HostA wwn.200000e08b909221
226
227
228 To add an ISCSI initiator node member with the name
229 iqn.1986-03.com.sun:01.46f7e262 to HostA, the command would be:
230
231 # stmfadm add-hg-member -g HostA iqn.1986-03.com.sun:01.46f7e262
232
233
234 Alternatively, members can be specified using their SCSI name
235 string identifiers. To add the two initiators above using their
236 SCSI name string identifiers, the commands would be:
237
238 # stmfadm add-hg-member -g HostA eui.200000e08b909221
239 # stmfadm add-hg-member -g HostA iqn.1986-03.com.sun:01.46f7e262
240
241
242 A host group member cannot be a member of more than one host group.
243
244
245 add-tg-member -g group-name group member...
246
247 Add a target group member to a target group. group-name must be an
248 existing group created using the create-tg subcommand. group member
249 can be specified as name_type.name_value, where name_type can be
250 one of the following:
251
252 wwn
253 iqn
254 eui
255
256
257 ...and name_value is the value of the target name. As an example,
258 to add a fibre channel target port world-wide name 501000e092376af7
259 to the target group TG0, the command would be:
260
261 # stmfadm add-tg-member -g TG0 wwn.501000e092376af7
262
263
264 To add an ISCSI target member with the name
265 iqn.1986-03.com.sun:target.01.01110 to TG0, the command would be:
266
267 # stmfadm add-tg-member -g TG0 iqn.1986-03.com.sun:target.01.01110
268
269
270 Alternatively, members can be specified using their SCSI name
271 string identifiers. To add the two targets above using their SCSI
272 name string identifiers, the commands would be:
273
274 # stmfadm add-tg-member -g TG0 eui.501000e092376af7
275 # stmfadm add-tg-member -g TG0 iqn.1986-03.com.sun:target.01.01110
276
277
278 A target group member cannot be a member of more than one target
279 group.
280
281
282 create-hg group-name
283
284 Create an initiator group with the name group-name. group-name is a
285 string of Unicode characters with a maximum length of 255. The
286 group name must be unique within the STMF system.
287
288
289 create-lu [-p, --lu-prop logical-unit-property=val --s, --size size]
290 lu-file
291
292 Create a logical unit that can be registered with STMF. For the -p
293 option, logical-unit-property can be one of the following proper‐
294 ties:
295
296 alias
297
298 Up to 255 characters, representing a user-defined name for the
299 device. The default is the name of the backing store.
300
301
302 blk
303
304 Specifies the block size for the device. The default is 512.
305
306
307 guid
308
309 Thirty-two hexadecimal ASCII characters representing a valid
310 NAA Registered Extended Identifier. The default is set by the
311 STMF to a generated value.
312
313
314 meta
315
316 Metadata file name. When specified, will be used to hold the
317 SCSI metadata for the logical unit. There is no default.
318
319
320 mgmt-url
321
322 Up to 1024 characters representing a Management Network Address
323 URL. More than one URL can be passed as a single parameter by
324 using space-delimited URLs enclosed inside a single pair of
325 quotation marks (").
326
327
328 oui
329
330 Organizational Unique Identifier. Six hexadecimal ASCII charac‐
331 ters representing the IEEE OUI company ID assignment. This will
332 be used to generate the device identifier (GUID). The default
333 is 00144F.
334
335
336 pid
337
338 Sixteen characters of product identification SCSI SPC-3. This
339 value will be reflected in the Standard INQUIRY data returned
340 for the device. The default is COMSTAR.
341
342
343 serial
344
345 Serial Number. Specifies the SCSI Vital Product Data Serial
346 Number (page 80h). It is a character value up to 252 bytes in
347 length. There is no default value.
348
349
350 vid
351
352 Eight characters of vendor identification per SCSI SPC-3. This
353 value will be reflected in the Standard INQUIRY data returned
354 for the device. The default is SUN.
355
356
357 wcd
358
359 Write-back cache disable. Specify true or falseto determine
360 write-back cache disable behavior. The default is the write-
361 back cache setting of the backing store device specified by the
362 lu-file argument.
363
364
365 wp
366
367 Write-protect bit. Specify true or false to determine whether
368 the device reports as write-protected. The default is false.
369
370 For the -s option, size is an integer followed by one of the fol‐
371 lowing letters, to indicate a unit of size:
372
373 k kilobyte
374
375
376 m megabyte
377
378
379 g gigabyte
380
381
382 t terabyte
383
384
385 p petabyte
386
387
388 e exabyte
389
390 lu-file is the file to be used as the backing store for the logical
391 unit. If the -s option is not specified, the size of the specified
392 lu-file will be used as the size of the logical unit. Logical units
393 registered with the STMF require space for the metadata to be
394 stored. When a zvol is specified as the backing store device, the
395 default will be to use a special property of the zvol to contain
396 the metadata. For all other devices, the default behavior will be
397 to use the first 64k of the device. An alternative approach would
398 be to use the meta property in a create-lu command to specify an
399 alternate file to contain the metadata. It is advisable to use a
400 file that can provide sufficient storage of the logical unit meta‐
401 data, preferably 64k.
402
403
404 create-tg group-name
405
406 Create a target group with the name group-name. group-name is a
407 string of Unicode characters with a maximum length of 255. The
408 group name must be unique within the STMF system.
409
410
411 delete-hg group-name
412
413 Delete the host group that identified by group-name.
414
415
416 delete-lu lu-name
417
418 Deletes an existing logical unit that was created using stmfadm
419 create-lu. This effectively unloads the logical unit from the STMF
420 framework. Any existing data on the logical unit remains intact.
421
422
423 delete-tg group-name
424
425 Delete the target group that identified by group-name.
426
427
428 import-lu lu-file
429
430 Imports and loads a logical unit into the STMF that was previously
431 created using stmfadm create-lu and was then deleted from the STMF
432 using stmfadm delete-lu. On success, the logical unit is again made
433 available to the STMF. lu-file is the filename used in the stmfadm
434 create-lu command. If this logical unit is using a separate meta‐
435 data file, the filename in the meta property value that was used in
436 the stmfadm create-lu command must be used here.
437
438
439 list-hg [-v,--verbose] [host-group-name...]
440
441 Lists information for the host group in the system referenced by
442 host-group-name. If host-group-name is not specified, all host
443 groups in the system will be listed. If the --v or --verbose option
444 is specified, all members within a host group are displayed.
445
446
447 list-lu [-v,--verbose] [lu-name...]
448
449 Lists information for the logical unit in the system referenced by
450 lu-name. If lu-name is not specified, all logical units in the sys‐
451 tem will be listed. If the -v or --verbose option is specified,
452 additional information about the logical unit will be displayed.
453
454
455 list-target [-v,--verbose] [target-name...]
456
457 Lists information for the target port in the system referenced by
458 target-name. If target name is not specified, all target ports in
459 the system will be listed. If the -v or --verbose option is speci‐
460 fied, additional information about the target along with SCSI ses‐
461 sion information for logged-in initiators is displayed.
462
463
464 list-tg [-v,--verbose] [target-group-name...]
465
466 Lists information for the target group in the system referenced by
467 target-group-name. If target-group-name is not specified, all tar‐
468 get groups in the system will be listed. If the --v or --verbose
469 option is specified, all members within a target group are dis‐
470 played.
471
472
473 list-view --l, --lu-name lu-name [entry-name...]
474
475 Lists the view entry for the logical unit referenced by lu-name. If
476 entry-name is not specified, all view entries for the specified
477 logical unit will be listed.
478
479
480 modify-lu [-p, --lu-prop logical-unit-property=val --s, --size size,
481 -f, --file] lu-name|lu-file
482
483 Modifies attributes of a logical unit created using the stmfadm
484 create-lu command. For the -p option, logical-unit-property can be
485 one of the following properties:
486
487 alias
488
489 Up to 255 characters, representing a user-defined name for the
490 device. The default is the name of the backing store.
491
492
493 mgmt-url
494
495 Up to 1024 characters representing a Management Network Address
496 URL. More than one URL can be passed as a single parameter by
497 using space-delimited URLs enclosed inside a single pair of
498 quotation marks (").
499
500
501 wcd
502
503 Write-back cache disable. Specify true or falseto determine
504 write-back cache disable behavior. The default is the write-
505 back cache setting of the backing store device specified by the
506 lu-file argument.
507
508
509 wp
510
511 Write-protect bit. Specify true or false to determine whether
512 the device reports as write-protected. The default is false.
513
514 For the -s option, size is an integer followed by one of the fol‐
515 lowing letters, to indicate a unit of size:
516
517 k kilobyte
518
519
520 m megabyte
521
522
523 g gigabyte
524
525
526 t terabyte
527
528
529 p petabyte
530
531
532 e exabyte
533
534 lu-name is the guid of the logical unit to be modified. If the -f
535 option is specified, the operand is interpreted as a file name.
536 This provides the ability to modify a logical unit that is not cur‐
537 rently imported into the STMF.
538
539
540 online-lu lu-name
541
542 Online a logical unit currently registered with the STMF.
543
544
545 online-target target-name
546
547 Online the specified target.
548
549
550 offline-lu lu-name
551
552 Offline a logical unit currently registered with the STMF.
553
554
555 offline-target target-name
556
557 Online the specified target.
558
559
560 list-state
561
562 Lists the operational and configuration state of the STMF.
563
564
565 remove-hg-member -g group-name group member
566
567 Removes a host group member from a host group. group-name must be
568 an existing group created using the create-hg subcommand. group
569 member can be specified as name_type.name_value, where name_type
570 can be one of the following:
571
572 wwn
573 iqn
574 eui
575
576
577 ...and name_value is the value of the initiator name. As an exam‐
578 ple, to remove the fibre channel initiator port world-wide name
579 200000e08b909221 from the host group HostA, the command would be:
580
581 # stmfadm remove-hg-member -g HostA wwn.200000e08b909221
582
583
584 To remove the ISCSI initiator node member with the name
585 iqn.1986-03.com.sun:01.46f7e262 from HostA, the command would be:
586
587 # stmfadm remove-hg-member -g HostA iqn.1986-03.com.sun:01.46f7e262
588
589
590 Alternatively, members can be specified using their SCSI name
591 string identifiers. To remove the two initiators above using their
592 SCSI name string identifiers, the commands would be:
593
594 # stmfadm remove-hg-member -g HostA eui.200000e08b909221
595 # stmfadm remove-hg-member -g HostA iqn.1986-03.com.sun:01.46f7e262
596
597
598
599
600 remove-tg-member -g group-name group member
601
602 Removes a target group member from a target group. group-name must
603 be an existing group created using the create-tg subcommand. group
604 member can be specified as name_type.name_value, where name_type
605 can be one of the following:
606
607 wwn
608 iqn
609 eui
610
611
612 ...and name_value is the value of the target name. As an example,
613 to remove the fibre channel target port world-wide name
614 501000e092376af7 from the target group TG0, the command would be:
615
616 # stmfadm remove-tg-member -g TG0 wwn.501000e092376af7
617
618
619 To remove the ISCSI target member with the name
620 iqn.1986-03.com.sun:target.01.01110 from TG0, the command would be:
621
622 # stmfadm remove-tg-member -g TG0 iqn.1986-03.com.sun:target.01.01110
623
624
625 Alternatively, members can be specified using their SCSI name
626 string identifiers. To remove the two targets above using their
627 SCSI name string identifiers, the commands would be:
628
629 # stmfadm remove-tg-member -g TG0 eui.501000e092376af7
630 # stmfadm remove-tg-member -g TG0 iqn.1986-03.com.sun:target.01.01110
631
632
633
634
635 remove-view --l, --lu-name lu-name entry-name
636
637 Removes one or more logical unit view entries from a logical unit.
638
639
641 Example 1 Creating a Host group with Two Initiator Ports
642
643
644 The following commands use the create-hg and add-hg-member subcommands
645 to create a host group and add two initiator ports to that host group.
646
647
648 # stmfadm create-hg host-group-a
649 # stmfadm add-hg-member -g host-group-a wwn.210105b0000d92d0
650
651
652
653 Example 2 Adding a View Entry to a Logical Unit
654
655
656 The following command uses the add-view subcommand to allow access from
657 host-group-a to a logical unit.
658
659
660 # stmfadm add-view -h host-group-a 6000AE40C5000000000046FC4FEA001C
661
662
663
664 Example 3 Listing a View Entry
665
666
667 The following command uses the list-view subcommand to list all view
668 entries for the specified logical unit.
669
670
671 # stmfadm list-view -l 6000AE40C5000000000046FC4FEA001C
672 View Entry: 0
673 Host group : host-group-a
674 Target group : All
675 LUN : 0
676
677
678
680 See attributes(5) for descriptions of the following attributes:
681
682
683
684
685 ┌─────────────────────────────┬─────────────────────────────┐
686 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
687 ├─────────────────────────────┼─────────────────────────────┤
688 │Availability │SUNWstmfu │
689 ├─────────────────────────────┼─────────────────────────────┤
690 │Interface Stability │Committed │
691 └─────────────────────────────┴─────────────────────────────┘
692
694 sbdadm(1M), attributes(5)
695
696
697
698SunOS 5.11 30 Jul 2009 stmfadm(1M)