You can use the iscsitadm command to set up and manage your Solaris iSCSI target devices, which can be disk or tape devices. For the device that you select as your iSCSI target, you must provide an equivalently sized ZFS or UFS file system as the backing store for the iSCSI daemon.
For information about setting up a Solaris iSCSI target device with ZFS, see ZFS and Solaris iSCSI Improvements in Solaris ZFS Administration Guide.
After the target device is set up, use the iscsiadm command to identify your iSCSI targets, which will discover and use the iSCSI target device.
For more information, see iscsitadm(1M) and iscsiadm(1M).
The basic process is as follows:
Identify the backing store directory – For each target and logical unit that is created, the iSCSI daemon needs to store some information. By default, the backing store for this device is also located in the base directory. So, if the host system has a large ZFS pool to use, it might be easiest to allow the daemon to store everything in that location. If the backing store needs to be spread out, it's possible to specify the backing store location during the creation of each logical unit.
Create the iSCSI target – By default, the CLI assumes that the requested device type is an LBA of logical unit 0. If a pass through mode is desired for character devices, the -raw option must be used. After the creation of the first LUN, other LUNs might be created for the same iSCSI target by specifying -lun number.
The daemon starts a background task that initializes the LUN to zeros. If, during that initialization, the underlying file system becomes 100 percent full, the daemon removes the target. During this initialization, the LUN is marked as being offline and cannot be used by an initiator. During this time, however, it is possible to have an initiator discover this LUN. The Solaris initiator waits until it receives an Inventory Change notification and then automatically brings the device online.
This procedure assumes that you are logged in to the local system that contains the iSCSI targets.
Become superuser.
Identify the backing store directory.
For example:
target# iscsitadm modify admin -d /export/sandbox |
Create an iSCSI target.
For example:
target# iscsitadm create target --size 2g sandbox |
Display information about the iSCSI target.
For example:
target# iscsitadm list target -v sandbox |
Set up your iSCSI initiator to discover and use this target.
For more information, see How to Configure iSCSI Target Discovery.
If your network includes a third-party iSNS server or a Sun iSNS server, you can set up iSNS target discovery on your Solaris iSCSI targets.
This procedure assumes that you are logged in to the local system where you want to access a configured iSCSI target device.
Become superuser.
Add the iSNS server information.
For example:
initiator# iscsitadm modify admin --isns-server ip-address or hostname[:port] |
Identify the ip-address of the iSNS server in your network.
This step adds the iSNS server information to all of the Solaris iSCSI targets.
Enable iSNS server discovery.
For example:
initiator# iscsitadm modify admin --isns-access enable |
This step enables iSNS discovery for all of the Solaris iSCSI targets.