Merge "Remove config-internal from cinder"

This commit is contained in:
Jenkins 2015-08-09 17:18:29 +00:00 committed by Gerrit Code Review
commit 41051e7009
34 changed files with 11 additions and 484 deletions

View File

@ -2,7 +2,7 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%cinder-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
RUN yum install -y python-keystone && yum clean all
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
COPY ./start.sh ./check.sh /
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/cinder-app/cinder-api/config-internal.sh

View File

@ -1 +0,0 @@
../../../../common/cinder-app/cinder-backup/config-internal.sh

View File

@ -2,6 +2,3 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
RUN yum -y install openstack-cinder automaton && yum clean all
COPY config-cinder.sh /opt/kolla/config-cinder.sh

View File

@ -1 +0,0 @@
../../../../common/cinder-app/cinder-base/config-cinder.sh

View File

@ -2,6 +2,6 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%cinder-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY ./start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/cinder-app/cinder-scheduler/config-internal.sh

View File

@ -5,7 +5,7 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
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 config-external.sh /opt/kolla/
COPY start.sh /start.sh
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/cinder-app/cinder-volume/config-internal.sh

View File

@ -1 +0,0 @@
../../../../common/cinder-app/cinder-volume/tgtd.sh

View File

@ -1 +0,0 @@
../../../../common/cinder-app/cinder-volume/volume-group-create.sh

View File

@ -3,7 +3,7 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
RUN pip install python-keystoneclient
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
COPY ./start.sh ./check.sh /
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/cinder-app/cinder-api/config-internal.sh

View File

@ -2,6 +2,6 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%cinder-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY ./start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/cinder-app/cinder-backup/config-internal.sh

View File

@ -14,6 +14,3 @@ RUN cd /cinder \
&& cp /etc/cinder/cinder.conf.sample /etc/cinder/cinder.conf \
&& chown -R cinder: /etc/cinder /var/log/cinder \
&& rm -rf /root/.cache
COPY config-cinder.sh /opt/kolla/config-cinder.sh

View File

@ -1 +0,0 @@
../../../../common/cinder-app/cinder-base/config-cinder.sh

View File

@ -2,6 +2,6 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%cinder-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY ./start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/cinder-app/cinder-scheduler/config-internal.sh

View File

@ -8,7 +8,7 @@ RUN yum install -y \
&& yum clean all
# Add start scripts
COPY tgtd.sh volume-group-create.sh config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
COPY start.sh /start.sh
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/cinder-app/cinder-volume/config-internal.sh

View File

@ -1 +0,0 @@
../../../../common/cinder-app/cinder-volume/tgtd.sh

View File

@ -1 +0,0 @@
../../../../common/cinder-app/cinder-volume/volume-group-create.sh

View File

@ -1,77 +0,0 @@
#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
. /opt/kolla/config-cinder.sh
check_required_vars ADMIN_TENANT_NAME \
CINDER_API_SERVICE_HOST \
CINDER_API_SERVICE_LISTEN \
CINDER_API_SERVICE_PORT \
CINDER_KEYSTONE_PASSWORD \
CINDER_KEYSTONE_USER \
KEYSTONE_ADMIN_SERVICE_HOST \
KEYSTONE_ADMIN_SERVICE_PORT \
KEYSTONE_AUTH_PROTOCOL \
KEYSTONE_ADMIN_TOKEN \
PUBLIC_IP
fail_unless_os_service_running keystone
cfg=/etc/cinder/cinder.conf
# Set the auth credentials
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0"
# Create Keystone User
crux user-create --update \
-n "${CINDER_KEYSTONE_USER}" \
-p "${CINDER_KEYSTONE_PASSWORD}" \
-t "${ADMIN_TENANT_NAME}" \
-r admin
# Configure Keystone
crux endpoint-create --remove-all \
-n cinder \
-t volume \
-P "http://${CINDER_API_SERVICE_HOST}:${CINDER_API_SERVICE_PORT}/v2/\$(tenant_id)s" \
-A "http://${CINDER_API_SERVICE_HOST}:${CINDER_API_SERVICE_PORT}/v2/\$(tenant_id)s" \
-I "http://${CINDER_API_SERVICE_HOST}:${CINDER_API_SERVICE_PORT}/v2/\$(tenant_id)s"
crux endpoint-create --remove-all \
-n cinderv2 \
-t volumev2 \
-P "http://${CINDER_API_SERVICE_HOST}:${CINDER_API_SERVICE_PORT}/v2/\$(tenant_id)s" \
-A "http://${CINDER_API_SERVICE_HOST}:${CINDER_API_SERVICE_PORT}/v2/\$(tenant_id)s" \
-I "http://${CINDER_API_SERVICE_HOST}:${CINDER_API_SERVICE_PORT}/v2/\$(tenant_id)s"
# Logging
crudini --set $cfg \
DEFAULT \
log_file \
"${CINDER_API_LOG_FILE}"
# API Configuration
crudini --set $cfg \
DEFAULT \
osapi_volume_listen \
"${CINDER_API_SERVICE_LISTEN}"
crudini --set $cfg \
DEFAULT \
osapi_volume_listen_port \
"${CINDER_API_SERVICE_PORT}"
crudini --set $cfg \
DEFAULT \
enable_v1_api \
"false"
crudini --set $cfg \
DEFAULT \
enable_v2_api \
"true"
echo "Starting cinder-api"
exec /usr/bin/cinder-api --config-file $cfg

View File

@ -8,7 +8,7 @@ ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
# Execute config strategy
set_configs
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases

View File

@ -1,47 +0,0 @@
#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
. /opt/kolla/config-cinder.sh
check_required_vars CINDER_BACKUP_API_CLASS \
CINDER_BACKUP_MANAGER \
CINDER_BACKUP_NAME_TEMPLATE \
CINDER_BACKUP_DRIVER
cfg=/etc/cinder/cinder.conf
# volume backup configuration
crudini --set $cfg \
DEFAULT \
backup_driver \
"${CINDER_BACKUP_DRIVER}"
crudini --set $cfg \
DEFAULT \
backup_topic \
"cinder-backup"
crudini --set $cfg \
DEFAULT \
backup_manager \
"${CINDER_BACKUP_MANAGER}"
crudini --set $cfg \
DEFAULT \
backup_api_class \
"${CINDER_BACKUP_API_CLASS}"
crudini --set $cfg \
DEFAULT \
backup_name_template \
"${CINDER_BACKUP_NAME_TEMPLATE}"
# 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
# on the host, then libvirt will fail to boot an instance.
# This is a bug in Docker where it is not correctly mounting /dev/pts
# Tech Debt tracker: https://bugs.launchpad.net/kolla/+bug/1468962
# **Temporary fix**
chmod 666 /dev/pts/ptmx
echo "Starting cinder-backup"
exec /usr/bin/cinder-backup --config-file $cfg

View File

@ -8,7 +8,7 @@ ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
# Execute config strategy
set_configs
exec $CMD $ARGS

View File

@ -1,157 +0,0 @@
#!/bin/sh
set -e
. /opt/kolla/kolla-common.sh
check_required_vars ADMIN_TENANT_NAME \
CINDER_API_VERSION \
CINDER_DB_NAME \
CINDER_DB_PASSWORD \
CINDER_DB_USER \
CINDER_KEYSTONE_PASSWORD \
CINDER_KEYSTONE_USER \
GLANCE_API_SERVICE_HOST \
GLANCE_API_SERVICE_PORT \
KEYSTONE_AUTH_PROTOCOL \
KEYSTONE_PUBLIC_SERVICE_HOST \
MARIADB_SERVICE_HOST \
PUBLIC_IP \
RABBITMQ_SERVICE_HOST \
RABBITMQ_SERVICE_HOST \
RABBITMQ_SERVICE_PORT \
RABBIT_PASSWORD \
RABBIT_USERID
dump_vars
cat > /openrc <<EOF
export OS_AUTH_URL="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_PUBLIC_SERVICE_HOST}:${KEYSTONE_PUBLIC_SERVICE_PORT}/v2.0"
export OS_USERNAME="${CINDER_KEYSTONE_USER}"
export OS_PASSWORD="${CINDER_KEYSTONE_PASSWORD}"
export OS_TENANT_NAME="${ADMIN_TENANT_NAME}"
export OS_VOLUME_API_VERSION=$CINDER_API_VERSION
EOF
cfg=/etc/cinder/cinder.conf
# Logging
crudini --set $cfg \
DEFAULT \
log_dir \
"${CINDER_LOG_DIR}"
crudini --set $cfg \
DEFAULT \
verbose \
"${VERBOSE_LOGGING}"
crudini --set $cfg \
DEFAULT \
debug \
"${DEBUG_LOGGING}"
# backend
crudini --set $cfg \
DEFAULT \
rpc_backend \
"cinder.openstack.common.rpc.impl_kombu"
# rabbit
crudini --set $cfg \
DEFAULT \
rabbit_host \
"${RABBITMQ_SERVICE_HOST}"
crudini --set $cfg \
DEFAULT \
rabbit_port \
"${RABBITMQ_SERVICE_PORT}"
crudini --set $cfg \
DEFAULT \
rabbit_hosts \
"${RABBITMQ_SERVICE_HOST}:${RABBITMQ_SERVICE_PORT}"
crudini --set $cfg \
DEFAULT \
rabbit_userid \
"${RABBIT_USERID}"
crudini --set $cfg \
DEFAULT \
rabbit_password \
"${RABBIT_PASSWORD}"
crudini --set /etc/cinder/cinder.conf \
DEFAULT \
rabbit_virtual_host \
"/"
crudini --set /etc/cinder/cinder.conf \
DEFAULT \
rabbit_ha_queues \
"False"
# control_exchange
crudini --set /etc/cinder/cinder.conf \
DEFAULT \
control_exchange \
"openstack"
# glance
crudini --set $cfg \
DEFAULT \
glance_host \
"${GLANCE_API_SERVICE_HOST}"
crudini --set $cfg \
DEFAULT \
glance_port \
"${GLANCE_API_SERVICE_PORT}"
# database
crudini --set $cfg \
database \
connection \
"mysql://${CINDER_DB_USER}:${CINDER_DB_PASSWORD}@${MARIADB_SERVICE_HOST}/${CINDER_DB_NAME}"
# keystone
crudini --set $cfg \
DEFAULT \
auth_strategy \
"keystone"
crudini --del $cfg \
keystone_authtoken \
auth_protocol
crudini --del $cfg \
keystone_authtoken \
auth_host
crudini --del $cfg \
keystone_authtoken \
auth_port
crudini --set $cfg \
keystone_authtoken \
auth_uri \
"${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_PUBLIC_SERVICE_HOST}:${KEYSTONE_PUBLIC_SERVICE_PORT}/v2.0"
crudini --set $cfg \
keystone_authtoken \
identity_uri \
"${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}"
crudini --set $cfg \
keystone_authtoken \
admin_tenant_name \
"${ADMIN_TENANT_NAME}"
crudini --set $cfg \
keystone_authtoken \
admin_user \
"${CINDER_KEYSTONE_USER}"
crudini --set $cfg \
keystone_authtoken \
admin_password \
"${CINDER_KEYSTONE_PASSWORD}"
# oslo_concurrency
crudini --set $cfg \
oslo_concurrency \
disable_process_locking \
True
mkdir -p /var/lib/cinder/locks
crudini --set $cfg \
oslo_concurrency \
lock_path \
/var/lib/cinder/locks

View File

@ -1,35 +0,0 @@
#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
. /opt/kolla/config-cinder.sh
fail_unless_db
check_required_vars CINDER_DB_NAME \
CINDER_DB_PASSWORD \
CINDER_DB_USER \
DB_ROOT_PASSWORD \
INIT_CINDER_DB \
MARIADB_SERVICE_HOST
cfg=/etc/cinder/cinder.conf
if [ "${INIT_CINDER_DB}" == "true" ]; then
mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${CINDER_DB_NAME};
GRANT ALL PRIVILEGES ON ${CINDER_DB_NAME}.* TO
'${CINDER_DB_USER}'@'%' IDENTIFIED BY '${CINDER_DB_PASSWORD}'
EOF
su -s /bin/sh -c "cinder-manage db sync" cinder
fi
crudini --set $cfg \
DEFAULT \
log_file \
"${CINDER_SCHEDULER_LOG_FILE}"
echo "Starting cinder-scheduler"
exec /usr/bin/cinder-scheduler --config-file $cfg

View File

@ -8,7 +8,7 @@ ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
# Execute config strategy
set_configs
exec $CMD $ARGS

View File

@ -1,98 +0,0 @@
#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
. /opt/kolla/config-cinder.sh
. /opt/kolla/volume-group-create.sh
check_required_vars CINDER_ENABLED_BACKEND \
CINDER_LVM_LO_VOLUME_SIZE \
CINDER_VOLUME_API_LISTEN \
CINDER_VOLUME_BACKEND_NAME \
CINDER_VOLUME_DRIVER \
CINDER_VOLUME_GROUP \
ISCSI_HELPER \
ISCSI_IP_ADDRESS
cfg=/etc/cinder/cinder.conf
# Logging
crudini --set $cfg \
DEFAULT \
log_file \
"${CINDER_VOLUME_LOG_FILE}"
# IP address on which OpenStack Volume API listens
crudini --set $cfg \
DEFAULT \
osapi_volume_listen \
"${CINDER_VOLUME_API_LISTEN}"
# The IP address that the iSCSI daemon is listening on
crudini --set $cfg \
DEFAULT \
iscsi_ip_address \
"${ISCSI_IP_ADDRESS}"
# Set to false when using loopback devices (testing)
crudini --set $cfg \
DEFAULT \
secure_delete \
"false"
crudini --set $cfg \
DEFAULT \
enabled_backends \
"${CINDER_ENABLED_BACKEND}"
crudini --set $cfg \
lvm57 \
iscsi_helper \
"${ISCSI_HELPER}"
crudini --set $cfg \
lvm57 \
volume_group \
"${CINDER_VOLUME_GROUP}"
crudini --set $cfg \
lvm57 \
volume_driver \
"${CINDER_VOLUME_DRIVER}"
crudini --set $cfg \
lvm57 \
iscsi_ip_address \
"${ISCSI_IP_ADDRESS}"
crudini --set $cfg \
lvm57 \
volume_backend_name \
"${CINDER_VOLUME_BACKEND_NAME}"
sed -i 's/udev_sync = 1/udev_sync = 0/' /etc/lvm/lvm.conf
sed -i 's/udev_rules = 1/udev_rules = 0/' /etc/lvm/lvm.conf
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
# 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
# on the host, then libvirt will fail to boot an instance.
# This is a bug in Docker where it is not correctly mounting /dev/pts
# Tech Debt tracker: https://bugs.launchpad.net/kolla/+bug/1468962
# **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

View File

@ -8,7 +8,7 @@ ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
# Execute config strategy
set_configs
exec $CMD $ARGS

View File

@ -1,17 +0,0 @@
#!/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

View File

@ -1,22 +0,0 @@
#!/bin/bash
# The script will create the cinder-volume volume group that will
# allow cinder to create volumes from a backing file.
# This is based off devstack.
set -e
backing_file=/opt/data/cinder_volume
check_required_vars CINDER_LVM_LO_VOLUME_SIZE CINDER_VOLUME_GROUP
if ! vgs ${CINDER_VOLUME_GROUP}; then
[[ ! -f $backing_file ]] && truncate -s ${CINDER_LVM_LO_VOLUME_SIZE} $backing_file
vg_dev=`losetup -f --show $backing_file`
if ! vgs ${CINDER_VOLUME_GROUP}; then
vgcreate ${CINDER_VOLUME_GROUP} $vg_dev
fi
fi
# Remove iscsi targets
cinder-rtstool get-targets | xargs -rn 1 cinder-rtstool delete