This patch creates a new subpackage for OVN, openvswitch-ovn.  It also
installs systemd unit files for ovncontroller and ovnnorthd services.
Finally, it installs some template service configuration files into
/etc/sysconfig/.

If you want to run ovn-controller on a host running ovs:

    # systemctl start ovncontroller

If you want to run ovn-northd and ovsdb-server on a management host:

    # systemctl start ovnnorthd

If you want to run all of ovs and ovn on the same host:

    # cat << EOF > /etc/sysconfig/openvswitch
    OPTIONS="'--extra-dbs=ovnnb.db ovnsb.db'"
    EOF

    # cat << EOF > /etc/sysconfig/ovnnorthd
    OPTIONS="--no-ovsdb-server"
    EOF

    # ovn-ctl create_ovn_dbs
    # systemctl start openvswitch
    # systemctl start ovnnorthd
    # systemctl start ovncontroller

Signed-off-by: Russell Bryant <rbry...@redhat.com>
---
 rhel/automake.mk                                   |  8 +++-
 rhel/openvswitch-fedora.spec.in                    | 51 +++++++++++++++++++---
 ..._systemd_system_ovncontroller-nonetwork.service | 14 ++++++
 rhel/usr_lib_systemd_system_ovncontroller.service  | 13 ++++++
 ..._lib_systemd_system_ovnnorthd-nonetwork.service | 14 ++++++
 rhel/usr_lib_systemd_system_ovnnorthd.service      | 13 ++++++
 ...cripts_systemd_ovncontroller_sysconfig.template | 14 ++++++
 ...ch_scripts_systemd_ovnnorthd_sysconfig.template | 32 ++++++++++++++
 8 files changed, 153 insertions(+), 6 deletions(-)
 create mode 100644 rhel/usr_lib_systemd_system_ovncontroller-nonetwork.service
 create mode 100644 rhel/usr_lib_systemd_system_ovncontroller.service
 create mode 100644 rhel/usr_lib_systemd_system_ovnnorthd-nonetwork.service
 create mode 100644 rhel/usr_lib_systemd_system_ovnnorthd.service
 create mode 100644 
rhel/usr_share_openvswitch_scripts_systemd_ovncontroller_sysconfig.template
 create mode 100644 
rhel/usr_share_openvswitch_scripts_systemd_ovnnorthd_sysconfig.template

diff --git a/rhel/automake.mk b/rhel/automake.mk
index 9c3433b..40566c4 100644
--- a/rhel/automake.mk
+++ b/rhel/automake.mk
@@ -23,8 +23,14 @@ EXTRA_DIST += \
        rhel/openvswitch-fedora.spec.in \
        rhel/usr_share_openvswitch_scripts_sysconfig.template \
        rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
+       
rhel/usr_share_openvswitch_scripts_systemd_ovncontroller_sysconfig.template \
+       rhel/usr_share_openvswitch_scripts_systemd_ovnnorthd_sysconfig.template 
\
        rhel/usr_lib_systemd_system_openvswitch.service \
-       rhel/usr_lib_systemd_system_openvswitch-nonetwork.service
+       rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \
+       rhel/usr_lib_systemd_system_ovncontroller.service \
+       rhel/usr_lib_systemd_system_ovncontroller-nonetwork.service \
+       rhel/usr_lib_systemd_system_ovnnorthd.service \
+       rhel/usr_lib_systemd_system_ovnnorthd-nonetwork.service
 
 update_rhel_spec = \
   $(AM_V_GEN)($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \
diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index f3dbebf..757ec8f 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -81,6 +81,19 @@ Provides: openvswitch-static = %{version}-%{release}
 This provides static library, libopenswitch.a and the openvswitch header
 files needed to build an external application.
 
+%package ovn
+Summary: Open vSwitch - Open Virtual Network support
+License: ASL 2.0
+Requires: openvswitch
+
+%description ovn
+OVN, the Open Virtual Network, is a system to support virtual network
+abstraction.  OVN complements the existing capabilities of OVS to add
+native support for virtual network abstractions, such as virtual L2 and L3
+overlays and security groups.  Services such as DHCP are also desirable
+features.  Just like OVS, OVN's design goal is to have a production-quality
+implementation that can operate at significant scale.
+
 
 %prep
 %setup -q
@@ -99,12 +112,19 @@ install -p -D -m 0644 \
         rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
         $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch
 install -p -D -m 0644 \
-        rhel/usr_lib_systemd_system_openvswitch.service \
-        $RPM_BUILD_ROOT%{_unitdir}/openvswitch.service
+        
rhel/usr_share_openvswitch_scripts_systemd_ovncontroller_sysconfig.template \
+        $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/ovncontroller
 install -p -D -m 0644 \
-        rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \
-        $RPM_BUILD_ROOT%{_unitdir}/openvswitch-nonetwork.service
-
+        
rhel/usr_share_openvswitch_scripts_systemd_ovnnorthd_sysconfig.template \
+        $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/ovnnorthd
+for service in openvswitch ovncontroller ovnnorthd; do
+       install -p -D -m 0644 \
+                       rhel/usr_lib_systemd_system_${service}.service \
+                       $RPM_BUILD_ROOT%{_unitdir}/${service}.service
+       install -p -D -m 0644 \
+                       
rhel/usr_lib_systemd_system_${service}-nonetwork.service \
+                       $RPM_BUILD_ROOT%{_unitdir}/${service}-nonetwork.service
+done
 install -m 0755 rhel/etc_init.d_openvswitch \
         $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
 
@@ -269,6 +289,27 @@ rm -rf $RPM_BUILD_ROOT
 %exclude %{_mandir}/man8/ovs-vlan-bug-workaround.8.gz
 %exclude %{_datadir}/openvswitch/scripts/ovs-save
 
+%files ovn
+%{_bindir}/ovn-controller
+%{_bindir}/ovn-nbctl
+%{_bindir}/ovn-northd
+%{_datadir}/openvswitch/scripts/ovn-ctl
+%{_mandir}/man8/ovs-testcontroller.8*
+%{_mandir}/man5/ovn-nb.5*
+%{_mandir}/man5/ovn-sb.5*
+%{_mandir}/man7/ovn-architecture.7*
+%{_mandir}/man8/ovn-controller.8*
+%{_mandir}/man8/ovn-ctl.8*
+%{_mandir}/man8/ovn-nbctl.8*
+%config %{_datadir}/openvswitch/ovn-nb.ovsschema
+%config %{_datadir}/openvswitch/ovn-sb.ovsschema
+%{_unitdir}/ovncontroller.service
+%{_unitdir}/ovncontroller-nonetwork.service
+%{_unitdir}/ovnnorthd.service
+%{_unitdir}/ovnnorthd-nonetwork.service
+%config(noreplace) %{_sysconfdir}/sysconfig/ovncontroller
+%config(noreplace) %{_sysconfdir}/sysconfig/ovnnorthd
+
 %changelog
 * Wed Jan 12 2011 Ralf Spenneberg <r...@os-s.net>
 - First build on F14
diff --git a/rhel/usr_lib_systemd_system_ovncontroller-nonetwork.service 
b/rhel/usr_lib_systemd_system_ovncontroller-nonetwork.service
new file mode 100644
index 0000000..f1f93ff
--- /dev/null
+++ b/rhel/usr_lib_systemd_system_ovncontroller-nonetwork.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=OVN Controller Internal Unit
+After=syslog.target
+PartOf=ovncontroller.service
+Wants=ovncontroller.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+EnvironmentFile=-/etc/sysconfig/ovncontroller
+ExecStart=/usr/share/openvswitch/scripts/ovn-ctl \
+          start_controller $OPTIONS
+ExecStop=/usr/share/openvswitch/scripts/ovn-ctl \
+          stop_controller $OPTIONS
diff --git a/rhel/usr_lib_systemd_system_ovncontroller.service 
b/rhel/usr_lib_systemd_system_ovncontroller.service
new file mode 100644
index 0000000..5884bca
--- /dev/null
+++ b/rhel/usr_lib_systemd_system_ovncontroller.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=OVN Controller
+After=syslog.target network.target ovncontroller-nonetwork.service
+Requires=ovncontroller-nonetwork.service
+
+[Service]
+Type=oneshot
+ExecStart=/bin/true
+ExecStop=/bin/true
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/rhel/usr_lib_systemd_system_ovnnorthd-nonetwork.service 
b/rhel/usr_lib_systemd_system_ovnnorthd-nonetwork.service
new file mode 100644
index 0000000..83f1f39
--- /dev/null
+++ b/rhel/usr_lib_systemd_system_ovnnorthd-nonetwork.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=OVN northd Internal Unit
+After=syslog.target
+PartOf=ovnnorthd.service
+Wants=ovnnorthd.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+EnvironmentFile=-/etc/sysconfig/ovnnorthd
+ExecStart=/usr/share/openvswitch/scripts/ovn-ctl \
+          start_northd $OPTIONS
+ExecStop=/usr/share/openvswitch/scripts/ovs-ctl \
+         stop_northd $OPTIONS
diff --git a/rhel/usr_lib_systemd_system_ovnnorthd.service 
b/rhel/usr_lib_systemd_system_ovnnorthd.service
new file mode 100644
index 0000000..4c7fcaa
--- /dev/null
+++ b/rhel/usr_lib_systemd_system_ovnnorthd.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=OVN northd
+After=syslog.target network.target ovnnorthd-nonetwork.service
+Requires=ovnnorthd-nonetwork.service
+
+[Service]
+Type=oneshot
+ExecStart=/bin/true
+ExecStop=/bin/true
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git 
a/rhel/usr_share_openvswitch_scripts_systemd_ovncontroller_sysconfig.template 
b/rhel/usr_share_openvswitch_scripts_systemd_ovncontroller_sysconfig.template
new file mode 100644
index 0000000..b216a51
--- /dev/null
+++ 
b/rhel/usr_share_openvswitch_scripts_systemd_ovncontroller_sysconfig.template
@@ -0,0 +1,14 @@
+### Configuration options for ovncontroller
+#
+# Set "nice" priority at which to run ovn-controller:
+# --ovn-controller-priority=-10
+#
+# Set "nice" priority at which to run ovn-controller:
+# --ovn-controller-priority=-10
+#
+# Use valgrind:
+#   --ovn-controller-wrapper=valgrind
+#
+# For a full list of possible options, refer to the output of "ovn-ctl help".
+#
+OPTIONS=""
diff --git 
a/rhel/usr_share_openvswitch_scripts_systemd_ovnnorthd_sysconfig.template 
b/rhel/usr_share_openvswitch_scripts_systemd_ovnnorthd_sysconfig.template
new file mode 100644
index 0000000..e052204
--- /dev/null
+++ b/rhel/usr_share_openvswitch_scripts_systemd_ovnnorthd_sysconfig.template
@@ -0,0 +1,32 @@
+### Configuration options for ovnnorthd
+#
+# Set "nice" priority at which to run ovn-northd or ovsdb-server:
+# --ovn-northd-priority=-10
+# --ovsdb-server-priority=-10
+#
+# Use valgrind:
+#   --ovn-northd-wrapper=valgrind
+#   --ovsdb-server-wrapper=valgrind
+#
+# Specify extra remotes for ovsdb-server:
+#   --ovsdb-server-remotes=ptcp:6640:127.0.0.1
+#
+# If this system is running both openvswitch and ovnnorthd, openvswitch will be
+# running ovsdb-server instead of ovnnorthd.  You should make sure to create 
the
+# dbs using:
+#
+#   # ovn-ctl create_ovn_dbs
+#
+# and update OPTIONS in this file to include:
+#
+#   --no-ovsdb-server
+#
+# Also be sure to update /etc/sysconfig/openvswitch to tell it to include the
+# OVN dbs when running ovsdb-server.  Also note the extra quotes.  They are
+# necessary to ensure the full string is passed as a single argument to 
ovn-ctl.
+#
+#   OPTIONS="'--extra-dbs=ovnnb.db ovnsb.db'"
+#
+# For a full list of possible options, refer to the output of "ovn-ctl help".
+#
+OPTIONS=""
-- 
2.1.0

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to