On 5/1/07, cedric briner wrote: > Hi, > I'm quite new to solaris, and I'd like to do a zfs pool of an iscsi > device. What is the good way of doing so: > > 0) The big Question is : > How can I achieve an exportation of a whole disk with iscsi. In a manner > that I can clearly use it in a zpool > alternatively through iscsi OR directly attached ?
Hello Cedric I'm a little confused by what exactly you are trying to do here, and why. I will try & explain what you can do, and what works, and lets see if that helps. The iscsi target needs a backing store. I can think of 3 ways of doing the backing store. 1) Use a file on an existing file system - useful for doing a quick test. 2) Use a dedicated hard-drive - You can use 'raw' mode if it is a scsi disk. 3) Use a ZFS pool - This is I think the easiest and best way. Cedric, you seem to be using method 2). I have used this technique myself, & you can see example in these posts: http://mail.opensolaris.org/pipermail/storage-discuss/2007-April/001061.html http://mail.opensolaris.org/pipermail/storage-discuss/2007-April/001093.html Here's how I do method 3) on my PC: # format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0t0d0 <SEAGATE-ST318405LW-0105-17.09GB> /[EMAIL PROTECTED],0/pci8086,[EMAIL PROTECTED]/pci9005,[EMAIL PROTECTED]/[EMAIL PROTECTED],0 1. c2t0d0 <DEFAULT cyl 9723 alt 2 hd 255 sec 63> /[EMAIL PROTECTED],0/pci1028,[EMAIL PROTECTED],2/[EMAIL PROTECTED],0 Specify disk (enter its number): # zpool create tank c0t0d0 # zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT tank 17G 88K 17.0G 0% ONLINE - # zfs create -s -V 10gb tank/iscsi-zvol # zfs list NAME USED AVAIL REFER MOUNTPOINT tank 110K 16.7G 24.5K /tank tank/iscsi-zvol 22.5K 16.7G 22.5K - # zfs set shareiscsi=on tank/iscsi-zvol # iscsitadm list target -v Target: tank/iscsi-zvol iSCSI Name: iqn.1986-03.com.sun:02:b0737f95-bd49-e3a3-e75c-b4272e552411 Alias: tank/iscsi-zvol Connections: 0 ACL list: TPGT list: LUN information: LUN: 0 GUID: 0x0 VID: SUN PID: SOLARIS Type: disk Size: 10G Backing store: /dev/zvol/rdsk/tank/iscsi-zvol Status: online Ok, now the iscsi target PC is sharing out the backing store over the network. Normally you would run the iscsi initiator on another PC connected across Ethernet. But for testing, is is possible to run the initiator on the same PC by just using the discover address of localhost: 127.0.0.1 # iscsiadm add discovery-address 127.0.0.1 # iscsiadm modify discovery -t enable # iscsiadm list target Target: iqn.1986-03.com.sun:02:b0737f95-bd49-e3a3-e75c-b4272e552411 Alias: tank/iscsi-zvol TPGT: 1 ISID: 4000002a0000 Connections: 1 # format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0t0d0 <SEAGATE-ST318405LW-0105-17.09GB> /[EMAIL PROTECTED],0/pci8086,[EMAIL PROTECTED]/pci9005,[EMAIL PROTECTED]/[EMAIL PROTECTED],0 1. c2t0d0 <DEFAULT cyl 9723 alt 2 hd 255 sec 63> /[EMAIL PROTECTED],0/pci1028,[EMAIL PROTECTED],2/[EMAIL PROTECTED],0 2. c4t010000123F71738800002A0044568CBCd0 <DEFAULT cyl 1303 alt 2 hd 255 sec 63> /scsi_vhci/[EMAIL PROTECTED] Specify disk (enter its number): Ok, now on the initiator PC, you can create a ZFS pool using the iscsi target. This looks really weird if the initiator & target are on the same PC! # zpool create tank2 c4t010000123F71738800002A0044568CBCd0 # zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT tank 17G 184K 17.0G 0% ONLINE - tank2 9.94G 89K 9.94G 0% ONLINE - So this is effectively ZFS-on-ZFS ! > and then if I ``un-iscsi'' it ! > zpool export mtank > iscsiadm remove discovery-address 127.0.0.1 > iscsitadm delete target --lun 0 vol-2 > and then I try to re-use directly the c1d0 with no success :( > zpool import mtank > cannot import 'mtank': no such pool available Cedric, I don't think you are allowed to do that. I'm not sure why you would want to try - can you explain more clearly what you are trying to do here. Thanks Nigel Smith This message posted from opensolaris.org _______________________________________________ storage-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/storage-discuss
