(1)
Artikel
bewerten
(86% positiv)
(6)

ubuntu targetcli iscsi persistent reservation

Linux als iscsi Target target to file

Inhalt dieses Artikels:

    Ubuntu als ISCSI Target konfigurieren mittels targetcli (getestet mit Ubuntu 12.04 64bit)

    targetcli unterstützt z.B.  persistent Reservation für Microsoft Cluster 2012

    die präsentierten ISCSI Targets können eigene Disken oder Dateien im Filesystem sein.

    Update 10.9.2014 Ubuntu 14.04 64bit und Server2012R2: persistent reservation besteht den Clustertest nicht.

     

    targetcli kann über die Paketsourcen hinzugefügt werden, das Konfigurieren erfolgt dann im Terminal:

    Pakete Installieren

    name@rechner:~$  sudo apt-get install --no-install-recommends targetcli python-urwid

    Targetcli konfigurieren

    name@rechner:~$ sudo targetcli

    Anlegen eines Festplattenfiles:

    /> cd backstores
    /backstores> cd fileio
    /backstores/fileio> create lun0 /media/home/iscsi-lun0 10g

    iscsi Target

    mit folgenden Befehl kann zu ISCSI gewechselt werden:

    /> /iscsi 

    anlegen des Targets:

    /iscsi> create iqn.2003-01.org.linux-iscsi.test:mytarget
    Created target iqn.2003-01.org.linux-iscsi.test:mytarget.
    Selected TPG Tag 1.
    Successfully created TPG 1.
    Entering new node /iscsi/iqn.2003-01.org.linux-iscsi.test:mytarget/tpgt1
    /iscsi/iqn.20...a672ba1/tpgt1> set attribute authentication=0
    Parameter authentication is now '0'.

    Freigabe der Files

    /iscsi/iqn.20...a672ba1/tpgt1> cd luns
    /iscsi/iqn.20...a1/tpgt1/luns> create /backstores/fileio/lun0
    Selected LUN 0.
    Successfully created LUN 0.
    Entering new node /iscsi/iqn.2003-01.org.linux-iscsi.test:mytarget/tpgt1/luns/lun0
    /iscsi/iqn.20...gt1/luns/lun0> cd ../../portals
    /iscsi/iqn.20...tpgt1/portals> create 192.168.0.3
    Using default IP port 3260
    Successfully created network portal 192.168.0.3:3260.
    Entering new node /iscsi/iqn.2003-01.org.linux-iscsi.test:mytarget/tpgt1/portals/192.168.0.3:3260
    /iscsi/iqn.20....168.0.3:3260> cd ..
    /iscsi/iqn.20...tpgt1/portals> cd ..
    /iscsi/iqn.20...a672ba1/tpgt1> cd acls
    /iscsi/iqn.20...a1/tpgt1/acls> create iqn.1991-05.com.microsoft:hyperv1.domain.local
    /iscsi/iqn.20...a1/tpgt1/acls> create iqn.1991-05.com.microsoft:hyperv2.domain.local

    Konfiguration speichern

    /> saveconfig
    WARNING: Saving sox current configuration to disk will overwrite your boot settings.
    The current target configuration will become the default boot config.
    Are you sure? Type 'yes': yes
    Making backup of loopback/ConfigFS with timestamp: 2013-05-02_21:56:29.949328
    Successfully updated default config /etc/target/loopback_start.sh
    Making backup of fc/ConfigFS with timestamp: 2013-05-02_21:56:29.949328
    Successfully updated default config /etc/target/fc_start.sh
    Making backup of LIO-Target/ConfigFS with timestamp: 2013-05-02_21:56:29.949328
    Generated LIO-Target config: /etc/target/backup/lio_backup-2013-05-02_21:56:29.949328.sh
    Making backup of Target_Core_Mod/ConfigFS with timestamp: 2013-05-02_21:56:29.949328
    Generated Target_Core_Mod config: /etc/target/backup/tcm_backup-2013-05-02_21:56:29.949328.sh
    Successfully updated default config /etc/target/lio_start.sh
    Successfully updated default config /etc/target/tcm_start.sh

    /> exit

     

    2012R2 trotzdem installieren:

     

     

    letzte Änderung dieses Artikels: 30.01.2015 19:45



    Feedback: