Skip to content

Commit

Permalink
ovn: Add ovn-controller-vtep debian package
Browse files Browse the repository at this point in the history
Having a separate debian package for deploying
the ovn-controller-vtep binary enables the ability
to assign specific nodes the role of communicating
with VTEP enabled TORs.

Change-Id: Ia36aea7d89bd011a57918820b2a9f6e3469b3e04
Signed-off-by: Ryan Moats <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
jayhawk87 authored and blp committed Jul 28, 2016
1 parent 1a58344 commit f4a4ce5
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 10 deletions.
5 changes: 4 additions & 1 deletion debian/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ EXTRA_DIST += \
debian/ovn-central.postinst \
debian/ovn-central.postrm \
debian/ovn-central.template \
debian/ovn-controller-vtep.init \
debian/ovn-controller-vtep.install \
debian/ovn-controller-vtep.manpages \
debian/ovn-common.install \
debian/ovn-common.manpages \
debian/ovn-docker.install \
debian/ovn-docker.install \
debian/ovn-host.dirs \
debian/ovn-host.init \
debian/ovn-host.install \
Expand Down
15 changes: 15 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@ Description: OVN common components
.
ovn-common provides components required by other OVN packages.

Package: ovn-controller-vtep
Architecture: linux-any
Depends: ovn-common (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
Description: OVN vtep controller
ovn-controller-vtep is the local controller daemon in
OVN, the Open Virtual Network, for VTEP enabled physical switches.
It connects up to the OVN Southbound database over the OVSDB protocol,
and down to the VTEP database over the OVSDB protocol.
.
ovn-controller-vtep provides the ovn-controller-vtep binary for controlling
vtep gateways.


Package: ovn-host
Architecture: linux-any
Depends: openvswitch-switch (= ${binary:Version}),
Expand Down
53 changes: 53 additions & 0 deletions debian/ovn-controller-vtep.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#! /bin/sh
#
### BEGIN INIT INFO
# Provides: ovn-controller-vtep
# Required-Start: openvswitch-switch $remote_fs $syslog
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: OVN Controller for VTEP enabled devices
# Description: ovn-controller-vtep provides the userspace
# components and utilities for OVN that can be run on
# hosts taht connect to VTEP enabled devices.
### END INIT INFO

test -x /usr/bin/ovn-controller-vtep || exit 0
test -x /usr/share/openvswitch/scripts/ovn-ctl || exit 0

_SYSTEMCTL_SKIP_REDIRECT=yes

. /usr/share/openvswitch/scripts/ovs-lib
if [ -e /etc/default/ovn-controller-vtep ]; then
. /etc/default/ovn-controller-vtep
fi

start () {
set /usr/share/openvswitch/scripts/ovn-ctl ${1-start_controller_vtep}
set "$@" $OVN_CTL_OPTS
"$@" || exit $?
}

case $1 in
start)
start
;;
stop | force-stop)
/usr/share/openvswitch/scripts/ovn-ctl stop_controller_vtep
;;
restart)
start restart_controller_vtep
;;
status)
/usr/share/openvswitch/scripts/ovn-ctl status_controller_vtep
exit $?
;;
reload | force-reload)
;;
*)
echo "Usage: $0 {start|stop|reload|force-reload|restart|status}" >&2
exit 1
;;
esac

exit 0
1 change: 1 addition & 0 deletions debian/ovn-controller-vtep.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/bin/ovn-controller-vtep
1 change: 1 addition & 0 deletions debian/ovn-controller-vtep.manpages
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ovn/controller-vtep/ovn-controller-vtep.8
51 changes: 42 additions & 9 deletions ovn/utilities/ovn-ctl
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ start_controller () {
OVS_RUNDIR=${OVN_RUNDIR} start_daemon "$OVN_CONTROLLER_PRIORITY" "$OVN_CONTROLLER_WRAPPER" "$@"
}

start_controller_vtep () {
set ovn-controller-vtep "unix:$DB_SOCK"
set "$@" -vconsole:emer -vsyslog:err -vfile:info
OVS_RUNDIR=${OVN_RUNDIR} start_daemon "$OVN_CONTROLLER_PRIORITY" "$OVN_CONTROLLER_WRAPPER" "$@"
}

## ---- ##
## stop ##
## ---- ##
Expand All @@ -130,6 +136,10 @@ stop_controller () {
OVS_RUNDIR=${OVN_RUNDIR} stop_daemon ovn-controller
}

stop_controller_vtep () {
OVS_RUNDIR=${OVN_RUNDIR} stop_daemon ovn-controller-vtep
}

## ------- ##
## restart ##
## ------- ##
Expand All @@ -144,6 +154,11 @@ restart_controller () {
start_controller
}

restart_controller_vtep () {
stop_controller_vtep
start_controller_vtep
}

restart_ovsdb () {
stop_ovsdb
start_ovsdb
Expand Down Expand Up @@ -214,15 +229,18 @@ This program is intended to be invoked internally by Open Virtual Network
startup scripts. System administrators should not normally invoke it directly.
Commands:
start_northd start ovn-northd
start_ovsdb start ovn related ovsdb-server processes
start_controller start ovn-controller
stop_northd stop ovn-northd
stop_ovsdb stop ovn related ovsdb-server processes
stop_controller stop ovn-controller
restart_northd restart ovn-northd
restart_ovsdb restart ovn related ovsdb-server processes
restart_controller restart ovn-controller
start_northd start ovn-northd
start_ovsdb start ovn related ovsdb-server processes
start_controller start ovn-controller
start_controller_vtep start ovn-controller-vtep
stop_northd stop ovn-northd
stop_ovsdb stop ovn related ovsdb-server processes
stop_controller stop ovn-controller
stop_controller_vtep stop ovn-controller-vtep
restart_northd restart ovn-northd
restart_ovsdb restart ovn related ovsdb-server processes
restart_controller restart ovn-controller
restart_controller_vtep restart ovn-controller-vtep
Options:
--ovn-northd-priority=NICE set ovn-northd's niceness (default: $OVN_NORTHD_PRIORITY)
Expand Down Expand Up @@ -317,6 +335,9 @@ case $command in
start_controller)
start_controller
;;
start_controller_vtep)
start_controller_vtep
;;
stop_northd)
stop_northd
;;
Expand All @@ -326,6 +347,12 @@ case $command in
stop_controller)
stop_controller
;;
stop_controller)
stop_controller
;;
stop_controller_vtep)
stop_controller_vtep
;;
restart_northd)
restart_northd
;;
Expand All @@ -335,6 +362,9 @@ case $command in
restart_controller)
restart_controller
;;
restart_controller_vtep)
restart_controller_vtep
;;
status_northd)
daemon_status ovn-northd || exit 1
;;
Expand All @@ -344,6 +374,9 @@ case $command in
status_controller)
daemon_status ovn-controller || exit 1
;;
status_controller_vtep)
daemon_status ovn-controller-vtep || exit 1
;;
help)
usage
;;
Expand Down
3 changes: 3 additions & 0 deletions ovn/utilities/ovn-ctl.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
<dl>
<dt><code>start_northd</code></dt>
<dt><code>start_controller</code></dt>
<dt><code>start_controller_vtep</code></dt>
<dt><code>stop_northd</code></dt>
<dt><code>stop_controller</code></dt>
<dt><code>stop_controller_vtep</code></dt>
<dt><code>restart_northd</code></dt>
<dt><code>restart_controller</code></dt>
<dt><code>restart_controller_vtep</code></dt>
</dl>

<h1>Options</h1>
Expand Down

0 comments on commit f4a4ce5

Please sign in to comment.