Skip to content

Commit

Permalink
open-osd: (tgt-merge-1.0.0) Remove auto configuration of /tmp osd-target
Browse files Browse the repository at this point in the history
Few changes at tgt
* Use patch by Arne Redlich <arne.redlich@googlemail.com> that removes
  the dummy RAID controller from LUN 0. At startup tgt loads without
  any LUN(s)
* Do not use the patch that adds a default osd-target at
  /tmp/tgt-$(id -nu). Again tgt is initially empty.
* Rebase on tgt version 1.0.0

Therefore at ./up load some osd-targets:
* At top of script file define some osd backhand directories. Now easily
  changeable by users
* optionally load all (up to 4) defined backhands as LUNs.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
  • Loading branch information
Boaz Harrosh committed Jan 7, 2010
1 parent dbea1df commit 60eb143
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tgt
Submodule tgt updated from 2f281d to 68c802
42 changes: 33 additions & 9 deletions up
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/sh

# TODO:
# currently this is dependent on Pete's patch to tgt:
# [PATCH] local auto config (6b47263d)
# This dependency should be removed and this script should include
# all the necessary steps needed for a default OSD target
# must have LUN0
BACKSTORE0=/usr0/var/osd-tgt/tgt-0/
# Optional additional LUNes here
BACKSTORE1=/usr0/var/osd-tgt/tgt-1/
BACKSTORE2=/usr0/var/osd-tgt/tgt-2/
BACKSTORE3=/usr0/var/osd-tgt/tgt-3/

TGTADM=./tgt/usr/tgtadm
# -f - forgraound
# -d - debug level
# DEBUG="-d 9"
Expand All @@ -14,9 +16,31 @@ DEBUG=""
./tgt/usr/tgtd $DEBUG -f &

sleep 2
./tgt/usr/tgtadm --lld iscsi --mode logicalunit \
--op new --tid 1 --lun 2 --bstype=osdemu --device-type osd \
--backing-store /tmp/tgt-bharrosh-2/
$TGTADM --lld iscsi --mode target --op new --tid 1 --targetname $(hostname)
$TGTADM --lld iscsi --mode target \
--op bind --tid 1 --initiator-address ALL

tgt/usr/tgtadm --lld iscsi --mode target --op show
$TGTADM --lld iscsi --mode logicalunit \
--op new --tid 1 --lun 0 --bstype=osdemu --device-type osd \
--backing-store $BACKSTORE0

if [ -n $BACKSTORE1 ]; then
$TGTADM --lld iscsi --mode logicalunit \
--op new --tid 1 --lun 1 --bstype=osdemu --device-type osd \
--backing-store $BACKSTORE1
fi

if [ -n $BACKSTORE2 ]; then
$TGTADM --lld iscsi --mode logicalunit \
--op new --tid 1 --lun 2 --bstype=osdemu --device-type osd \
--backing-store $BACKSTORE2
fi

if [ -n $BACKSTORE3 ]; then
$TGTADM --lld iscsi --mode logicalunit \
--op new --tid 1 --lun 3 --bstype=osdemu --device-type osd \
--backing-store $BACKSTORE3
fi

$TGTADM --lld iscsi --mode target --op show
wait

0 comments on commit 60eb143

Please sign in to comment.