Difference between revisions of "SYA810 iSCSI Lab"
Chris Tyler (talk | contribs) m (→iSCSI Target) |
Chris Tyler (talk | contribs) (→iSCSI on RAID for Dumpling) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 14: | Line 14: | ||
== iSCSI Initiator == | == iSCSI Initiator == | ||
− | # Install the | + | # Install the <code>iscsi-initiator-utils</code> package. |
− | # Create an IQN and place it in <code>/etc/iscsi/initiatorname.iscsi</code> | + | # Create an [[IQN]] and place it in <code>/etc/iscsi/initiatorname.iscsi</code> |
# Start the <code>iscsi</code> and <code>iscsid</code> services. | # Start the <code>iscsi</code> and <code>iscsid</code> services. | ||
# Create an SSH tunnel to the remote host (running the target/portal software): <code>ssh ''user''@''host'' -L 3260:localhost:3260</code> | # Create an SSH tunnel to the remote host (running the target/portal software): <code>ssh ''user''@''host'' -L 3260:localhost:3260</code> |
Latest revision as of 19:21, 14 April 2009
SYA810 iSCSI Lab
Purpose
- To configure an iSCSI Target and iSCSI Initiator on two separate systems.
iSCSI Target
- Install the netbsd-iscsi package
- Create an LV (or a zeroed, empty file) to be shared. Edit
/etc/iscsi/targets
to use that as an iSCSI target. (Tip: for the sake of time, don't create a huge file -- <100 MB is reasonable). - Reload the
netbsd-iscsi
service configuration. - Verify that the iSCSI port (3260) is in use by the portal daemon.
iSCSI Initiator
- Install the
iscsi-initiator-utils
package. - Create an IQN and place it in
/etc/iscsi/initiatorname.iscsi
- Start the
iscsi
andiscsid
services. - Create an SSH tunnel to the remote host (running the target/portal software):
ssh user@host -L 3260:localhost:3260
- Discover the remote targets:
iscsiadm -m discovery -t sendtargets -p localhost:3260
- List the targets:
iscsiadm -m node
-- the remote target(s) should be shown. - Login to the targets:
iscsiadm -m node -l
- You will now have an additional scsi disk device. Use this as one element of a RAID-1 array, using local storage (an LV or a looped-back file) as the other element.
- Mount the new RAID-1 array and create a filesystem on it. Place some files there.
- Unmount the filesystem, stop the array, log out of the iSCSI disk (
iscsiadm -m node -u
). - Verify that the filesystem can be locally read on the machine hosting the target.
To Do
- Create a script (or pair of scripts) to set up and take down access to the remote target. To set up, the script should login to the remote target, start the RAID array, and mount the array; to take down, those steps should be reversed.
- Test it.
- Blog about your experience with this lab, and include a link to your script(s).