aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-07-17 15:32:42 +0000
committerGerrit Code Review <review@openstack.org>2015-07-17 15:32:42 +0000
commita6ccb90922cb8eec0eff84a0dd38e17ad03a84b0 (patch)
treea7bc61f6abc809e7a0d75035c662c47dd70a57e2
parenta5b6b2f0d7a7474280fee554599cd0a3b451e241 (diff)
parent4008ca8619a83ac4ee9c56cb37f42b208d753823 (diff)
downloadkolla-a6ccb90922cb8eec0eff84a0dd38e17ad03a84b0.tar.gz
kolla-a6ccb90922cb8eec0eff84a0dd38e17ad03a84b0.zip
Merge "Start tgtd in cinder-volume container"
-rw-r--r--docker/centos/binary/cinder-app/cinder-volume/Dockerfile9
l---------docker/centos/binary/cinder-app/cinder-volume/tgtd.sh1
-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
-rwxr-xr-xtools/genenv2
6 files changed, 27 insertions, 12 deletions
diff --git a/docker/centos/binary/cinder-app/cinder-volume/Dockerfile b/docker/centos/binary/cinder-app/cinder-volume/Dockerfile
index 0daf6d29e..581f9e03a 100644
--- a/docker/centos/binary/cinder-app/cinder-volume/Dockerfile
+++ b/docker/centos/binary/cinder-app/cinder-volume/Dockerfile
@@ -2,17 +2,10 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%cinder-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
# Install required packages
-# https://bugs.launchpad.net/kolla/+bug/1460129
-# Iscsi will be removed from cinder-volume in a later patch
-# so that we continue to follow the container best practices.
-# There will also be other backends for cinder and iscsi should
-# not be hardcoded here.
RUN yum install -y lvm2 scsi-target-utils && yum clean all
# Add start scripts
+COPY tgtd.sh volume-group-create.sh config-internal.sh config-external.sh /opt/kolla/
COPY start.sh /start.sh
-COPY config-internal.sh config-external.sh /opt/kolla/
-COPY volume-group-create.sh /opt/kolla/volume-group-create.sh
-# Start supervisor
CMD ["/start.sh"]
diff --git a/docker/centos/binary/cinder-app/cinder-volume/tgtd.sh b/docker/centos/binary/cinder-app/cinder-volume/tgtd.sh
new file mode 120000
index 000000000..f0c885577
--- /dev/null
+++ b/docker/centos/binary/cinder-app/cinder-volume/tgtd.sh
@@ -0,0 +1 @@
+../../../../common/cinder-app/cinder-volume/tgtd.sh \ No newline at end of file
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
diff --git a/tools/genenv b/tools/genenv
index 340a576f2..84b42163c 100755
--- a/tools/genenv
+++ b/tools/genenv
@@ -222,7 +222,7 @@ CINDER_BACKUP_NAME_TEMPLATE=backup-%s
CINDER_BACKUP_DRIVER=cinder.backup.drivers.swift
# Cinder Volume
-ISCSI_HELPER=lioadm
+ISCSI_HELPER=tgtadm
ISCSI_IP_ADDRESS=$HOST_IP
CINDER_LVM_LO_VOLUME_SIZE=4G
CINDER_VOLUME_API_LISTEN=$HOST_IP