Add config-internal/config-external to OpenvSwitch containers

Partially Implements: Blueprint standard-start

Co-Authored-By: Swapnil Kulkarni <me@coolsvap.net>
Change-Id: I52ed4b56efe3fc4ebbc108b2fe7e9d69eb0f0928
This commit is contained in:
digambar 2015-07-03 12:09:46 +05:30 committed by Swapnil Kulkarni
parent fcda6a06d8
commit d2d3e74e19
15 changed files with 70 additions and 8 deletions

View File

@ -3,3 +3,5 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
RUN yum install -y openvswitch \
&& yum clean all
COPY config-internal.sh config-external.sh /opt/kolla/

View File

@ -0,0 +1 @@
../../../../common/openvswitch/ovs-base/config-external.sh

View File

@ -0,0 +1 @@
../../../../common/openvswitch/ovs-base/config-external.sh

View File

@ -3,5 +3,6 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY ./start.sh /start.sh
CMD ["/start.sh"]
COPY config-internal.sh config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../../common/openvswitch/ovs-db-server/config-external.sh

View File

@ -0,0 +1 @@
../../../../common/openvswitch/ovs-db-server/config-internal.sh

View File

@ -3,4 +3,6 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY ./start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../../common/openvswitch/ovs-vswitchd/config-external.sh

View File

@ -0,0 +1 @@
../../../../common/openvswitch/ovs-vswitchd/config-internal.sh

View File

@ -0,0 +1,3 @@
#!/bin/bash
#This file should be a noop. It just needs to exist, but it don't perform any function

View File

@ -0,0 +1,16 @@
#!/bin/bash
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"
mkdir -p "${UNIXSOCK_DIR}"
if [[ ! -e "${DB_FILE}" ]]; then
ovsdb-tool create "${DB_FILE}"
fi
exec ovsdb-server $DB_FILE -vconsole:emer -vsyslog:err -vfile:info --remote=punix:"${UNIXSOCK}" --log-file="${LOG_FILE}"

View File

@ -7,10 +7,19 @@ DB_FILE="/etc/openvswitch/conf.db"
UNIXSOCK_DIR="/var/run/openvswitch"
UNIXSOCK="${UNIXSOCK_DIR}/db.sock"
CMD="/usr/sbin/ovsdb-server"
ARGS="$DB_FILE -vconsole:emer -vsyslog:err -vfile:info --remote=punix:${UNIXSOCK} --log-file=${LOG_FILE}"
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
set_configs
mkdir -p "${UNIXSOCK_DIR}"
if [[ ! -e "${DB_FILE}" ]]; then
ovsdb-tool create "${DB_FILE}"
fi
exec ovsdb-server $DB_FILE -vconsole:emer -vsyslog:err -vfile:info --remote=punix:"${UNIXSOCK}" --log-file="${LOG_FILE}"
exec $CMD $ARGS

View File

@ -0,0 +1,3 @@
#!/bin/bash
#This file should be a noop. It just needs to exist, but it don't perform any function

View File

@ -0,0 +1,15 @@
#!/bin/bash
set -o errexit
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 "${UNIXSOCK_DIR}"
exec ovs-vswitchd unix:"${UNIXSOCK}" -vconsole:emer -vsyslog:err -vfile:info --mlockall --log-file="${LOG_FILE}"

View File

@ -1,14 +1,19 @@
#!/bin/bash
set -o errexit
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"
CMD="/usr/sbin/ovs-vswitchd"
ARGS="unix:${UNIXSOCK} -vconsole:emer -vsyslog:err -vfile:info --mlockall --log-file=${LOG_FILE}"
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
set_configs
modprobe openvswitch
mkdir -p "${UNIXSOCK_DIR}"
exec ovs-vswitchd unix:"${UNIXSOCK}" -vconsole:emer -vsyslog:err -vfile:info --mlockall --log-file="${LOG_FILE}"
exec $CMD $ARGS