ZFS+iSCSI = le SAN pas cher

De OpenWikiBSD
Aller à : navigation, rechercher

C'est le nouveau et terrible gestionnaire de FS + Gestionnaire de volume de SUN.

Voir Système_de_fichiers_ZFS pour la partie relative à ZFS

Installation

# svcadm enable iscsitgt
# svcs iscsitgt

 STATE          STIME    FMRI
 online         14:20:11 svc:/system/iscsitgt:default

# iostat -En



# zpool create tank raidz2  c0t1d0 c0t2d0 c0t3d0 c0t4d0 c0t5d0 c0t6d0
# zpool status
  pool : tank
 état : ONLINE
 purger : aucun requis
configuration :

        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          raidz2    ONLINE       0     0     0
            c0t1d0  ONLINE       0     0     0
            c0t2d0  ONLINE       0     0     0
            c0t3d0  ONLINE       0     0     0
            c0t4d0  ONLINE       0     0     0
            c0t5d0  ONLINE       0     0     0
            c0t6d0  ONLINE       0     0     0

erreurs : aucune erreur de données connue


# zpool list
NAME   SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
tank   816G   230K   816G     0%  ONLINE  -

# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
tank   144K   535G  36,0K  /tank

Création du volume:
# zfs create tank/iSCSI

# zfs list
NAME         USED  AVAIL  REFER  MOUNTPOINT
tank         195K   535G  36,0K  /tank
tank/iSCSI  36,0K   535G  36,0K  /tank/iSCSI

# zfs set shareiscsi=on tank/iSCSI

# zfs set compression=on tank.iSCSI

Inutile : # iscsitadm modify admin --base-directory /etc/iscsi/config For Solaris ZFS volumes, use the zfs set command and specify the volume name mypool/myvol for the target. For other backing storage, such as a file or disk slice, use the iscsitadm command.

NON # Création target iscsi avec son LUN : NON # iscsiadm add static-config iqn.1986-03.com.sun:02:30754ba8-14b7-61bd-c14c-d776e5375c7f.itarget,172.12.0.44:3260

  1. iscsiadm list static-config

Static Configuration Target: iqn.1986-03.com.sun:02:30754ba8-14b7-61bd-c14c-d776e5375c7f.itarget,172.12.0.44:326

  1. iscsiadm modify discovery -s enable
  2. devfsadm -i iscsi -v


man zfs.... ca peut aider..

# zfs create -V 250G SAN/ESX1
# zfs set shareiscsi=on SAN/ESX1
# zfs set compression=on SAN/ESX1
# iscsitadm list target
Target: SAN/ESX1
    iSCSI Name: iqn.1986-03.com.sun:02:82551545-fd63-46ca-e694-beb8b2e39d9c
    Connections: 0


Tests

Voilà ! SI j'ai bien compris, le volume iSCSI est OK, et en ligne !

On teste :

  • Sous Linux :
apt-get install open-iscsi
sudo  iscsiadm --mode discovery --type sendtargets --portal hadron
[sudo] password for phil: 
IP1:3260,1 iqn.1986-03.com.sun:02:82555-fd63-46ca-e69.....
IP2:3260,1 iqn.1986-03.com.sun:02:82555-fd63-46ca-e69.....
  • Sous Solaris
# iscsiadm list target
Target: iqn.1986-03.com.sun:02:4ba8-14b7-61bd-c14c-d...itarget
        Alias: -
        ISID: 40002a00
        Connections: 0


# iscsiadm list initiator-node
Initiator node name: iqn.1986-03.com.sun:01:badadcefffff.4a327a8f
Initiator node alias: -
        Login Parameters (Default/Configured):
                Header Digest: NONE/-
                Data Digest: NONE/-
        Authentication Type: NONE
        RADIUS Server: NONE
        RADIUS access: unknown

# iscsiadm list discovery
Discovery:
        Static: enabled
        Send Targets: disabled
        iSNS: disabled

  1. iscsiadm add discovery-address 172.12.0.44
  2. iscsiadm list target

Target: iqn.1986-03.com.sun:02:30754ba8-14b7-61bd-c14c-d776e5375c7f.itarget

       Alias: -
       ISID: 4000002a0000
       Connections: 0

On reprend. Il FAUT une target locale !

iscsitadm create target --lun 0 --alias iTgt --size 400G iSCSI1

  1. iscsitadm list target -v

Target: iscsi1

   iSCSI Name: iqn.1986-03.com.sun:02:e1fcba0d-8b85-c14e-9e42-acbc9afca578.iTgt
   Alias: iTgt
   Connections: 0
   ACL list:
   TPGT list:
   LUN information:
       LUN: 0
           GUID: 600144f04a40d55500001e682f026400
           VID: SUN
           PID: SOLARIS
           Type: disk
           Size:  400G
           Status: unknown



Doc : TB/1

TB/2

[1]

ZFS :