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.
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.
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]
18 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
19 .\" Copyright 2016 Nexenta Systems, Inc.
26 .Nd SCSI target mode framework command line interface
38 .Op Fl h Ar host-group
40 .Op Fl t Ar target-group
47 .Oo Fl p Ar property Ns = Ns Ar value Oc Ns ...
69 .Oo Ar host-group Oc Ns ...
73 .Oo Ar lu-name Oc Ns ...
79 .Oo Ar target Oc Ns ...
83 .Oo Ar target-group Oc Ns ...
91 .Oo Fl p Ar property Ns = Ns Ar value Oc Ns ...
112 .Fl g Ar target-group
122 command configures logical units within the SCSI Target Mode Framework
125 The framework and this man page use the following terminology:
128 A device responsible for issuing SCSI I/O commands to a SCSI target and logical
131 A device responsible for receiving SCSI I/O commands for a 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.
137 An host group is a set of one or more initiators that are combined for the
138 purposes of being applied to a
141 An initiator cannot be a member of more than one host group.
143 A target group is a set of one or more SCSI target ports that are treated the
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.
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
169 .It Sy blk Ns = Ns Ar num
170 Specifies the block size for the device.
172 .It Sy guid Ns = Ns Ar string
173 32 hexadecimal ASCII characters representing a valid NAA Registered Extended
175 The default is set by the STMF to a generated value.
176 .It Sy meta Ns = Ns Ar path
178 When specified, will be used to hold the SCSI metadata for the logical unit.
180 .It Sy oui Ns = Ns Ar string
181 Organizational Unique Identifier.
182 Six hexadecimal ASCII characters representing the IEEE OUI company ID
184 This will be used to generate the device identifier
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
194 .It Sy serial Ns = Ns Ar string
196 Specifies the SCSI Vital Product Data Serial Number
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
208 The following logical unit properties can be set when creating LU using
210 subcommand or modified using
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
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
229 .It Sy wp Ns = Ns Sy true Ns | Ns Sy false
231 Determines whether the device reports as write-protected.
238 command supports the subcommands listed below.
246 Add a host group member to a host group.
248 An initiator cannot be a member of more than one host group.
250 .It Fl g Ns , Ns Fl -group-name Ar host-group
251 Specifies group name.
253 must be an existing group created using the
260 .Fl g Ar target-group
263 Add a target group member to a target group.
265 A target cannot be a member of more than one target group.
267 .It Fl g Ns , Ns Fl -group-name Ar target-group
268 Specifies group name.
270 must be an existing group created using the
277 .Op Fl h Ar host-group
278 .Op Fl n Ar lu-number
279 .Op Fl t Ar target-group
282 Add a logical unit view entry to a logical unit
286 is the STMF name for the logical unit as displayed by the
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
296 Each view entry gets assigned an entry name, which can be used to reference the
303 .It Fl h Ns , Ns Fl -host-group Ar host-group
305 is the name of an host group previously created using
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
312 is an integer in the range 0-16383 to be assigned to the logical unit for this
314 If this option is not specified, a logical unit number will be assigned by the
316 .It Fl t Ns , Ns Fl -target-group Ar target-group
318 is the name of a target group previously created using
321 If this option is not specified, the logical unit will be available through all
329 Create a host group with the 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.
337 .Oo Fl p Ar property Ns = Ns Ar value Oc Ns ...
341 Create a logical unit that can be registered with STMF.
343 is the file to be used as the backing store for the logical unit.
346 option is not specified, the size of the specified
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
354 is specified as the backing store device, the default will be to use a special
357 to contain the metadata.
358 For all other devices, the default behavior will be to use the first 64k of the
360 An alternative approach would be to use the
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.
368 .It Fl p Ns , Ns Fl -lu-prop Ar property Ns = Ns Ar value
369 Set specified logical unit property.
371 .Sx Logical Unit Properties
372 for the list of available properties.
373 .It Fl s Ns , Ns Fl -size Ar size
375 is an integer followed by one of the following letters, to indicate a unit of
377 .Sy k , m , g , t , p , e ,
378 specifying kilobyte, megabyte, gigabyte, terabyte, petabyte and exabyte
386 Create a target group with the 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.
396 Delete the host group identified by
404 Delete an existing logical unit that was created using
407 This effectively unloads the logical unit from the STMF framework.
408 Any existing data on the logical unit remains intact.
410 .It Fl k Ns , Ns Fl -keep-views
411 Keep view entries for this logical unit.
418 Delete the target group identified by
425 Import and load a logical unit into the STMF that was previously created using
427 subcommand and was then deleted from the STMF using
430 On success, the logical unit is again made available to the STMF.
432 is the filename used in the
435 If this logical unit is using a separate metadata file, the filename in the
437 property value that was used in the
439 subcommand must be used here.
444 .Oo Ar host-group Oc Ns ...
446 List information for the host group in the system referenced by
450 is not specified, all host groups in the system will be listed.
452 .It Fl v Ns , Ns Fl -verbose
453 Display all host group members.
459 .Oo Ar lu-name Oc Ns ...
461 List information for the logical unit in the system referenced by
465 is not specified, all logical units in the system will be listed.
467 .It Fl v Ns , Ns Fl -verbose
468 Display verbose information about the logical unit.
474 List the operational and configuration state of the STMF.
479 .Oo Ar target Oc Ns ...
481 List information for the target port in the system referenced by
483 If target name is not specified, all target ports in the system will be listed.
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.
493 .Oo Ar target-group Oc Ns ...
495 List information for the target group in the system referenced by
499 is not specified, all target groups in the system will be listed.
501 .It Fl v Ns , Ns Fl -verbose
502 Display all group members.
508 .Oo Ar view Oc Ns ...
510 List the view entry for the logical unit referenced by
514 is not specified, all view entries for the specified logical unit will be
517 .It Fl l Ns , Ns Fl -lu-name Ar lu-name
518 Specify logical unit.
524 .Oo Fl p Ar property Ns = Ns Ar value Oc Ns ...
528 Modify attributes of a logical unit created using the
538 .It Fl f Ns , Ns Fl -file
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
551 is an integer followed by one of the following letters, to indicate a unit of
553 .Sy k , m , g , t , p , e ,
554 specifying kilobyte, megabyte, gigabyte, terabyte, petabyte and exabyte
562 Offline a logical unit currently registered with the STMF.
568 Offline the specified target.
574 Online a logical unit currently registered with the STMF.
580 Online the specified target.
591 .It Fl g Ns , Ns Fl -group-name Ar host-group
592 Specifies group name.
594 must be an existing group created using the
601 .Fl g Ar target-group
608 .It Fl g Ns , Ns Fl -group-name Ar taget-group
609 Specifies group name.
611 must be an existing group created using the
622 Remove one or more view entries from a logical unit.
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.
632 .It Sy Example 1 No Creating a Host group with Two Initiator Ports
633 The following commands use the
637 subcommands to create a host group and add two initiator ports to that host
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
646 subcommand to allow access from
650 # stmfadm add-view -h HostA 6000AE40C5000000000046FC4FEA001C
652 .It Sy Example 3 No Listing a View Entry
653 The following command uses the
655 subcommand to list all view entries for the specified logical unit.
657 # stmfadm list-view -l 6000AE40C5000000000046FC4FEA001C
664 .Sh INTERFACE STABILITY