Sie sind auf Seite 1von 9

First Alternative First Alternative

iscsi Rev. 1 SA Rev. 3

Acknowledgment of Trademarks.

• Trade marks
All Trademarks and Registered Trademarks acknowledged.

Where such trademarks appear in this course, and the authors are aware of the trademark claim,
the trademarks have been printed with an initial capital letter. Such trademarks are used purely for
editorial purposes and no claim is made to any such product being the property of anyone except
the holder or registered holder.

• Copyright
This document is COPYRIGHT First Alternative - 2009, and may not be
reproduced, stored in any electronic system etc. without our prior written permission.

• Limit of liability
Whilst every effort has been made to make these notes accurate and objective, First Alternative
cannot be held liable for any errors therein, nor for the consequences of any such errors. In
particular, examples are provided "as is" and it is the sole responsibility of the customer to ensure
that any example used or modified for use in the customer’s own environment is fit for the use to
which that customer puts it.
First Alternative

First Alternative

© First Alternative 2009 1 of 9 Trademarks © First Alternative 1999 1 of 9 Trademarks


First Alternative First Alternative
iscsi Rev. 1 SA Rev. 3

Solaris iSCSI

iSCSI Target Discovery


• Two methods can be used, called static and dynamic.
• Dynamic iSCSI discovery has two available mechanisms:-
* SendTargets - If an iSCSI node has a large number
of targets, you can use the iSCSI initiator to
employ the SendTargets features to perform iSCSI
device discovery.
* iSNS - iSNS (Internet Storage Name Service)
allows the iSCSI initiator to discover the targets to
which it has access using minimal configuration,
and provide state change notification of changes in
operational state of storage nodes.
• The host should be configured to use either dynamic or static,
as we shall see.
First Alternative

First Alternative

© First Alternative 2009 2 of 9 iSCSI © First Alternative 1999 2 of 9 iSCSI


First Alternative First Alternative
iscsi Rev. 1 SA Rev. 3

Solaris iSCSI

iSCSI Preparation
• Firstly make sure the necessary operating system software
packages are loaded:-
# pkginfo SUNWiscsiu SUNWiscsir
system SUNWiscsir Sun iSCSI Device Driver (root)
system SUNWiscsiu Sun iSCSI Management Utilities (usr)

• Confirm that your TCP/IP network is set up and that you can
ping the iSCSI host(s).
• Connect your iSCSI target devices and confirm that they are
configured; for example, use telnet to connect to the iSCSI
target device using port 3260.
• For information about connecting to third-party iSCSI target
devices, see your hardware documentation.
First Alternative

First Alternative

© First Alternative 2009 3 of 9 iSCSI © First Alternative 1999 3 of 9 iSCSI


First Alternative First Alternative
iscsi Rev. 1 SA Rev. 3

Solaris iSCSI

iSCSI - Creating Targets


• Here is an example for creating a ZFS volume as an iSCSI
target.
# zpool create lake c0t2d0s0
# zfs create -V 5G lake/ivol1
# zfs list
NAME USED AVAIL REFER MOUNTPOINT
lake 5.00G 739M 24.5K /lake
lake/ivol1 22.5K 5.72G 22.5K -
# zfs set shareiscsi=on lake/ivol1
# iscsitadm list target
Target: lake/ivol1
iSCSI Name: iqn.1986-03.com.sun:02:1b6f87b0-72da-68fb-
ddf4-daac3cfbe216
Connections: 0
First Alternative

First Alternative

© First Alternative 2009 4 of 9 iSCSI © First Alternative 1999 4 of 9 iSCSI


First Alternative First Alternative
iscsi Rev. 1 SA Rev. 3

Solaris iSCSI

iSCSI - Discovering Targets


• The following example discovers the iSCSI target created in
the previous example using the SendTargets dynamic method.
# iscsiadm add discovery-address 192.168.200.68:3260
# iscsiadm modify discovery --sendtargets enable
# devfsadm -i iscsi
• Now you can access the iSCSI devices as though they are
local disk devices:-
# format
Searching for disks...done
c6t18d0: configured with capacity of 5.00GB
AVAILABLE DISK SELECTIONS:
0. c0t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w500000e0102732d1,0
1. c0t2d0 <HITACHI-DKR1C-J072FC-JBD3 cyl 15312 alt 2 hd 24 sec 384>
/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w50000e1000057ca1,0
2. c1t0d0 <SEAGATE-ST173404LC-0004 cyl 14087 alt 2 hd 24 sec 424>
/pci@8,700000/scsi@6/sd@0,0
3. c6t18d0 <SUN-SOLARIS-1 cyl 32766 alt 2 hd 4 sec 80>
/iscsi/disk@0000iqn.1986-03.com.sun%3A02%3A1b6f87b0-72da-68fb-ddf4-
daac3cfbe2160001,0
Specify disk (enter its number):

• Entry 3 above can be identified as an iSCSI device.


• Choose it, and you will see:-
selecting c6t18d0
First Alternative

First Alternative

[disk formatted]
Disk not labeled. Label it now? y
FORMAT MENU:
disk - select a disk
etc..

© First Alternative 2009 5 of 9 iSCSI © First Alternative 1999 5 of 9 iSCSI


First Alternative First Alternative
iscsi Rev. 1 SA Rev. 3

Solaris iSCSI

iSCSI - Discovering Targets


• You can now partition it as a normal disk:-
partition> pr
Current partition table (unnamed):
Total disk cylinders available: 32766 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks


0 unassigned wm 0 - 32765 5.00GB (32766/0/0) 10485120
1 unassigned wu 0 0 (0/0/0) 0
2 backup wu 0 - 32765 5.00GB (32766/0/0) 10485120
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0

• Now label it, newfs it (or use it for ZFS) and if necessary add
an entry in /etc/vfstab.
#newfs /dev/rdsk/c6t18d0s0
newfs: construct a new file system /dev/rdsk/c6t18d0s0: (y/n)? y
/dev/rdsk/c6t18d0s0: 10485120 sectors in 32766 cylinders of 4 tracks, 80 sectors
5119.7MB in 256 cyl groups (128 c/g, 20.00MB/g, 2560 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 41072, 82112, 123152, 163872, 204912, 245952, 286992, 327712, 368752,
10076352, 10117392, 10158112, 10199152, 10240192, 10281232, 10321952,
10362992, 10404032, 10445072
* Or..
# zpool create -f lake c6t18d0s0
First Alternative

First Alternative

© First Alternative 2009 6 of 9 iSCSI © First Alternative 1999 6 of 9 iSCSI


First Alternative First Alternative
iscsi Rev. 1 SA Rev. 3

Solaris iSCSI

iSCSI - Displaying Information


# iscsiadm list target-param -v
Target: iqn.1986-03.com.sun:02:1b6f87b0-72da-68fb-ddf4-
daac3cfbe216
Alias: lake/ivol1
Bi-directional Authentication: disabled
Authentication Type: NONE
Login Parameters (Default/Configured):
Data Sequence In Order: yes/-
Data PDU In Order: yes/-
Default Time To Retain: 20/-
Default Time To Wait: 2/-
Error Recovery Level: 0/-
First Burst Length: 65536/-
Immediate Data: yes/-
Initial Ready To Transfer (R2T): yes/-
Max Burst Length: 262144/-
Max Outstanding R2T: 1/-
Max Receive Data Segment Length: 8192/-
Max Connections: 1/-
Header Digest: NONE/-
Data Digest: NONE/-
Configured Sessions: 1
First Alternative

First Alternative

© First Alternative 2009 7 of 9 iSCSI © First Alternative 1999 7 of 9 iSCSI


First Alternative First Alternative
iscsi Rev. 1 SA Rev. 3

Solaris iSCSI

iSCSI - Displaying Information


# iscsiadm list initiator-node
Initiator node name: iqn.1986-
03.com.sun:01:0003ba29aaf6.44ca5292
Initiator node alias: -
Login Parameters (Default/Configured):
Header Digest: NONE/-
Data Digest: NONE/-
Authentication Type: NONE
RADIUS Server: NONE
RADIUS access: unknown
Configured Sessions: 1

# iscsiadm list discovery


Discovery:
Static: disabled
Send Targets: enabled
iSNS: disabled
First Alternative

First Alternative

© First Alternative 2009 8 of 9 iSCSI © First Alternative 1999 8 of 9 iSCSI


First Alternative First Alternative
iscsi Rev. 1 SA Rev. 3

Solaris iSCSI

iSCSI - Removing discovered devices.


• Firstly, make sure the iSCSI devices are not in use, otherwise
an error will occur.
• Now disable the appropriate discovery method, as shown by
iscsiadm list discovery
# iscsiadm modify discovery --sendtargets disable
• The discovery address can also be removed:-
# iscsiadm remove discovery-address 192.168.200.68:3260
First Alternative

First Alternative

© First Alternative 2009 9 of 9 iSCSI © First Alternative 1999 9 of 9 iSCSI

Das könnte Ihnen auch gefallen