Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
osc-osd/up
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
44 lines (35 sloc)
1 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Path to executables, assuming source tree | |
TGTADM=./tgt/usr/tgtadm | |
OTGTD=./tgt/usr/otgtd | |
# must have target1 | |
BACKSTORE1=/usr0/var/osd-tgt/tgt-0/ | |
# Optional additional back-stores here | |
BACKSTORE2=/usr0/var/osd-tgt/tgt-1/ | |
# BACKSTORE3=/usr0/var/osd-tgt/tgt-2/ | |
# BACKSTORE4=/usr0/var/osd-tgt/tgt-3/ | |
# $1<=BACKSTORE $2<=tid | |
load_target() | |
{ | |
$TGTADM --lld iscsi --mode target --op new --tid $2 --targetname ${1//\//\.}$(hostname) | |
$TGTADM --lld iscsi --mode target \ | |
--op bind --tid $2 --initiator-address ALL | |
$TGTADM --lld iscsi --mode logicalunit \ | |
--op new --tid $2 --lun 0 --bstype=osdemu --device-type osd \ | |
--backing-store $1 | |
} | |
# First run the otgtd daemon in forgraound | |
# -f - forgraound | |
# -d - debug level | |
# DEBUG="-d 9" | |
DEBUG="" | |
$OTGTD $DEBUG -f & | |
sleep 2 | |
# 2nd Load some targets | |
load_target $BACKSTORE1 1 | |
load_target $BACKSTORE2 2 | |
# load_target $BACKSTORE3 3 | |
# load_target $BACKSTORE4 4 | |
# Last print what we got, then stay in forgraound (ctrl-C to exit) | |
$TGTADM --lld iscsi --mode target --op show | |
wait |