File: iscsi-func

package info (click to toggle)
python-diskimage-builder 3.37.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,572 kB
  • sloc: sh: 7,380; python: 6,444; makefile: 37
file content (22 lines) | stat: -rwxr-xr-x 741 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function start_iscsi_target() {
    local iqn=$1
    local dev=$2
    local cli=$3

    # used by tgtd
    mkdir -p /var/run

    ln -s /usr/bin/targetcli /targetcli_bin.py
    /targetcli-wrapper /backstores/block create block1 dev=$dev
    /targetcli-wrapper /iscsi create $iqn
    /targetcli-wrapper /iscsi/$iqn/tpg1/luns create /backstores/block/block1 1
    /targetcli-wrapper /iscsi/$iqn/tpg1/portals create $BOOT_IP_ADDRESS
    /targetcli-wrapper /iscsi/$iqn/tpg1 set attribute authentication=0
    /targetcli-wrapper /iscsi/$iqn/tpg1 set attribute demo_mode_write_protect=0
    /targetcli-wrapper /iscsi/$iqn/tpg1 set attribute generate_node_acls=1

}

function stop_iscsi_target() {
    /targetcli-wrapper clearconfig confirm=True
}