Skip to content

Commit

Permalink
open-osd: up-pan: Add StorageBlade csh version of ./up
Browse files Browse the repository at this point in the history
This is a csh version of ./up scrip as needed on Panasas
StorageBlade.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
  • Loading branch information
Boaz Harrosh committed Nov 3, 2011
1 parent 9652186 commit f2378b4
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions up-pan
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/csh -x

# On Pan-OSD there is only one target
set BACKSTORE0=/root/pandata/
# Path to pan_tgtd executables, assuming p4 integration
dir="/pan/bin"
set TGTADM=$dir/tgtadm
set OTGTD=$dir/pan_tgtd

# Get the osd device id
set TARGETNAME=`/pan/bin/getdevinfo -q datasn`
# logfile name
set LOG="/var/log/otgtd.log"

switch($1)
case "down":
killall $OTGTD
exit
breaksw

case "log":
less +F $LOG
exit
breaksw
case "log-reset":
echo > $LOG
exit
breaksw

default:
if ("$1" != "") then
echo "what is $0 $1?!?"
exit
endif
breaksw
endsw

# On Panasas-osd we must make sure that:
mkdir -p $BACKSTORE0/
ln -sf /pandata $BACKSTORE0/dfiles

echo "================ `date` =========================" >> $LOG

# First run the otgtd daemon in forgraound
# -f - forgraound
# -d - debug level
# DEBUG="-d 9"
#set DEBUG ""
$OTGTD --iscsi portal=:3251 -f >>& $LOG &

sleep 2

# 2nd Load the target
#load_target $BACKSTORE0 1
$TGTADM --lld iscsi --mode target --op new --tid 1 --targetname=$TARGETNAME
$TGTADM --lld iscsi --mode target \
--op bind --tid 1 --initiator-address ALL

$TGTADM --lld iscsi --mode logicalunit \
--op new --tid 1 --lun 0 --bstype=osdemu --device-type osd \
--backing-store $BACKSTORE0 --osd_name 06$TARGETNAME

# Last print what we got
$TGTADM --lld iscsi --mode target --op show

echo "otgtd started, run up down to stop"

0 comments on commit f2378b4

Please sign in to comment.