My Blog

January 5, 2009

iSCSI storage with zvols – setup iscsi on Solaris 10

Filed under: Unix — by enotebook @ 4:25 pm
Tags: ,

Solairs 10 supports iscsi storage via ZFS, following shows the process to setup iscsi storage with zvols

1. create a pool on the server and share it over iscsi.
bash-3.00# zpool create iscsistore c0t1d0
bash-3.00# zfs create -s -V 30gb iscsistore/zvol
bash-3.00# zfs set shareiscsi=on iscsistore/zvol
bash-3.00# iscsitadm list target -v
Target: iscsistore/zol
iSCSI Name: iqn.1986-03.com.sun:02:04342d14-f21d-c534-e00c-a417327804e7
Alias: iscsistore/zol
Connections: 1
Initiator:
iSCSI Name: iqn.1986-03.com.sun:01:4afacef3ffff.494a1fa4
Alias: unknown
ACL list:
TPGT list:
LUN information:
LUN: 0
GUID: 01000013728528c000002a00494b45bd
VID: SUN
PID: SOLARIS
Type: disk
Size:   30G
Backing store: /dev/zvol/rdsk/iscsistore/zol
Status: online
bash-3.00#

2. on the client, we need to discover the iSCSI share (172.16.113.146 is the IP of the server):
bash-3.00# iscsiadm list discovery
Discovery:
Static: disabled
Send Targets: enabled
iSNS: disabled

bash-3.00# iscsiadm modify discovery –sendtargets enable
bash-3.00# iscsiadm add discovery-address 172.16.113.146
bash-3.00# svcadm enable network/iscsi_initiator
bash-3.00# iscsiadm list target
bash-3.00# iscsiadm list target
Target: iqn.1986-03.com.sun:02:04342d14-f21d-c534-e00c-a417327804e7
Alias: iscsistore/zol
TPGT: 1
ISID: 4000002a0000
Connections: 1
bash-3.00#

3. now we can format the shared iscsi storage as needed on the client
bash-3.00# format
Searching for disks…done

AVAILABLE DISK SELECTIONS:
0. c1d0 <DEFAULT cyl 10526 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0
1. c2t01000013728528C000002A00494B45BDd0 <DEFAULT cyl 3913 alt 2 hd 255 sec 63>
/scsi_vhci/disk@g01000013728528c000002a00494b45bd
Specify disk (enter its number): 1
selecting c2t01000013728528C000002A00494B45BDd0
[disk formatted]

FORMAT MENU:
disk       – select a disk
type       – select (define) a disk type
partition  – select (define) a partition table
current    – describe the current disk
format     – format and analyze the disk
fdisk      – run the fdisk program
repair     – repair a defective sector
label      – write label to the disk
analyze    – surface analysis
defect     – defect list management
backup     – search for backup labels
verify     – read and display labels
save       – save new disk/partition definitions
inquiry    – show vendor, product and revision
volname    – set 8-character volume name
!<cmd>     – execute <cmd>, then return
quit
format> q
bash-3.00#
Done.

Advertisements

Blog at WordPress.com.