- Managing ZFS File Systems in Oracle Solaris 11.4
- Oracle Solaris ZFS Advanced Topics
- ZFS Volumes
- Using a ZFS Volume as an iSCSI LUN
- How to Use a ZFS Volume as an iSCSI LUN
How to Use a ZFS Volume as an iSCSI LUN
-
First, install the COMSTAR package.
$ pkg install group/feature/storage-server
-
Create a ZFS volume to be used as an iSCSI target.
For example:
$ zfs create -V 2g system1/volumes/v2
-
Create the SCSI-block-device-based LUN.
For example:
$ sbdadm create-lu /dev/zvol/rdsk/system1/volumes/v2 Created the following LU: GUID DATA SIZE SOURCE -------------------------------- ------------------- ---------------- 600144f000144f1dafaa4c0faff20001 2147483648 /dev/zvol/rdsk/system1/volumes/v2 $ sbdadm list-lu Found 1 LU(s) GUID DATA SIZE SOURCE -------------------------------- ------------------- ---------------- 600144f000144f1dafaa4c0faff20001 2147483648 /dev/zvol/rdsk/system1/volumes/v2
-
Share LUN views to all ZFS clients. or selected ZFS clients.
You can expose the LUN views to all ZFS clients or to a selected list of ZFS clients. In the following example, the LUN view is shared to all ZFS clients.
-
Identify the LUN GUID.
$ stmfadm list-lu LU Name: 600144F000144F1DAFAA4C0FAFF20001
-
Share the LUN view.
$ stmfadm add-view 600144F000144F1DAFAA4C0FAFF20001 $ stmfadm list-view -l 600144F000144F1DAFAA4C0FAFF20001 View Entry: 0 Host group : All Target group : All LUN : 0
-
Identify the LUN GUID.
-
Create the iSCSI targets.
For information about creating the iSCSI targets, see Chapter 8, Configuring Storage Devices With COMSTAR in Managing Devices in Oracle Solaris 11.4 .