aboutsummaryrefslogtreecommitdiff
path: root/docker/common
diff options
context:
space:
mode:
Diffstat (limited to 'docker/common')
-rwxr-xr-x[-rw-r--r--]docker/common/cinder-app/cinder-volume/config-external.sh0
-rwxr-xr-xdocker/common/cinder-app/cinder-volume/config-internal.sh10
-rwxr-xr-xdocker/common/cinder-app/cinder-volume/tgtd.sh17
3 files changed, 24 insertions, 3 deletions
diff --git a/docker/common/cinder-app/cinder-volume/config-external.sh b/docker/common/cinder-app/cinder-volume/config-external.sh
index 5f57ab939..5f57ab939 100644..100755
--- a/docker/common/cinder-app/cinder-volume/config-external.sh
+++ b/docker/common/cinder-app/cinder-volume/config-external.sh
diff --git a/docker/common/cinder-app/cinder-volume/config-internal.sh b/docker/common/cinder-app/cinder-volume/config-internal.sh
index 9b3998967..0b0d9b95c 100755
--- a/docker/common/cinder-app/cinder-volume/config-internal.sh
+++ b/docker/common/cinder-app/cinder-volume/config-internal.sh
@@ -74,9 +74,6 @@ sed -i 's/use_lvmetad = 1/use_lvmetad = 0/' /etc/lvm/lvm.conf
#Adding LVM filter
sed -i 's:filter = \[ "a/.\*/" \]:filter = \[ "a/sda/", "r/.\*/"\]:g' /etc/lvm/lvm.conf
-#Adding cinder volumes to tgtd config
-echo "include /etc/cinder/volumes/*" >> /etc/tgt/tgtd.conf
-
# https://bugs.launchpad.net/kolla/+bug/1461635
# Cinder requires mounting /dev in the cinder-volume, nova-compute,
# and libvirt containers. If /dev/pts/ptmx does not have proper permissions
@@ -86,5 +83,12 @@ echo "include /etc/cinder/volumes/*" >> /etc/tgt/tgtd.conf
# **Temporary fix**
chmod 666 /dev/pts/ptmx
+#Adding cinder volumes to tgtd config
+echo "include /etc/cinder/volumes/*" >> /etc/tgt/tgtd.conf
+echo "include /var/lib/cinder/volumes/*" >> /etc/tgt/targets.conf
+
+echo "Starging iSCSI tgtd"
+/opt/kolla/tgtd.sh
+
echo "Starting cinder-volume"
exec /usr/bin/cinder-volume --config-file /etc/cinder/cinder.conf
diff --git a/docker/common/cinder-app/cinder-volume/tgtd.sh b/docker/common/cinder-app/cinder-volume/tgtd.sh
new file mode 100755
index 000000000..33d9461a0
--- /dev/null
+++ b/docker/common/cinder-app/cinder-volume/tgtd.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+set -e
+
+DESC="target framework daemon"
+DAEMON=/usr/sbin/tgtd
+
+TGTD_CONFIG=/etc/tgt/targets.conf
+
+echo "Starting tgtd $DESC"
+/usr/sbin/tgtd
+echo "Set to offline"
+tgtadm --op update --mode sys --name State -v offline
+echo "Set tgt config"
+tgt-admin -e -c $TGTD_CONFIG
+echo "Set to ready"
+tgtadm --op update --mode sys --name State -v ready