Add config-internal/config-external to Nova-controller containers

Partially Implements: Blueprint standard-start

Change-Id: I40a863161bee779a944e9388a1ad7d5d0e7adba7
This commit is contained in:
Harm Weites 2015-07-02 14:24:33 +02:00
parent 3a4500c122
commit 9970519b4e
30 changed files with 237 additions and 93 deletions

View File

@ -7,4 +7,6 @@ RUN yum -y install \
ADD ./start.sh /start.sh
ADD ./check.sh /check.sh
COPY config-internal.sh config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../../common/nova-controller/nova-api/config-external.sh

View File

@ -0,0 +1 @@
../../../../common/nova-controller/nova-api/config-internal.sh

View File

@ -5,4 +5,7 @@ RUN yum -y install \
openstack-nova-conductor && yum clean all
ADD ./start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../../common/nova-controller/nova-conductor/config-external.sh

View File

@ -0,0 +1 @@
../../../../common/nova-controller/nova-conductor/config-internal.sh

View File

@ -5,4 +5,6 @@ RUN yum -y install openstack-nova-console && yum clean all
ADD start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../../common/nova-controller/nova-consoleauth/config-external.sh

View File

@ -0,0 +1 @@
../../../../common/nova-controller/nova-consoleauth/config-internal.sh

View File

@ -7,4 +7,6 @@ RUN yum -y install \
ADD start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../../common/nova-controller/nova-novncproxy/config-external.sh

View File

@ -0,0 +1 @@
../../../../common/nova-controller/nova-novncproxy/config-internal.sh

View File

@ -5,4 +5,7 @@ RUN yum -y install \
openstack-nova-scheduler && yum clean all
ADD ./start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../../common/nova-controller/nova-scheduler/config-external.sh

View File

@ -0,0 +1 @@
../../../../common/nova-controller/nova-scheduler/config-internal.sh

View File

@ -0,0 +1,10 @@
#!/bin/bash
SOURCE="/opt/kolla/nova-api/nova.conf"
TARGET="/etc/nova/nova.conf"
OWNER="nova"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0644 $TARGET
fi

View File

@ -0,0 +1,46 @@
#!/bin/bash
set -e
. /opt/kolla/config-nova.sh
check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
NOVA_KEYSTONE_USER NOVA_KEYSTONE_PASSWORD \
ADMIN_TENANT_NAME NOVA_API_SERVICE_HOST \
NOVA_EC2_API_SERVICE_HOST PUBLIC_IP NOVA_DB_NAME
fail_unless_os_service_running keystone
fail_unless_db $NOVA_DB_NAME
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="http://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
cfg=/etc/nova/nova.conf
# configure logging
crudini --set $cfg DEFAULT log_file "${NOVA_API_LOG_FILE}"
crux user-create --update \
-n "${NOVA_KEYSTONE_USER}" \
-p "${NOVA_KEYSTONE_PASSWORD}" \
-t "${ADMIN_TENANT_NAME}" \
-r admin
crux endpoint-create --remove-all \
-n ec2 -t ec2 \
-I "http://${NOVA_EC2_API_SERVICE_HOST}:8773/services/Cloud" \
-P "http://${PUBLIC_IP}:8773/services/Cloud" \
-A "http://${NOVA_EC2_API_SERVICE_HOST}:8773/services/Admin"
crux endpoint-create --remove-all \
-n nova -t compute \
-I "http://${NOVA_API_SERVICE_HOST}:8774/v2/\$(tenant_id)s" \
-P "http://${PUBLIC_IP}:8774/v2/\$(tenant_id)s" \
-A "http://${NOVA_API_SERVICE_HOST}:8774/v2/\$(tenant_id)s"
crux endpoint-create --remove-all \
-n novav3 -t computev3 \
-I "http://${NOVA_API_SERVICE_HOST}:8774/v3" \
-P "http://${PUBLIC_IP}:8774/v3" \
-A "http://${NOVA_API_SERVICE_HOST}:8774/v3"
exec /usr/bin/nova-api --config-file /etc/nova/nova.conf

View File

@ -1,46 +1,13 @@
#!/bin/bash
set -o errexit
set -e
CMD="/usr/bin/nova-api"
ARGS=""
. /opt/kolla/config-nova.sh
# Loading common functions.
source /opt/kolla/kolla-common.sh
check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
NOVA_KEYSTONE_USER NOVA_KEYSTONE_PASSWORD \
ADMIN_TENANT_NAME NOVA_API_SERVICE_HOST \
NOVA_EC2_API_SERVICE_HOST PUBLIC_IP NOVA_DB_NAME
fail_unless_os_service_running keystone
fail_unless_db $NOVA_DB_NAME
# Config-internal script exec out of this function, it does not return here.
set_configs
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="http://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
cfg=/etc/nova/nova.conf
# configure logging
crudini --set $cfg DEFAULT log_file "${NOVA_API_LOG_FILE}"
crux user-create --update \
-n "${NOVA_KEYSTONE_USER}" \
-p "${NOVA_KEYSTONE_PASSWORD}" \
-t "${ADMIN_TENANT_NAME}" \
-r admin
crux endpoint-create --remove-all \
-n ec2 -t ec2 \
-I "http://${NOVA_EC2_API_SERVICE_HOST}:8773/services/Cloud" \
-P "http://${PUBLIC_IP}:8773/services/Cloud" \
-A "http://${NOVA_EC2_API_SERVICE_HOST}:8773/services/Admin"
crux endpoint-create --remove-all \
-n nova -t compute \
-I "http://${NOVA_API_SERVICE_HOST}:8774/v2/\$(tenant_id)s" \
-P "http://${PUBLIC_IP}:8774/v2/\$(tenant_id)s" \
-A "http://${NOVA_API_SERVICE_HOST}:8774/v2/\$(tenant_id)s"
crux endpoint-create --remove-all \
-n novav3 -t computev3 \
-I "http://${NOVA_API_SERVICE_HOST}:8774/v3" \
-P "http://${PUBLIC_IP}:8774/v3" \
-A "http://${NOVA_API_SERVICE_HOST}:8774/v3"
exec /usr/bin/nova-api --config-file /etc/nova/nova.conf
exec $CMD $ARGS

View File

@ -0,0 +1,10 @@
#!/bin/bash
SOURCE="/opt/kolla/nova-conductor/nova.conf"
TARGET="/etc/nova/nova.conf"
OWNER="nova"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0644 $TARGET
fi

View File

@ -0,0 +1,26 @@
#!/bin/bash
set -e
. /opt/kolla/config-nova.sh
check_required_vars NOVA_DB_NAME NOVA_DB_USER NOVA_DB_PASSWORD \
INIT_NOVA_DB
fail_unless_db
cfg=/etc/nova/nova.conf
# configure logging
crudini --set $cfg DEFAULT log_file "${NOVA_CONDUCTOR_LOG_FILE}"
if [ "${INIT_NOVA_DB}" == "true" ]; then
mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${NOVA_DB_NAME};
GRANT ALL PRIVILEGES ON ${NOVA_DB_NAME}.* TO
'${NOVA_DB_USER}'@'%' IDENTIFIED BY '${NOVA_DB_PASSWORD}'
EOF
nova-manage db sync
fi
exec /usr/bin/nova-conductor --config-file /etc/nova/nova.conf

View File

@ -1,26 +1,20 @@
#!/bin/bash
set -o errexit
set -e
CMD="/usr/bin/nova-conductor"
ARGS=""
. /opt/kolla/config-nova.sh
# Loading common functions.
source /opt/kolla/kolla-common.sh
check_required_vars NOVA_DB_NAME NOVA_DB_USER NOVA_DB_PASSWORD \
INIT_NOVA_DB
fail_unless_db
# Config-internal script exec out of this function, it does not return here.
set_configs
cfg=/etc/nova/nova.conf
# configure logging
crudini --set $cfg DEFAULT log_file "${NOVA_CONDUCTOR_LOG_FILE}"
if [ "${INIT_NOVA_DB}" == "true" ]; then
mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${NOVA_DB_NAME};
GRANT ALL PRIVILEGES ON ${NOVA_DB_NAME}.* TO
'${NOVA_DB_USER}'@'%' IDENTIFIED BY '${NOVA_DB_PASSWORD}'
EOF
nova-manage db sync
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "nova-manage db sync" nova
exit 0
fi
exec /usr/bin/nova-conductor --config-file /etc/nova/nova.conf
exec $CMD $ARGS

View File

@ -0,0 +1,10 @@
#!/bin/bash
SOURCE="/opt/kolla/nova-consoleauth/nova.conf"
TARGET="/etc/nova/nova.conf"
OWNER="nova"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0644 $TARGET
fi

View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
. /opt/kolla/config-nova.sh
cfg=/etc/nova/nova.conf
crudini --set $cfg DEFAULT log_file "${NOVA_CONSOLEAUTH_LOG_FILE}"
echo Starting nova-consoleauth
exec /usr/bin/nova-consoleauth

View File

@ -1,11 +1,13 @@
#!/bin/bash
set -e
set -o errexit
. /opt/kolla/config-nova.sh
CMD="/usr/bin/nova-consoleauth"
ARGS=""
cfg=/etc/nova/nova.conf
# Loading common functions.
source /opt/kolla/kolla-common.sh
crudini --set $cfg DEFAULT log_file "${NOVA_CONSOLEAUTH_LOG_FILE}"
# Config-internal script exec out of this function, it does not return here.
set_configs
echo Starting nova-consoleauth
exec /usr/bin/nova-consoleauth
exec $CMD $ARGS

View File

@ -0,0 +1,10 @@
#!/bin/bash
SOURCE="/opt/kolla/nova-novncproxy/nova.conf"
TARGET="/etc/nova/nova.conf"
OWNER="nova"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0644 $TARGET
fi

View File

@ -0,0 +1,22 @@
#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
cfg=/etc/nova/nova.conf
check_required_vars PUBLIC_IP NOVA_NOVNC_PROXY_SERVICE_HOST NOVA_NOVNC_PROXY_PORT \
NOVA_NOVNC_BASE_ADDRESS NOVA_VNCSERVER_LISTEN_ADDRESS \
NOVA_VNCSERVER_PROXYCLIENT_ADDRESS
crudini --set $cfg DEFAULT log_file "${NOVA_NOVNCPROXY_LOG_FILE}"
# Listen on all interfaces on port $NOVA_NOVNC_PROXY_PORT for incoming novnc
# requests.
# The base_url is given to clients to connect to, like Horizon, so this could
# very well be fancy DNS name.
echo Configuring VNC...
crudini --set $cfg DEFAULT vncserver_listen "${NOVA_VNCSERVER_LISTEN_ADDRESS}"
crudini --set $cfg DEFAULT vncserver_proxyclient_address "${NOVA_VNCSERVER_PROXYCLIENT_ADDRESS}"
echo Starting nova-novncproxy
exec /usr/bin/nova-novncproxy

View File

@ -1,22 +1,13 @@
#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
set -o errexit
cfg=/etc/nova/nova.conf
CMD="/usr/bin/nova-novncproxy"
ARGS=""
check_required_vars PUBLIC_IP NOVA_NOVNC_PROXY_SERVICE_HOST NOVA_NOVNC_PROXY_PORT \
NOVA_NOVNC_BASE_ADDRESS NOVA_VNCSERVER_LISTEN_ADDRESS \
NOVA_VNCSERVER_PROXYCLIENT_ADDRESS
# Loading common functions.
source /opt/kolla/kolla-common.sh
crudini --set $cfg DEFAULT log_file "${NOVA_NOVNCPROXY_LOG_FILE}"
# Config-internal script exec out of this function, it does not return here.
set_configs
# Listen on all interfaces on port $NOVA_NOVNC_PROXY_PORT for incoming novnc
# requests.
# The base_url is given to clients to connect to, like Horizon, so this could
# very well be fancy DNS name.
echo Configuring VNC...
crudini --set $cfg DEFAULT vncserver_listen "${NOVA_VNCSERVER_LISTEN_ADDRESS}"
crudini --set $cfg DEFAULT vncserver_proxyclient_address "${NOVA_VNCSERVER_PROXYCLIENT_ADDRESS}"
echo Starting nova-novncproxy
exec /usr/bin/nova-novncproxy
exec $CMD $ARGS

View File

@ -0,0 +1,10 @@
#!/bin/bash
SOURCE="/opt/kolla/nova-scheduler/nova.conf"
TARGET="/etc/nova/nova.conf"
OWNER="nova"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0644 $TARGET
fi

View File

@ -0,0 +1,15 @@
#!/bin/bash
set -e
. /opt/kolla/config-nova.sh
check_required_vars NOVA_DB_NAME
fail_unless_db $NOVA_DB_NAME
cfg=/etc/nova/nova.conf
# configure logging
crudini --set $cfg DEFAULT log_file "${NOVA_SCHEDULER_LOG_FILE}"
exec /usr/bin/nova-scheduler --config-file /etc/nova/nova.conf

View File

@ -1,15 +1,13 @@
#!/bin/bash
set -o errexit
set -e
CMD="/usr/bin/nova-scheduler"
ARGS=""
. /opt/kolla/config-nova.sh
# Loading common functions.
source /opt/kolla/kolla-common.sh
check_required_vars NOVA_DB_NAME
fail_unless_db $NOVA_DB_NAME
# Config-internal script exec out of this function, it does not return here.
set_configs
cfg=/etc/nova/nova.conf
# configure logging
crudini --set $cfg DEFAULT log_file "${NOVA_SCHEDULER_LOG_FILE}"
exec /usr/bin/nova-scheduler --config-file /etc/nova/nova.conf
exec $CMD $ARGS