iscsitadm - administer iSCSI targets
iscsitadm create [-? | --help] object [-? | --help] [options] operand
iscsitadm modify [-? | --help] object [-? | --help] [options] operand
iscsitadm delete [-? | --help] object [-? | --help] [options] operand
iscsitadm list [-? | --help] object [-? | --help] [options] operand
iscsitadm show [-? | --help] admin
iscsitadm show [-? | --help] object [-? | --help] [options] [operand]
iscsitadm -? --help
The iscsitadm command enables you to manage Internet SCSI (iSCSI) target nodes. It is a companion to iscsiadm(1M), which enables you to manage iSCSI initiator nodes.
The iscsitadm command has the following subcommands:
create
modify
delete
list
show
The preceding subcommands work on the following objects:
target
initiator
admin
tpgt
stats
These objects are discussed in greater detail under the options descriptions for each subcommand.
As indicated in the SYNOPSIS, iscsitadm has two levels of help. If you invoke -? or --help following a subcommand, the command displays available operands, options, and objects. If you invoke an help option following an object, iscsitadm displays options and operands.
The iscsitadm options and objects are discussed below in the context of each subcommand. Note that the help options (-? or --help) are invoked as shown in the SYNOPSIS. See EXAMPLES.
The following are the options and objects for the create subcommand:
target --size|-z lun_size [--lun number]
[--type disk|tape|raw] [--backing-store|-b pathname] local_name
k
m
g
t
--lun specifies the logical unit number. --type specifies which type of emulation will occur for the LUN. disk and tape are the familiar devices. raw indicates that the emulator will use the uSCSI interface and pass the command blocks directly to and from the device. The use of raw also implies the option --backing-store will be entered. The argument to this option is the full pathname to the device node normally found in /dev. If you use --backing-store, the size of the store is determined by a SCSI READ_CAPACITY command or, if the backing store is a regular file, by stat(2).
If local_name already exists, a new target name is not generated for this LUN. The LUN is created within the local_name storage hierarchy. You can use the --backing-store option to specify a different location for the data. If you use --backing-store, it is up to you to allocate actual storage instead of having the target create the data file.
initiator --iqn|-n iSCSI_node_name local_initiator
tpgt tpgt_number
The following are the options and objects for the modify subcommand:
target --tpgt|-p local_tpgt local_target
target --acl|-l local_initiator local_target
target --alias|-a TargetAlias local_target
target --maxrecv|-m value local_target
initiator --chap-secret|-C local_initiator
initiator --chap-name|-H value local_initiator
tpgt --ip-address|-i address tpgt_number
admin --base-directory|-d directory
admin --chap-secret|-C
admin --chap-name|-H value
admin --radius-access|-R enable | disable
admin --radius-server|-r hostname:port
admin --radius-secret|-P
admin --isns-access|-S enable | disable
admin --isns-server|-s hostname
admin --fast-write-ack|-f enable | disable
The following are the options and objects for the delete subcommand:
target --lun|-u lun_number local_target
target --acl|-l local_initiator local_target
target --tpgt|-p local_tpgt local_target
initiator --all|-A local_initiator
# iscsitadm delete target --acl local_initiator target
tpgt --all|-A tpgt_number
tpgt --ip-address|-i address tpgt_number
The following are the options and objects for the list subcommand:
target [--verbose] [local_target]
target [-v|-s num] [local_target]
You can use the iostat(1M) command to obtain information on the number of SCSI commands issued and sectors read and written.
initiator [--verbose|-v] local_initiator
tpgt [--verbose|-v] tpgt_number
The following are the options and objects for the show subcommand:
admin
stats [--interval|-I seconds [--count|-N value]] [local_target]
Example 1 Invoking Help
All of the commands shown below are valid ways of invoking help.
# iscsitadm -? # iscsitadm modify -? # iscsitadm modify target -? # iscsitadm --help # iscsitadm create --help # iscsitadm create tpgt --help
Example 2 Establishing Backing Store
The following command establishes the default location for the backing store. In addition to the backing store, certain configuration files will be stored in the same location.
# iscsitadm modify admin --base-directory /zfs/data/targets
The short form of the --base-directory option is -d.
Example 3 Simplest-Case Target Creation
The following command creates a target that will emulate an LBA device that has 10 GB of storage available. With the base directory set up and as well as a single target, it is possible to use the system as an iSCSI target. Note that because the LUN is not specified on the command line, it reverts to the default, 0.
# iscsitadm create target --size 10g play_area
The short form of the --size option is -z.
Example 4 Creating with Both Size and Backing Store
The following iscsitadm create command specifies LUN size and a backing store location. The result of this command is that the daemon will create a LUN file at the named location, of the specified size (20 GB).
# iscsitadm create target -z 20g -b /zfs/mirror/data/payroll payroll
A target such as the one created by the preceding command might be useful, for example, when most of the LUN can be created in a default area, using whatever redundancy is provided by the underlying file system. Alternatively, you might want to create a special LUN on a higher speed storage medium or one with better failover characteristics.
The long form of the -z option is --size. The long form of the -b option is --backing-store
Example 5 Specifying a Local Name for a SCSI Initiator
Consider that you want to restrict access to the payroll target, created in the previous example, to a limited set of initiators. Because the initiator names can be quite long (and therefore prone to be entered incorrectly), you create a local name for each initiator, as in the command below.
# iscsitadm create initiator --iqn \ iqn.1986-03.com.example[node name continues...] multistrada
The short form of the --iqn option is -q.
Example 6 Granting an Initiator Access to a Target
Upon completion of the command below, only the initiator multistrada is allowed to log into the daemon and access the payroll target. This presents a potential gap in security, which is addressed in the following example.
# iscsitadm modify target --acl multistrada payroll
The short form of the --acl option is -l.
Example 7 Adding CHAP Secret and Name for an Initiator
The initiator is allowed to identify itself. Because of this, it is prudent to add a CHAP secret an name for an initiator. This is accomplished with the following command.
# iscsitadm modify initiator -C multistrada
The preceding command prompts you for a secret to use. This must be the same secret that was setup on the initiator with the local name of multistrada. If it is not, the target daemon will issue a challenge to multistrada when it attempts to login. A non-matching response will cause the target to drop the connection. If you have many targets that require authentication, it is probably best to setup a RADIUS server to administer the secrets.
The long form of the -C option is --chap-secret.
Example 8 Displaying Target Information
The following commands displays information about iSCSI targets.
# iscsitadm list target Target: vol0 iSCSI Name: iqn.1986-03.com.sun:01:00093d12170c.434c5250.vol0 Target: disk0 iSCSI Name: iqn.1986-03.com.sun:01:00093d12170c.434c6f05.disk0
The following command differs from the preceding in that it uses the verbose (-v) option and it specifies a single target.
# iscsitadm list target -v vol0 Target: vol0 iSCSI Name: iqn.1986-03.com.sun:01:00093d12170c.434c5250.vol0 ACL list: TPGT list: LUN information: LUN: 0 GUID: 010000093d12170c00002a00434c5251 VID: SUN PID: SOLARIS Type: raw Size: 0x1400000 blocks
Example 9 Displaying Administrative Information
The following command uses the show subcommand to display administrative information.
# iscsitadm show admin iscsitadm: Base Directory: /zfs/stress/play/targets CHAP Name: Not set RADIUS Access: Not set RADIUS Server: Not set iSNS Access: Not set Fast Write ACK: Not set
Example 10 Displaying Statistics
The following command uses the show subcommand to display statistics.
# iscsitadm show stats operations bandwidth device read write read write -------------------- ----- ----- ----- ----- vol0 0 0 0K 0K disk0 0 0 0K 0K
0
>0
See attributes(5) for descriptions of the following attributes:
|
iostat(1M), iscsiadm(1M), getpassphrase(3C), attributes(5), rbac(5), smf(5)
This command set is considered to be experimental. Future releases, both minor and micro, might introduce incompatible changes to the command set. A future release will stabilize the command set. Any future changes in stability level will be reflected in the ATTRIBUTES section of this man page.
The iSCSI Target daemon, iscsitgtd, is managed by the service management facility (smf(5)), under the fault management resource identifier (FMRI):
svc:/system/iscsitgt:default
Use iscsitadm to perform administrative actions, such as are performed by the create, modify, and delete subcommands, on iSCSI Target properties. Such actions require that you become superuser or assume the Primary Administrator role. See rbac(5).
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |