Less known Solaris Features: iSCSI - Part 2: Basic iSCSI
At first I will show you, how to do a really simple iSCSI configuration. This is without any authentication. Thus everybody can connect to the iSCSI targets on the system. But this is sufficient for a test. And it´s this is better for having a quick success. ;)
Environment
For this example, i will use my both demo VMs again:
Both systems runs with Solaris Express Build 84 for x86, but you can to the same with Solaris Update 4 for SPARC and x86 as well. In our example, theoden is the server with the iSCSI target. gandalf is the server, which wants to use the the LUN via iSCSI on theoden, thus gandalf is the server with the initiator.
Prerequisites
At first, we login to theoden and assume root privileges. Okay, to test iSCSI we need some storage volumes to play around. There is a nice way to create a playground with ZFS. You can use files as devices. But at first we have to create this files
Okay, now we stripe those four files in a zpool:
Now we make a short check for the zpool
Configuring the iSCSI Target
We stay at server theoden. Okay, now we have to configure an iSCSI target. We create an emulated volume within the zfspool:
The emulated volume has the size of 200M.Okay, it´s really easy to enable the iSCSI target. At first we have to enable the iSCSI Target service:
Now we share the volume via iSCSI
That´s all on the target
Configuring the iSCSI initiator
Okay, now we have configure the initiator. We have to login on gandalf
and assume root privileges as well. At first we have to activate the initiator via SMF:
After this we configure the initiator and tell the initiator to discover devices on our iSCSI target.
Using the iSCSI device
Okay, now tell Solaris to scan for iSCSI devices.
The -c iscsi
limits the scan to iSCSI devices. With the format command we look for the available disks in the system:
Okay, there is new device with a really long name. We can use this device for a zfs pool:
As you see, we have created a zfs filesystem via iSCSI on an emulated volume on a zpool on a remote system.