Setup tgtd configuration files
Setup devstack to use tgtd confiuration files.
Change-Id: Icb2a1a0c5ca517604f9a3930e7c89e3be9a36b0c
Signed-off-by: Chuck Short <chuck.short@canonical.com>
diff --git a/stack.sh b/stack.sh
index 0fbb957..5ca52e4 100755
--- a/stack.sh
+++ b/stack.sh
@@ -1699,6 +1699,9 @@
start_service tgtd
fi
+ # Setup tgtd configuration files
+ mkdir -p $NOVA_DIR/volumes
+
# Remove nova iscsi targets
sudo tgtadm --op show --mode target | grep $VOLUME_NAME_PREFIX | grep Target | cut -f3 -d ' ' | sudo xargs -n1 tgt-admin --delete || true
# Clean out existing volumes
@@ -1711,6 +1714,12 @@
fi
if [[ "$os_PACKAGE" = "deb" ]]; then
+
+ # Setup the tgt configuration file
+ if [[ ! -f /etc/tgt/conf.d/nova.conf ]]; then
+ echo "include $NOVA_DIR/volumes/*" | sudo tee /etc/tgt/conf.d/nova.conf
+ fi
+
# tgt in oneiric doesn't restart properly if tgtd isn't running
# do it in two steps
sudo stop tgt || true