The UNIX way.

Around the clock, across the globe. By Vladimir Legeza

Share several ZFS volumes over ISCSI. (example)

leave a comment »


#######################################################################################
root@openindiana# zpool status data_pool
pool: data_pool
state: ONLINE
scan: none requested
config:


NAME STATE READ WRITE CKSUM
data_pool ONLINE 0 0 0
raidz1-0 ONLINE 0 0 0
c4t0d0 ONLINE 0 0 0
c4t1d0 ONLINE 0 0 0
c4t2d0 ONLINE 0 0 0
c4t3d0 ONLINE 0 0 0
c4t4d0 ONLINE 0 0 0
c4t5d0 ONLINE 0 0 0
c4t6d0 ONLINE 0 0 0
c4t7d0 ONLINE 0 0 0
c4t8d0 ONLINE 0 0 0
c4t9d0 ONLINE 0 0 0
c4t10d0 ONLINE 0 0 0
c4t11d0 ONLINE 0 0 0
c4t12d0 ONLINE 0 0 0
c4t13d0 ONLINE 0 0 0
c4t14d0 ONLINE 0 0 0


errors: No known data_pool errors



root@openindiana# zfs list |grep data_pool
data_pool      37.1T 2.32G 51.8K /data
data_pool/vol1 18.6T 18.6T 29.6K -
data_pool/vol2 18.6T 18.6T 29.6K -


#######################################################################################
root@openindiana# itadm create-tpg tpg1 192.168.0.100:3260
root@openindiana# itadm list-tpg -v
TARGET PORTAL GROUP PORTAL COUNT
tpg1 1
portals: 192.168.0.100:3260


#######################################################################################
root@openindiana# itadm create-target -l vol1 -t tpg1
Target iqn.2010-09.org.openindiana:02:3c68835e-4a03-c9bb-8937-caf4be0f6ed7 successfully created


root@openindiana# itadm create-target -l vol2 -t tpg1
Target iqn.2010-09.org.openindiana:02:c193dfc8-c9bc-e30f-92e0-808f1467cef0 successfully created


root@openindiana# itadm list-target -v
TARGET NAME STATE SESSIONS
iqn.2010-09.org.openindiana:02:c193dfc8-c9bc-e30f-92e0-808f1467cef0 online 0
alias: vol2
auth: none (defaults)
targetchapuser: -
targetchapsecret: unset
tpg-tags: tpg1 = 2
iqn.2010-09.org.openindiana:02:3c68835e-4a03-c9bb-8937-caf4be0f6ed7 online 0
alias: vol1
auth: none (defaults)
targetchapuser: -
targetchapsecret: unset
tpg-tags: tpg1 = 2
root@openindiana# stmfadm offline-target iqn.2010-09.org.openindiana:02:3c68835e-4a03-c9bb-8937-caf4be0f6ed7
root@openindiana# stmfadm offline-target iqn.2010-09.org.openindiana:02:c193dfc8-c9bc-e30f-92e0-808f1467cef0


#######################################################################################
root@openindiana# stmfadm create-tg vol1-tg
root@openindiana# stmfadm add-tg-member -g vol1-tg iqn.2010-09.org.openindiana:02:3c68835e-4a03-c9bb-8937-caf4be0f6ed7
root@openindiana# stmfadm create-tg vol2-tg
root@openindiana# stmfadm add-tg-member -g vol2-tg iqn.2010-09.org.openindiana:02:c193dfc8-c9bc-e30f-92e0-808f1467cef0
root@openindiana# stmfadm list-tg -v
Target Group: vol1-tg
Member: iqn.2010-09.org.openindiana:02:3c68835e-4a03-c9bb-8937-caf4be0f6ed7
Target Group: vol2-tg
Member: iqn.2010-09.org.openindiana:02:c193dfc8-c9bc-e30f-92e0-808f1467cef0


#######################################################################################
root@openindiana# stmfadm create-lu -s 100T /dev/zvol/rdsk/data_pool/vol1
Logical unit created: 600144F0897FC2000000514596240001
root@openindiana# stmfadm create-lu -s 100T /dev/zvol/rdsk/data_pool/vol2
Logical unit created: 600144F0897FC200000051459BD60002
root@openindiana# stmfadm list-lu -v
LU Name: 600144F0897FC2000000514596240001
Operational Status: Online
Provider Name : sbd
Alias : /dev/zvol/rdsk/data_pool/vol1
View Entry Count : 1
Data File : /dev/zvol/rdsk/data_pool/vol1
Meta File : not set
Size : 109951162777600
Block Size : 512
Management URL : not set
Vendor ID : OI
Product ID : COMSTAR
Serial Num : not set
Write Protect : Disabled
Writeback Cache : Enabled
Access State : Active
LU Name: 600144F0897FC200000051459BD60002
Operational Status: Online
Provider Name : sbd
Alias : /dev/zvol/rdsk/data_pool/vol2
View Entry Count : 1
Data File : /dev/zvol/rdsk/data_pool/vol2
Meta File : not set
Size : 109951162777600
Block Size : 512
Management URL : not set
Vendor ID : OI
Product ID : COMSTAR
Serial Num : not set
Write Protect : Disabled
Writeback Cache : Enabled
Access State : Active


#######################################################################################
root@openindiana# stmfadm add-view -t vol1-tg 600144F0897FC2000000514596240001
root@openindiana# stmfadm list-view -l 600144F0897FC2000000514596240001
View Entry: 0
Host group : All
Target group : vol1-tg
LUN : 0


root@openindiana# stmfadm add-view -t vol2-tg 600144F0897FC200000051459BD60002
root@openindiana# stmfadm list-view -l 600144F0897FC200000051459BD60002
View Entry: 0
Host group : All
Target group : vol2-tg
LUN : 0

Advertisements

Written by Vladimir Legeza

April 1, 2013 at 7:58 am

Posted in ISCSI, Solaris, ZFS

Tagged with , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: