From dd2e2ad8e22d09ce24eadf92d8c66cdde85407a5 Mon Sep 17 00:00:00 2001 From: Swapnil Kulkarni Date: Thu, 23 Jul 2015 07:54:46 +0000 Subject: [PATCH] Make variables in OVS container configurable Change-Id: I8d216ca20c97428e3b27d48d0a5249282dcb8c18 Closes-Bug: #1468509 --- .../openvswitch/ovs-db-server/config-internal.sh | 15 +++++++-------- .../openvswitch/ovs-vswitchd/config-internal.sh | 11 ++++------- docs/integration-guide.md | 4 ++++ docs/minimal-environment-vars.md | 5 +++-- tools/genenv | 6 ++++++ 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/docker/common/openvswitch/ovs-db-server/config-internal.sh b/docker/common/openvswitch/ovs-db-server/config-internal.sh index a2b4d6c8fe..f233418a76 100755 --- a/docker/common/openvswitch/ovs-db-server/config-internal.sh +++ b/docker/common/openvswitch/ovs-db-server/config-internal.sh @@ -2,15 +2,14 @@ set -o errexit -LOG_FILE="/var/log/openvswitch/ovsdb-server.log" -DB_FILE="/etc/openvswitch/conf.db" -UNIXSOCK_DIR="/var/run/openvswitch" -UNIXSOCK="${UNIXSOCK_DIR}/db.sock" +check_required_vars OVS_DB_FILE \ + OVS_UNIXSOCK -mkdir -p "${UNIXSOCK_DIR}" -if [[ ! -e "${DB_FILE}" ]]; then - ovsdb-tool create "${DB_FILE}" +mkdir -p "$(dirname $OVS_UNIXSOCK)" + +if [[ ! -e "${OVS_DB_FILE}" ]]; then + ovsdb-tool create "${OVS_DB_FILE}" fi -exec ovsdb-server $DB_FILE -vconsole:emer -vsyslog:err -vfile:info --remote=punix:"${UNIXSOCK}" --log-file="${LOG_FILE}" +exec ovsdb-server $OVS_DB_FILE -vconsole:emer -vsyslog:err -vfile:info --remote=punix:"${OVS_UNIXSOCK}" --log-file="${OVS_LOG_FILE}" diff --git a/docker/common/openvswitch/ovs-vswitchd/config-internal.sh b/docker/common/openvswitch/ovs-vswitchd/config-internal.sh index 1a18ab9582..2e42f7029d 100755 --- a/docker/common/openvswitch/ovs-vswitchd/config-internal.sh +++ b/docker/common/openvswitch/ovs-vswitchd/config-internal.sh @@ -2,14 +2,11 @@ set -o errexit +check_required_vars OVS_UNIXSOCK + modprobe openvswitch -LOG_FILE="/var/log/openvswitch/ovs-vswitchd.log" -DB_FILE="/etc/openvswitch/conf.db" -UNIXSOCK_DIR="/var/run/openvswitch" -UNIXSOCK="${UNIXSOCK_DIR}/db.sock" +mkdir -p "$(dirname $OVS_UNIXSOCK)" -mkdir -p "${UNIXSOCK_DIR}" - -exec ovs-vswitchd unix:"${UNIXSOCK}" -vconsole:emer -vsyslog:err -vfile:info --mlockall --log-file="${LOG_FILE}" +exec ovs-vswitchd unix:"${OVS_UNIXSOCK}" -vconsole:emer -vsyslog:err -vfile:info --mlockall --log-file="${OVS_LOG_FILE}" diff --git a/docs/integration-guide.md b/docs/integration-guide.md index e131e85628..ecfe65a43c 100755 --- a/docs/integration-guide.md +++ b/docs/integration-guide.md @@ -191,6 +191,10 @@ all containers. This allows a simple method of ensuring every type of node CEILOMETER_DB_PASSWORD= - Ceilometer DB password CEILOMETER_DB_USER= - Ceilometer DB User CEILOMETER_KEYSTONE_USER= - Ceilometer Keystone user + OVS_DB_FILE= - OVS DB file path + OVS_LOG_FILE= - OVS Log file path + OVS_UNIXSOCK= - OVS UNIX SOCK file location + [Minimum environment variable setup guide.](https://github.com/stackforge/kolla/blob/master/docs/minimal-environment-vars.md) diff --git a/docs/minimal-environment-vars.md b/docs/minimal-environment-vars.md index 752505b5ec..ab5d3d4857 100644 --- a/docs/minimal-environment-vars.md +++ b/docs/minimal-environment-vars.md @@ -499,11 +499,12 @@ In order for each service to function, there is a minimum set of required variab # Ovs-db-server - None + OVS_DB_FILE + OVS_UNIXSOCK # Ovs-vswitchd - None + OVS_UNIXSOCK # Rabbitmq diff --git a/tools/genenv b/tools/genenv index 40d60a2f8d..e78f64ab3d 100755 --- a/tools/genenv +++ b/tools/genenv @@ -88,6 +88,9 @@ CINDER_API_LOG_FILE= CINDER_VOLUME_LOG_FILE= CINDER_BACKUP_LOG_FILE= CINDER_SCHEDULER_LOG_FILE= +OVS_DB_FILE="/etc/openvswitch/conf.db" +OVS_LOG_FILE= +OVS_UNIXSOCK="/var/run/openvswitch/db.sock" # RabbitMQ RABBITMQ_SERVICE_HOST=$HOST_IP @@ -438,6 +441,9 @@ CEILOMETER_DB_NAME=$CEILOMETER_DB_NAME CEILOMETER_DB_PASSWORD=$CEILOMETER_DB_PASSWORD CEILOMETER_DB_USER=$CEILOMETER_DB_USER CEILOMETER_KEYSTONE_USER=$CEILOMETER_KEYSTONE_USER +OVS_DB_FILE=$OVS_DB_FILE +OVS_LOG_FILE=$OVS_LOG_FILE +OVS_UNIXSOCK=$OVS_UNIXSOCK EOF echo Please customize your FLAT_INTERFACE to a different network then your