Skip to content
Snippets Groups Projects
Commit 0971e7ee authored by Fang Fenghua's avatar Fang Fenghua Committed by Sam Yaple
Browse files

Add openvswitch container


Add openvswitch containers. Openvswitch is seperated into two running
containers:
  ovs-db-server
  ovs-vswitchd

The db container is what everything interacts with. Neutron tells the db
its information, the vswitchd container reads this db and talks to the
kernel module.

The db does not need to be persistent since the plugin agent will
repopulate all the information each time it is restarted and the plugin
agent is required to be restarted when the ovs-vswitchd container is
stopped/started to ensure the ports are setup properly.

This container requires /run for the socket and /lib/modules:ro to load
the appropriate host kernel module.

This userspace tools and the kernel module do _not_ have to match
versions. Additionally, even though it is recommended that the userspace
tool be newer than the kernel version to take advantage of all the
features, it is not required.

Partially Implements blueprint: openvswitch-container

Co-Authored-By: default avatarSam Yaple <sam@yaple.net>

Change-Id: I70e3807be32c9a07346d316e7856421ecf468b9a
parent b87f16fa
No related branches found
No related tags found
No related merge requests found
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
RUN yum install -y openvswitch \
&& yum clean all
../../../../../../../tools/build-docker-image
\ No newline at end of file
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%ovs-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY ./start.sh /start.sh
CMD ["/start.sh"]
../../../../../tools/build-docker-image
\ No newline at end of file
../../../../common/openvswitch/ovs-db-server/start.sh
\ No newline at end of file
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%ovs-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY ./start.sh /start.sh
CMD ["/start.sh"]
../../../../../tools/build-docker-image
\ No newline at end of file
../../../../common/openvswitch/ovs-vswitchd/start.sh
\ No newline at end of file
#!/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}"
#!/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}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment