From bc39196036f8e33d15274855087f0c47be2095ee Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Thu, 25 Mar 2010 22:38:13 -0700 Subject: [PATCH] Cleanup default file locations and XenServer packaging This commit cleans up the locations of a number of files and directories used. These include: - Config file lives in /etc/openvswitch/conf.db - Logs go into /var/log/openvswitch - ovsdb-server socket is /var/run/openvswitch/db.sock - Schema goes into /usr/share/openvswitch/vswitch.ovsschema - PID files go in /var/run/openvswitch For XenServer, these additional changes are made: - Cores go in /var/xen/openvswitch - OVS binaries run in /var/xen/openvswitch In addition, it attempts to cleanup the XenServer packaging. This includes referring to the project as "openvswitch" as opposed to the somewhat presumptuous "vswitch". Note: Changes to the Debian packaging will be forthcoming. --- INSTALL.Linux | 4 +- INSTALL.SSL | 4 +- INSTALL.XenServer | 14 +- INSTALL.bridge | 2 +- debian/openvswitch-switch.init | 2 +- lib/dirs.h | 4 +- lib/unixctl.c | 2 +- m4/openvswitch.m4 | 5 +- utilities/ovs-vsctl.8.in | 2 +- utilities/ovs-vsctl.c | 2 +- xenserver/README | 63 +++--- xenserver/automake.mk | 16 +- ..._init.d_vswitch => etc_init.d_openvswitch} | 71 ++++--- ...ate => etc_init.d_openvswitch-xapi-update} | 0 ....d_vswitch => etc_logrotate.d_openvswitch} | 6 +- ...switch.sh => etc_profile.d_openvswitch.sh} | 5 +- ...etc_xapi.d_plugins_openvswitch-cfg-update} | 9 +- xenserver/etc_xensource_scripts_vif | 2 +- ...{vswitch-xen.spec => openvswitch-xen.spec} | 184 +++++++++--------- ...xsconsole_plugins-base_XSFeatureVSwitch.py | 20 +- xenserver/usr_sbin_brctl | 4 +- xenserver/usr_sbin_xen-bugtool | 45 +++-- ...openvswitch_scripts_refresh-network-uuids} | 0 ...re_openvswitch_scripts_sysconfig.template} | 30 +-- 24 files changed, 256 insertions(+), 240 deletions(-) rename xenserver/{etc_init.d_vswitch => etc_init.d_openvswitch} (85%) rename xenserver/{etc_init.d_vswitch-xapi-update => etc_init.d_openvswitch-xapi-update} (100%) rename xenserver/{etc_logrotate.d_vswitch => etc_logrotate.d_openvswitch} (72%) rename xenserver/{etc_profile.d_vswitch.sh => etc_profile.d_openvswitch.sh} (77%) rename xenserver/{etc_xapi.d_plugins_vswitch-cfg-update => etc_xapi.d_plugins_openvswitch-cfg-update} (93%) rename xenserver/{vswitch-xen.spec => openvswitch-xen.spec} (64%) rename xenserver/{usr_share_vswitch_scripts_refresh-network-uuids => usr_share_openvswitch_scripts_refresh-network-uuids} (100%) rename xenserver/{usr_share_vswitch_scripts_sysconfig.template => usr_share_openvswitch_scripts_sysconfig.template} (92%) diff --git a/INSTALL.Linux b/INSTALL.Linux index 263e26185..177a9cd13 100644 --- a/INSTALL.Linux +++ b/INSTALL.Linux @@ -167,7 +167,7 @@ configuration database, ovsdb-server. Configure it to use the database you created during step 7 of installation, above, and to listen on a Unix domain socket, e.g.: - % ovsdb-server /usr/local/etc/ovs-vswitchd.conf.db --remote=punix:/usr/local/var/run/ovsdb-server + % ovsdb-server /usr/local/etc/ovs-vswitchd.conf.db --remote=punix:/usr/local/var/run/openvswitch/db.sock Then initialize the database with "ovs-vsctl init". This is only necessary the first time after you create the database with @@ -178,7 +178,7 @@ ovsdb-tool (but running it at any time is harmless): Then start the main Open vSwitch daemon, telling it to connect to the same Unix domain socket: - % ovs-vswitchd unix:/usr/local/var/run/ovsdb-server + % ovs-vswitchd unix:/usr/local/var/run/openvswitch/db.sock Now you may use ovs-vsctl to set up bridges and other Open vSwitch features. For example, to create a bridge named br0 and add ports diff --git a/INSTALL.SSL b/INSTALL.SSL index 4ba092548..3b625fbd9 100644 --- a/INSTALL.SSL +++ b/INSTALL.SSL @@ -290,7 +290,7 @@ cacert.pem: Once you have these files, configure ovs-vswitchd to use them using the ovs-vsctl "set-ssl" command, e.g.: - ovs-vsctl set-ssl /etc/vswitch/sc-privkey.pem /etc/vswitch/sc-cert.pem /etc/vswitch/cacert.pem + ovs-vsctl set-ssl /etc/openvswitch/sc-privkey.pem /etc/openvswitch/sc-cert.pem /etc/openvswitch/cacert.pem Substitute the correct file names, of course, if they differ from the ones used above. You should use absolute file names (ones that begin @@ -301,7 +301,7 @@ If you are using self-signed certificates (see "SSL Concepts for OpenFlow") and you did not copy controllerca/cacert.pem from the PKI machine to the Open vSwitch, then add the --bootstrap option, e.g.: - ovs-vsctl -- --bootstrap set-ssl /etc/vswitch/sc-privkey.pem /etc/vswitch/sc-cert.pem /etc/vswitch/cacert.pem + ovs-vsctl -- --bootstrap set-ssl /etc/openvswitch/sc-privkey.pem /etc/openvswitch/sc-cert.pem /etc/openvswitch/cacert.pem After you have added all of these configuration keys, you may specify "ssl:" connection methods elsewhere in the configuration database. diff --git a/INSTALL.XenServer b/INSTALL.XenServer index 54766332b..2f41d8f5b 100644 --- a/INSTALL.XenServer +++ b/INSTALL.XenServer @@ -28,9 +28,9 @@ Once you have a distribution tarball, copy it into cd /tmp tar xfz /usr/src/redhat/SOURCES/openvswitch-$VERSION.tar.gz rpmbuild \ - -D "vswitch_version $VERSION" \ + -D "openvswitch_version $VERSION" \ -D "xen_version $XENKERNEL" \ - -bb openvswitch-$VERSION/xenserver/vswitch-xen.spec + -bb openvswitch-$VERSION/xenserver/openvswitch-xen.spec where: @@ -43,26 +43,26 @@ where: It always ends in "xen". Two RPMs will be output into /usr/src/redhat/RPMS, whose names begin -with "vswitch" and "vswitch-debuginfo". +with "openvswitch" and "openvswitch-debuginfo". Installing Open vSwitch for XenServer ------------------------------------- To install Open vSwitch on a XenServer host, or to upgrade to a newer -version, copy the "vswitch" RPM to that host with "scp", then install +version, copy the "openvswitch" RPM to that host with "scp", then install it with "rpm -U", e.g.: - scp vswitch-$VERSION-1.i386.rpm root@: + scp openvswitch-$VERSION-1.i386.rpm root@: (At this point you will have to enter 's root password.) ssh root@ (At this point you will have to enter 's root password again.) - rpm -U vswitch-$VERSION-1.i386.rpm + rpm -U openvswitch-$VERSION-1.i386.rpm To uninstall Open vSwitch from a XenServer host, remove the package: ssh root@ (At this point you will have to enter 's root password again.) - rpm -e vswitch + rpm -e openvswitch After installing or uninstalling Open vSwitch, the XenServer should be rebooted as soon as possible. diff --git a/INSTALL.bridge b/INSTALL.bridge index fc04a87e0..8e65021b6 100644 --- a/INSTALL.bridge +++ b/INSTALL.bridge @@ -41,7 +41,7 @@ kernel bridge module. 3. Start ovs-brcompatd: % ovs-brcompatd --pidfile --detach -vANY:console:EMER \ - unix:/usr/local/var/run/ovsdb-server + unix:/usr/local/var/run/openvswitch/db.sock (ovsdb-server and ovs-vswitchd should already have been loaded.) diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init index 3db7ace79..08f961adc 100755 --- a/debian/openvswitch-switch.init +++ b/debian/openvswitch-switch.init @@ -205,7 +205,7 @@ case "$1" in fi # Create an empty configuration database if it doesn't exist. - if test ! -e /etc/openvswitch-switch/conf; then + if test ! -e /etc/openvswitch/conf.db; then # Create configuration database. ovsdb-tool -vANY:console:emer \ create /etc/openvswitch-switch/conf \ diff --git a/lib/dirs.h b/lib/dirs.h index 5e2610590..ea5e3b5da 100644 --- a/lib/dirs.h +++ b/lib/dirs.h @@ -18,8 +18,8 @@ #define DIRS_H 1 extern const char ovs_pkgdatadir[]; /* /usr/local/share/openvswitch */ -extern const char ovs_rundir[]; /* /usr/local/var/run */ -extern const char ovs_logdir[]; /* /usr/local/var/log */ +extern const char ovs_rundir[]; /* /usr/local/var/run/openvswitch */ +extern const char ovs_logdir[]; /* /usr/local/var/log/openvswitch */ extern const char ovs_bindir[]; /* /usr/local/bin */ #endif /* dirs.h */ diff --git a/lib/unixctl.c b/lib/unixctl.c index 88fe60352..b52d3d1ec 100644 --- a/lib/unixctl.c +++ b/lib/unixctl.c @@ -443,7 +443,7 @@ unixctl_server_destroy(struct unixctl_server *server) /* Connects to a Vlog server socket. 'path' should be the name of a Vlog * server socket. If it does not start with '/', it will be prefixed with - * ovs_rundir (e.g. /var/run). + * ovs_rundir (e.g. /var/run/openvswitch). * * Returns 0 if successful, otherwise a positive errno value. If successful, * sets '*clientp' to the new unixctl_client, otherwise to NULL. */ diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4 index ccb3a0143..58e4b64e0 100644 --- a/m4/openvswitch.m4 +++ b/m4/openvswitch.m4 @@ -113,9 +113,10 @@ AC_DEFUN([OVS_CHECK_RUNDIR], [AC_ARG_WITH( [rundir], AC_HELP_STRING([--with-rundir=DIR], - [directory used for pidfiles [[LOCALSTATEDIR/run]]]), + [directory used for pidfiles + [[LOCALSTATEDIR/run/openvswitch]]]), [RUNDIR=$withval], - [RUNDIR='${localstatedir}/run']) + [RUNDIR='${localstatedir}/run/openvswitch']) AC_SUBST([RUNDIR])]) dnl Checks for the directory in which to store logs. diff --git a/utilities/ovs-vsctl.8.in b/utilities/ovs-vsctl.8.in index 19ef5584d..ee1eadf37 100644 --- a/utilities/ovs-vsctl.8.in +++ b/utilities/ovs-vsctl.8.in @@ -79,7 +79,7 @@ the global options by \fB\-\-\fR. .IP "\fB\-\-db=\fIserver\fR" Sets \fIserver\fR as the database server that \fBovs\-vsctl\fR contacts to query or modify configuration. The default is -\fBunix:@RUNDIR@/ovsdb\-server\fR. \fIserver\fR must take one of the +\fBunix:@RUNDIR@/db.sock\fR. \fIserver\fR must take one of the following forms: .RS .so ovsdb/remote-active.man diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index 4ca737edc..0bf87c2be 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -449,7 +449,7 @@ default_db(void) { static char *def; if (!def) { - def = xasprintf("unix:%s/ovsdb-server", ovs_rundir); + def = xasprintf("unix:%s/db.sock", ovs_rundir); } return def; } diff --git a/xenserver/README b/xenserver/README index 6dafdb402..255e5e602 100644 --- a/xenserver/README +++ b/xenserver/README @@ -1,4 +1,4 @@ -This directory contains files for seamless integration of vswitch on +This directory contains files for seamless integration of Open vSwitch on Citrix XenServer hosts managed by the Citrix management tools. Some of these files are modifications of Citrix's proprietary code. @@ -11,55 +11,60 @@ Most of the files in this directory is installed on a XenServer system under the same name, if underscores are replaced by slashes. The files are: - etc_init.d_vswitch + etc_init.d_openvswitch - Initializes the vswitch at boot and shuts it down at shutdown. + Initializes Open vSwitch at boot and shuts it down at shutdown. - etc_init.d_vswitch-xapi-update + etc_init.d_openvswitch-xapi-update - Init script to ensure vswitch-cfg-update is called for the + Init script to ensure openvswitch-cfg-update is called for the current host at boot. - etc_logrotate.d_vswitch + etc_logrotate.d_openvswitch - Ensures that /var/log/ovs-vswitchd.log is rotated periodically - and that ovs-vswitchd reopens its log file at that point. + Ensures that logs in /var/log/openvswitch are rotated + periodically and that appropriate daemons reopen their log + files at that point. - etc_profile.d_vswitch.sh + etc_profile.d_openvswitch.sh - vswitch-related shell functions for the administrator's + Open vSwitch-related shell functions for the administrator's convenience. - etc_xapi.d_plugins_vswitch-cfg-update + etc_xapi.d_plugins_openvswitch-cfg-update xapi plugin script to update the cache of configuration items - in the ovs-vswitchd configuration file that are managed in the + in the ovs-vswitchd configuration that are managed in the xapi database when integrated with Citrix management tools. etc_xensource_scripts_vif - vswitch-aware replacement for Citrix script of the same name. + Open vSwitch-aware replacement for Citrix script of the same name. + + openvswitch-xen.spec + + spec file for building RPMs to install on a XenServer host. opt_xensource_libexec_interface-reconfigure - vswitch-aware replacement for Citrix script of the same name. + Open vSwitch-aware replacement for Citrix script of the same name. - usr_share_vswitch_scripts_refresh-network-uuids + usr_share_openvswitch_scripts_refresh-network-uuids Script to refresh bridge..network-uuids keys, which can get out-of-sync following a pool join. Running this script is an alternative to rebooting the host. - root_vswitch_scripts_sysconfig.template + usr_share_openvswitch_scripts_sysconfig.template - Template for vswitch's /etc/sysconfig/vswitch configuration - file. + Template for Open vSwitch's /etc/sysconfig/openvswitch + configuration file. usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py xsconsole plugin to configure the pool-wide configuration keys - used to control vswitch when integrated with Citrix management - tools. + used to control Open vSwitch when integrated with Citrix + management tools. usr_sbin_brctl @@ -68,25 +73,21 @@ files are: usr_sbin_xen-bugtool - vswitch-aware replacement for Citrix script of the same name. - - vswitch-xen.spec - - spec file for building RPMs to install on a XenServer host. + Open vSwitch-aware replacement for Citrix script of the same name. -To install, build the vswitch RPM with a command like this: +To install, build the Open vSwitch RPM with a command like this: - rpmbuild -D "vswitch_version $full_version" \ + rpmbuild -D "openvswitch_version $full_version" \ -D "xen_version $XENKERNEL" \ -D "build_number --with-build-number=$buildnr" \ - -bb vswitch-xen.spec + -bb openvswitch-xen.spec -Then, "rpm -U" the resulting vswitch package on the XenServer hosts in -question and reboot them. (The vswitch-dbg package that is also +Then, "rpm -U" the resulting Open vSwitch package on the XenServer hosts in +question and reboot them. (The openvswitch-dbg package that is also produced need not be installed, but it is harmless to do so.) ---------------------------------------------------------------------- -Copyright (C) 2009 Nicira Networks, Inc. +Copyright (C) 2009, 2010 Nicira Networks, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/xenserver/automake.mk b/xenserver/automake.mk index dde4105e6..b451bbb87 100644 --- a/xenserver/automake.mk +++ b/xenserver/automake.mk @@ -9,12 +9,13 @@ EXTRA_DIST += \ xenserver/LICENSE \ xenserver/README \ xenserver/automake.mk \ - xenserver/etc_init.d_vswitch \ - xenserver/etc_init.d_vswitch-xapi-update \ - xenserver/etc_logrotate.d_vswitch \ - xenserver/etc_profile.d_vswitch.sh \ - xenserver/etc_xapi.d_plugins_vswitch-cfg-update \ + xenserver/etc_init.d_openvswitch \ + xenserver/etc_init.d_openvswitch-xapi-update \ + xenserver/etc_logrotate.d_openvswitch \ + xenserver/etc_profile.d_openvswitch.sh \ + xenserver/etc_xapi.d_plugins_openvswitch-cfg-update \ xenserver/etc_xensource_scripts_vif \ + xenserver/openvswitch-xen.spec \ xenserver/opt_xensource_libexec_InterfaceReconfigure.py \ xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py \ xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py \ @@ -22,6 +23,5 @@ EXTRA_DIST += \ xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py \ xenserver/usr_sbin_brctl \ xenserver/usr_sbin_xen-bugtool \ - xenserver/usr_share_vswitch_scripts_refresh-network-uuids \ - xenserver/usr_share_vswitch_scripts_sysconfig.template \ - xenserver/vswitch-xen.spec + xenserver/usr_share_openvswitch_scripts_refresh-network-uuids \ + xenserver/usr_share_openvswitch_scripts_sysconfig.template diff --git a/xenserver/etc_init.d_vswitch b/xenserver/etc_init.d_openvswitch similarity index 85% rename from xenserver/etc_init.d_vswitch rename to xenserver/etc_init.d_openvswitch index 9b05879aa..f531d45ce 100755 --- a/xenserver/etc_init.d_vswitch +++ b/xenserver/etc_init.d_openvswitch @@ -1,9 +1,9 @@ #!/bin/bash # -# vswitch +# openvswitch # # chkconfig: 2345 09 91 -# description: Manage vswitch kernel modules and user-space daemon +# description: Manage Open vSwitch kernel modules and user-space daemons # Copyright (C) 2009, 2010 Nicira Networks, Inc. # @@ -21,21 +21,21 @@ . /etc/init.d/functions -test -e /etc/sysconfig/vswitch && . /etc/sysconfig/vswitch +test -e /etc/sysconfig/openvswitch && . /etc/sysconfig/openvswitch -# General config variables in /etc/sysconfig/vswitch +# General config variables in /etc/sysconfig/openvswitch : ${ENABLE_BRCOMPAT:=y} : ${ENABLE_FAKE_PROC_NET:=y} : ${ENABLE_MONITOR:=y} : ${FORCE_COREFILES:=y} # Config variables specific to ovsdb-server -: ${OVSDB_SERVER_REMOTES:=punix:/var/run/ovsdb-server db:Open_vSwitch,managers} -: ${OVSDB_SERVER_DB:=/etc/ovs-vswitchd.conf.db} -: ${OVSDB_SERVER_PIDFILE:=/var/run/ovsdb-server.pid} -: ${OVSDB_SERVER_RUN_DIR:=/var/xen/vswitch} +: ${OVSDB_SERVER_REMOTES:=punix:/var/run/openvswitch/db.sock db:Open_vSwitch,managers} +: ${OVSDB_SERVER_DB:=/etc/openvswitch/conf.db} +: ${OVSDB_SERVER_PIDFILE:=/var/run/openvswitch/ovsdb-server.pid} +: ${OVSDB_SERVER_RUN_DIR:=/var/xen/openvswitch} : ${OVSDB_SERVER_PRIORITY:=-10} -: ${OVSDB_SERVER_LOGFILE:=/var/log/ovsdb-server.log} +: ${OVSDB_SERVER_LOGFILE:=/var/log/openvswitch/ovsdb-server.log} : ${OVSDB_SERVER_FILE_LOGLEVEL:=INFO} : ${OVSDB_SERVER_SYSLOG_LOGLEVEL:=ERR} : ${OVSDB_SERVER_MEMLEAK_LOGFILE:=} @@ -45,13 +45,13 @@ test -e /etc/sysconfig/vswitch && . /etc/sysconfig/vswitch : ${OVSDB_SERVER_VALGRIND_OPT:=} # Config variables specific to ovs-vswitchd -: ${VSWITCHD_OVSDB_SERVER:=unix:/var/run/ovsdb-server} -: ${VSWITCHD_OVSDB_SCHEMA:=/usr/share/vswitch/vswitch.ovsschema} -: ${VSWITCHD_PIDFILE:=/var/run/ovs-vswitchd.pid} -: ${VSWITCHD_RUN_DIR:=/var/xen/vswitch} +: ${VSWITCHD_OVSDB_SERVER:=unix:/var/run/openvswitch/db.sock} +: ${VSWITCHD_OVSDB_SCHEMA:=/usr/share/openvswitch/vswitch.ovsschema} +: ${VSWITCHD_PIDFILE:=/var/run/openvswitch/ovs-vswitchd.pid} +: ${VSWITCHD_RUN_DIR:=/var/xen/openvswitch} : ${VSWITCHD_PRIORITY:=-10} : ${VSWITCHD_MLOCKALL:=yes} -: ${VSWITCHD_LOGFILE:=/var/log/ovs-vswitchd.log} +: ${VSWITCHD_LOGFILE:=/var/log/openvswitch/ovs-vswitchd.log} : ${VSWITCHD_FILE_LOGLEVEL:=INFO} : ${VSWITCHD_SYSLOG_LOGLEVEL:=ERR} : ${VSWITCHD_MEMLEAK_LOGFILE:=} @@ -61,10 +61,10 @@ test -e /etc/sysconfig/vswitch && . /etc/sysconfig/vswitch : ${VSWITCHD_VALGRIND_OPT:=} # Config variables specific to ovs-brcompatd -: ${BRCOMPATD_PIDFILE:=/var/run/ovs-brcompatd.pid} -: ${BRCOMPATD_RUN_DIR:=/var/xen/vswitch} +: ${BRCOMPATD_PIDFILE:=/var/run/openvswitch/ovs-brcompatd.pid} +: ${BRCOMPATD_RUN_DIR:=/var/xen/openvswitch} : ${BRCOMPATD_PRIORITY:=-10} -: ${BRCOMPATD_LOGFILE:=/var/log/ovs-brcompatd.log} +: ${BRCOMPATD_LOGFILE:=/var/log/openvswitch/ovs-brcompatd.log} : ${BRCOMPATD_FILE_LOGLEVEL:=INFO} : ${BRCOMPATD_SYSLOG_LOGLEVEL:=ERR} : ${BRCOMPATD_MEMLEAK_LOGFILE:=} @@ -118,7 +118,7 @@ function insert_modules_if_required { if [ -n "$BRCOMPATD_PIDFILE" ] && ! lsmod | grep -q "brcompat_mod"; then action "Inserting brcompat module" modprobe brcompat_mod fi - if [ -f "/lib/modules/`uname -r`/kernel/net/vswitch/ip_gre_mod.ko" ] && ! lsmod | grep -q "ip_gre_mod"; then + if [ -f "/lib/modules/`uname -r`/kernel/net/openvswitch/ip_gre_mod.ko" ] && ! lsmod | grep -q "ip_gre_mod"; then action "Inserting ip_gre module" modprobe ip_gre_mod fi } @@ -140,17 +140,20 @@ function start_ovsdb_server { local logfile_file_opt="" local logfile_level_opt="" if [ ! -d "$OVSDB_SERVER_RUN_DIR" ]; then - mkdir -p "$OVSDB_SERVER_RUN_DIR" + install -d -m 755 -o root -g root "$OVSDB_SERVER_RUN_DIR" fi cd "$OVSDB_SERVER_RUN_DIR" local remotes= for remote in $OVSDB_SERVER_REMOTES; do remotes="$remotes --remote=$remote" done + + install -d -m 755 -o root -g root `dirname $OVSDB_SERVER_LOGFILE` if [ -n "$OVSDB_SERVER_FILE_LOGLEVEL" ]; then logfile_level_opt="-vANY:FILE:${OVSDB_SERVER_FILE_LOGLEVEL}" logfile_file_opt="--log-file=$OVSDB_SERVER_LOGFILE" fi + local leak_opt="" if [ -n "$OVSDB_SERVER_MEMLEAK_LOGFILE" ]; then leak_opt="--check-leaks=$OVSDB_SERVER_MEMLEAK_LOGFILE" @@ -173,6 +176,7 @@ function start_ovsdb_server { daemonize="n" fi ssl_opts="--private-key=db:SSL,private_key --certificate=db:SSL,certificate --bootstrap-ca-cert=db:SSL,ca_cert" + install -d -m 755 -o root -g root `dirname $OVSDB_SERVER_PIDFILE` if [ "$daemonize" != "y" ]; then # Start in background and force a "success" message action "Starting ovsdb_server ($strace_opt$valgrind_opt)" true @@ -187,13 +191,16 @@ function start_vswitchd { local logfile_file_opt="" local logfile_level_opt="" if [ ! -d "$VSWITCHD_RUN_DIR" ]; then - mkdir -p "$VSWITCHD_RUN_DIR" + install -d -m 755 -o root -g root "$VSWITCHD_RUN_DIR" fi cd "$VSWITCHD_RUN_DIR" + + install -d -m 755 -o root -g root `dirname $VSWITCHD_LOGFILE` if [ -n "$VSWITCHD_FILE_LOGLEVEL" ]; then logfile_level_opt="-vANY:FILE:${VSWITCHD_FILE_LOGLEVEL}" logfile_file_opt="--log-file=$VSWITCHD_LOGFILE" fi + local leak_opt="" if [ -n "$VSWITCHD_MEMLEAK_LOGFILE" ]; then leak_opt="--check-leaks=$VSWITCHD_MEMLEAK_LOGFILE" @@ -222,6 +229,8 @@ function start_vswitchd { if [ "$VSWITCHD_MLOCKALL" != "no" ]; then mlockall_opt="--mlockall" fi + + install -d -m 755 -o root -g root `dirname $VSWITCHD_PIDFILE` if [ "$daemonize" != "y" ]; then # Start in background and force a "success" message action "Starting ovs-vswitchd ($strace_opt$valgrind_opt)" true @@ -236,13 +245,16 @@ function start_brcompatd { local logfile_file_opt="" local logfile_level_opt="" if [ -d "$BRCOMPATD_RUN_DIR" ]; then - mkdir -p "$BRCOMPATD_RUN_DIR" + install -d -m 755 -o root -g root "$BRCOMPATD_RUN_DIR" fi cd "$BRCOMPATD_RUN_DIR" + + install -d -m 755 -o root -g root `dirname $BRCOMPATD_LOGFILE` if [ -n "$BRCOMPATD_FILE_LOGLEVEL" ]; then logfile_level_opt="-vANY:FILE:${BRCOMPATD_FILE_LOGLEVEL}" logfile_file_opt="--log-file=$BRCOMPATD_LOGFILE" fi + local leak_opt="" if [ -n "$BRCOMPATD_MEMLEAK_LOGFILE" ]; then leak_opt="--check-leaks=$BRCOMPATD_MEMLEAK_LOGFILE" @@ -264,7 +276,9 @@ function start_brcompatd { valgrind_opt="valgrind --log-file=$BRCOMPATD_VALGRIND_LOG $BRCOMPATD_VALGRIND_OPT" daemonize="n" fi - appctl_cmd="$appctl --target=/var/run/ovs-vswitchd.\`cat $VSWITCHD_PIDFILE\`.ctl %s" + appctl_cmd="$appctl --target=/var/run/openvswitch/ovs-vswitchd.\`cat $VSWITCHD_PIDFILE\`.ctl %s" + + install -d -m 755 -o root -g root `dirname $BRCOMPATD_PIDFILE` if [ "$daemonize" != "y" ]; then # Start in background and force a "success" message action "Starting ovs-brcompatd ($strace_opt$valgrind_opt)" true @@ -307,7 +321,7 @@ function restart_approval { WARNING!!! -Restarting vswitch on a live server is not guaranteed to work. It is +Restarting Open vSwitch on a live server is not guaranteed to work. It is provided as a convenience for those situations in which it does work. EOF @@ -349,6 +363,7 @@ function start { if [ ! -e "$OVSDB_SERVER_DB" ]; then warning "$OVSDB_SERVER_DB does not exist" + install -d -m 755 -o root -g root `dirname $OVSDB_SERVER_DB` action "Creating empty database $OVSDB_SERVER_DB" true $ovsdb_tool -vANY:console:emer create "$OVSDB_SERVER_DB" "$VSWITCHD_OVSDB_SCHEMA" @@ -359,8 +374,8 @@ function start { start_ovsdb_server $vsctl --no-wait init - if [ ! -e /var/run/vswitch.booted ]; then - touch /var/run/vswitch.booted + if [ ! -e /var/run/openvswitch.booted ]; then + touch /var/run/openvswitch.booted for bridge in $($vsctl list-br); do $vsctl --no-wait del-br $bridge done @@ -370,14 +385,14 @@ function start { start_vswitchd start_brcompatd - touch /var/lock/subsys/vswitch + touch /var/lock/subsys/openvswitch } function stop { stop_brcompatd stop_vswitchd stop_ovsdb_server - rm -f /var/lock/subsys/vswitch + rm -f /var/lock/subsys/openvswitch } function restart { @@ -416,7 +431,7 @@ case "$1" in /usr/sbin/ovs-brcompatd -V ;; help) - printf "vswitch [start|stop|restart|unload|status|version]\n" + printf "openvswitch [start|stop|restart|unload|status|version]\n" ;; *) printf "Unknown command: $1\n" diff --git a/xenserver/etc_init.d_vswitch-xapi-update b/xenserver/etc_init.d_openvswitch-xapi-update similarity index 100% rename from xenserver/etc_init.d_vswitch-xapi-update rename to xenserver/etc_init.d_openvswitch-xapi-update diff --git a/xenserver/etc_logrotate.d_vswitch b/xenserver/etc_logrotate.d_openvswitch similarity index 72% rename from xenserver/etc_logrotate.d_vswitch rename to xenserver/etc_logrotate.d_openvswitch index d6f71afb2..22aab36ae 100644 --- a/xenserver/etc_logrotate.d_vswitch +++ b/xenserver/etc_logrotate.d_openvswitch @@ -1,14 +1,14 @@ -# Copyright (C) 2009 Nicira Networks, Inc. +# Copyright (C) 2009, 2010 Nicira Networks, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. This file is offered as-is, # without warranty of any kind. -/var/log/ovs-vswitchd.log /var/log/ovs-brcompatd.log { +/var/log/openvswitch/* { sharedscripts postrotate - # Tell ovs-vswitchd and ovs-brcompatd to reopen their log files + # Tell Open vSwitch daemons to reopen their log files /usr/bin/ovs-appctl -t ovs-vswitchd vlog/reopen /usr/bin/ovs-appctl -t ovs-brcompatd vlog/reopen /usr/bin/ovs-appctl -t ovsdb-server vlog/reopen diff --git a/xenserver/etc_profile.d_vswitch.sh b/xenserver/etc_profile.d_openvswitch.sh similarity index 77% rename from xenserver/etc_profile.d_vswitch.sh rename to xenserver/etc_profile.d_openvswitch.sh index a001e2158..a7e1a0ccf 100644 --- a/xenserver/etc_profile.d_vswitch.sh +++ b/xenserver/etc_profile.d_openvswitch.sh @@ -5,7 +5,8 @@ # notice and this notice are preserved. This file is offered as-is, # without warranty of any kind. -alias vswitch='service vswitch' +alias vswitch='service openvswitch' +alias openvswitch='service openvswitch' function watchdp { watch ovs-dpctl show "$@" @@ -41,7 +42,7 @@ function monitorlogs { done grep="$grep'" fi - cmd="tail -F /var/log/messages /var/log/ovs-vswitchd.log /var/log/xensource.log $grep | tee /var/log/monitorlogs.out" + cmd="tail -F /var/log/messages /var/log/openvswitch/ovs-vswitchd.log /var/log/openvswitch/ovs-brcompatd.log /var/log/openvswitch/ovsdb-server /var/log/xensource.log $grep | tee /var/log/monitorlogs.out" printf "cmd: $cmd\n" eval "$cmd" } diff --git a/xenserver/etc_xapi.d_plugins_vswitch-cfg-update b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update similarity index 93% rename from xenserver/etc_xapi.d_plugins_vswitch-cfg-update rename to xenserver/etc_xapi.d_plugins_openvswitch-cfg-update index 4cf2d881b..8314a1b62 100755 --- a/xenserver/etc_xapi.d_plugins_vswitch-cfg-update +++ b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update @@ -1,8 +1,8 @@ #!/usr/bin/env python # # xapi plugin script to update the cache of configuration items in the -# ovs-vswitchd configuration file that are managed in the xapi database -# when integrated with Citrix management tools. +# ovs-vswitchd configuration that are managed in the xapi database when +# integrated with Citrix management tools. # Copyright (C) 2009, 2010 Nicira Networks, Inc. # @@ -27,7 +27,7 @@ import os import subprocess vsctl="/usr/bin/ovs-vsctl" -cacert_filename="/etc/ovs-vswitchd.cacert" +cacert_filename="/etc/openvswitch/vswitchd.cacert" # Delete the CA certificate, so that we go back to boot-strapping mode def delete_cacert(): @@ -80,8 +80,7 @@ def setControllerCfg(controller): "--", "del-ssl", "--", "--bootstrap", "set-ssl", "/etc/xensource/xapi-ssl.pem", - "/etc/xensource/xapi-ssl.pem", - "/etc/ovs-vswitchd.cacert", + cacert_filename, "--", "set", "Open_vSwitch", ".", 'managers="ssl:' + controller + ':6632"']) diff --git a/xenserver/etc_xensource_scripts_vif b/xenserver/etc_xensource_scripts_vif index 56c710d81..1a38dc4c9 100755 --- a/xenserver/etc_xensource_scripts_vif +++ b/xenserver/etc_xensource_scripts_vif @@ -47,7 +47,7 @@ handle_promiscuous() esac ;; vswitch) - logger -t script-vif "${dev}: Promiscuous ports are not supported via vSwitch." + logger -t script-vif "${dev}: Promiscuous ports are not supported via Open vSwitch." ;; esac fi diff --git a/xenserver/vswitch-xen.spec b/xenserver/openvswitch-xen.spec similarity index 64% rename from xenserver/vswitch-xen.spec rename to xenserver/openvswitch-xen.spec index ad0fba414..9e6f79945 100644 --- a/xenserver/vswitch-xen.spec +++ b/xenserver/openvswitch-xen.spec @@ -1,4 +1,4 @@ -# Spec file for vswitch and related programs. +# Spec file for Open vSwitch. # Copyright (C) 2009, 2010 Nicira Networks, Inc. # @@ -8,41 +8,34 @@ # without warranty of any kind. # When building, the rpmbuild command line should define -# vswitch_version, xen_version, and build_number using -D arguments. +# openvswitch_version, xen_version, and build_number using -D arguments. # for example: # -# rpmbuild -D "vswitch_version 0.8.9~1+build123" -D "xen_version 2.6.18-128.1.1.el5.xs5.1.0.483.1000xen" -D "build_number --with-build-number=123" -bb /usr/src/redhat/SPECS/vswitch-xen.spec +# rpmbuild -D "openvswitch_version 0.8.9~1+build123" -D "xen_version 2.6.18-128.1.1.el5.xs5.1.0.483.1000xen" -D "build_number --with-build-number=123" -bb /usr/src/redhat/SPECS/openvswitch-xen.spec # -%define version %{vswitch_version}-%{xen_version} +%define version %{openvswitch_version}-%{xen_version} -Name: vswitch +Name: openvswitch Summary: Virtual switch Group: System Environment/Daemons URL: http://www.openvswitch.org/ Vendor: Nicira Networks, Inc. -Version: %{vswitch_version} +Version: %{openvswitch_version} # The entire source code is ASL 2.0 except datapath/ which is GPLv2 License: ASL 2.0 and GPLv2 Release: 1 -Source: openvswitch-%{vswitch_version}.tar.gz -Buildroot: /tmp/vswitch-xen-rpm +Source: openvswitch-%{openvswitch_version}.tar.gz +Buildroot: /tmp/openvswitch-xen-rpm Requires: kernel-xen = %(echo '%{xen_version}' | sed 's/xen$//') -# The following Conflicts prevents the "vswitch" package generated by -# this spec file from installing at the same time as the "openvswitch" -# package shipped with XenServer 5.5.900. In fact, the packages -# contain some files with identical names anyhow, so they will not -# coexist, but adding an explicit Conflicts makes this conflict more -# obvious. -Conflicts: openvswitch %description -The vswitch provides standard network bridging functions augmented with +Open vSwitch provides standard network bridging functions augmented with support for the OpenFlow protocol for remote per-flow control of traffic. %prep -%setup -q -n openvswitch-%{vswitch_version} +%setup -q -n openvswitch-%{openvswitch_version} %build ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} --with-l26=/lib/modules/%{xen_version}/build --enable-ssl %{build_number} @@ -53,47 +46,47 @@ rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT install -d -m 755 $RPM_BUILD_ROOT/etc install -d -m 755 $RPM_BUILD_ROOT/etc/init.d -install -m 755 xenserver/etc_init.d_vswitch \ - $RPM_BUILD_ROOT/etc/init.d/vswitch -install -m 755 xenserver/etc_init.d_vswitch-xapi-update \ - $RPM_BUILD_ROOT/etc/init.d/vswitch-xapi-update +install -m 755 xenserver/etc_init.d_openvswitch \ + $RPM_BUILD_ROOT/etc/init.d/openvswitch +install -m 755 xenserver/etc_init.d_openvswitch-xapi-update \ + $RPM_BUILD_ROOT/etc/init.d/openvswitch-xapi-update install -d -m 755 $RPM_BUILD_ROOT/etc/sysconfig install -d -m 755 $RPM_BUILD_ROOT/etc/logrotate.d -install -m 755 xenserver/etc_logrotate.d_vswitch \ - $RPM_BUILD_ROOT/etc/logrotate.d/vswitch +install -m 755 xenserver/etc_logrotate.d_openvswitch \ + $RPM_BUILD_ROOT/etc/logrotate.d/openvswitch install -d -m 755 $RPM_BUILD_ROOT/etc/profile.d -install -m 755 xenserver/etc_profile.d_vswitch.sh \ - $RPM_BUILD_ROOT/etc/profile.d/vswitch.sh +install -m 755 xenserver/etc_profile.d_openvswitch.sh \ + $RPM_BUILD_ROOT/etc/profile.d/openvswitch.sh install -d -m 755 $RPM_BUILD_ROOT/etc/xapi.d/plugins -install -m 755 xenserver/etc_xapi.d_plugins_vswitch-cfg-update \ - $RPM_BUILD_ROOT/etc/xapi.d/plugins/vswitch-cfg-update -install -d -m 755 $RPM_BUILD_ROOT/usr/share/vswitch/scripts +install -m 755 xenserver/etc_xapi.d_plugins_openvswitch-cfg-update \ + $RPM_BUILD_ROOT/etc/xapi.d/plugins/openvswitch-cfg-update +install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts install -m 644 vswitchd/vswitch.ovsschema \ - $RPM_BUILD_ROOT/usr/share/vswitch/vswitch.ovsschema + $RPM_BUILD_ROOT/usr/share/openvswitch/vswitch.ovsschema install -m 755 xenserver/opt_xensource_libexec_interface-reconfigure \ - $RPM_BUILD_ROOT/usr/share/vswitch/scripts/interface-reconfigure + $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/interface-reconfigure install -m 644 xenserver/opt_xensource_libexec_InterfaceReconfigure.py \ - $RPM_BUILD_ROOT/usr/share/vswitch/scripts/InterfaceReconfigure.py + $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/InterfaceReconfigure.py install -m 644 xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py \ - $RPM_BUILD_ROOT/usr/share/vswitch/scripts/InterfaceReconfigureBridge.py + $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/InterfaceReconfigureBridge.py install -m 644 xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py \ - $RPM_BUILD_ROOT/usr/share/vswitch/scripts/InterfaceReconfigureVswitch.py + $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/InterfaceReconfigureVswitch.py install -m 755 xenserver/etc_xensource_scripts_vif \ - $RPM_BUILD_ROOT/usr/share/vswitch/scripts/vif -install -m 755 xenserver/usr_share_vswitch_scripts_refresh-network-uuids \ - $RPM_BUILD_ROOT/usr/share/vswitch/scripts/refresh-network-uuids + $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/vif +install -m 755 xenserver/usr_share_openvswitch_scripts_refresh-network-uuids \ + $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/refresh-network-uuids install -m 755 xenserver/usr_sbin_xen-bugtool \ - $RPM_BUILD_ROOT/usr/share/vswitch/scripts/xen-bugtool + $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/xen-bugtool install -m 755 xenserver/usr_sbin_brctl \ - $RPM_BUILD_ROOT/usr/share/vswitch/scripts/brctl -install -m 755 xenserver/usr_share_vswitch_scripts_sysconfig.template \ - $RPM_BUILD_ROOT/usr/share/vswitch/scripts/sysconfig.template + $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/brctl +install -m 755 xenserver/usr_share_openvswitch_scripts_sysconfig.template \ + $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/sysconfig.template install -m 644 \ xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py \ - $RPM_BUILD_ROOT/usr/share/vswitch/scripts/XSFeatureVSwitch.py + $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/XSFeatureVSwitch.py -install -d -m 755 $RPM_BUILD_ROOT/lib/modules/%{xen_version}/kernel/net/vswitch -find datapath/linux-2.6 -name *.ko -exec install -m 755 \{\} $RPM_BUILD_ROOT/lib/modules/%{xen_version}/kernel/net/vswitch \; +install -d -m 755 $RPM_BUILD_ROOT/lib/modules/%{xen_version}/kernel/net/openvswitch +find datapath/linux-2.6 -name *.ko -exec install -m 755 \{\} $RPM_BUILD_ROOT/lib/modules/%{xen_version}/kernel/net/openvswitch \; # Get rid of stuff we don't want to make RPM happy. rm \ @@ -109,7 +102,7 @@ rm \ $RPM_BUILD_ROOT/usr/share/man/man8/ovs-kill.8 \ $RPM_BUILD_ROOT/usr/share/man/man8/ovs-openflowd.8 \ $RPM_BUILD_ROOT/usr/share/man/man8/ovs-pki.8 -rm -f $RPM_BUILD_ROOT/lib/modules/%{xen_version}/kernel/net/vswitch/veth_mod.ko +rm -f $RPM_BUILD_ROOT/lib/modules/%{xen_version}/kernel/net/openvswitch/veth_mod.ko install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch @@ -171,7 +164,7 @@ if test ! -e /var/xapi/network.dbcache; then printf "Re-creating xapi database cache... " fi - if /usr/share/vswitch/scripts/interface-reconfigure rewrite; then + if /usr/share/openvswitch/scripts/interface-reconfigure rewrite; then printf "done.\n" else printf "FAILED\n" @@ -200,20 +193,22 @@ net.ipv4.conf.all.arp_filter = 1 EOF fi -if test ! -e /etc/ovs-vswitchd.conf.db; then +if test ! -e /etc/openvswitch/conf.db; then + install -d -m 755 -o root -g root /etc/openvswitch + # Create ovs-vswitchd config database - ovsdb-tool -vANY:console:emer create /etc/ovs-vswitchd.conf.db \ - /usr/share/vswitch/vswitch.ovsschema \ + ovsdb-tool -vANY:console:emer create /etc/openvswitch/conf.db \ + /usr/share/openvswitch/vswitch.ovsschema \ # Create initial table in config database - ovsdb-tool -vANY:console:emer transact /etc/ovs-vswitchd.conf.db \ + ovsdb-tool -vANY:console:emer transact /etc/openvswitch/conf.db \ '[{"op": "insert", "table": "Open_vSwitch", "row": {}}]' \ > /dev/null fi -# Create default or update existing /etc/sysconfig/vswitch. -SYSCONFIG=/etc/sysconfig/vswitch -TEMPLATE=/usr/share/vswitch/scripts/sysconfig.template +# Create default or update existing /etc/sysconfig/openvswitch. +SYSCONFIG=/etc/sysconfig/openvswitch +TEMPLATE=/usr/share/openvswitch/scripts/sysconfig.template if [ ! -e $SYSCONFIG ]; then cp $TEMPLATE $SYSCONFIG else @@ -227,7 +222,7 @@ else fi # Replace XenServer files by our versions. -mkdir -p /usr/lib/vswitch/xs-original \ +mkdir -p /usr/lib/openvswitch/xs-original \ || printf "Could not create script backup directory.\n" for f in \ /opt/xensource/libexec/interface-reconfigure \ @@ -240,23 +235,23 @@ for f in \ do s=$(basename "$f") t=$(readlink "$f") - if [ -f "$f" ] && [ "$t" != "/usr/share/vswitch/scripts/$s" ]; then - mv "$f" /usr/lib/vswitch/xs-original/ \ + if [ -f "$f" ] && [ "$t" != "/usr/share/openvswitch/scripts/$s" ]; then + mv "$f" /usr/lib/openvswitch/xs-original/ \ || printf "Could not save original XenServer $s script\n" - ln -s "/usr/share/vswitch/scripts/$s" "$f" \ - || printf "Could not link to vSwitch $s script\n" + ln -s "/usr/share/openvswitch/scripts/$s" "$f" \ + || printf "Could not link to Open vSwitch $s script\n" fi done # Install xsconsole plugin plugin=$(readlink /usr/lib/xsconsole/plugins-base/XSFeatureVSwitch.py) -if [ "$plugin" != "/usr/share/vswitch/scripts/XSFeatureVSwitch.py" ]; then +if [ "$plugin" != "/usr/share/openvswitch/scripts/XSFeatureVSwitch.py" ]; then rm -f /usr/lib/xsconsole/plugins-base/XSFeatureVSwitch.py - ln -s /usr/share/vswitch/scripts/XSFeatureVSwitch.py /usr/lib/xsconsole/plugins-base/ || printf "Could not link to vSswitch xsconsole plugin.\n" + ln -s /usr/share/openvswitch/scripts/XSFeatureVSwitch.py /usr/lib/xsconsole/plugins-base/ || printf "Could not link to vSswitch xsconsole plugin.\n" fi # Ensure all required services are set to run -for s in vswitch vswitch-xapi-update; do +for s in openvswitch openvswitch-xapi-update; do if chkconfig --list $s >/dev/null 2>&1; then chkconfig --del $s || printf "Could not remove $s init script." fi @@ -264,22 +259,23 @@ for s in vswitch vswitch-xapi-update; do chkconfig $s on || printf "Could not enable $s init script." done -# Configure system to use vswitch +# Configure system to use Open vSwitch echo vswitch > /etc/xensource/network.conf if [ "$1" = "1" ]; then # $1 = 2 for upgrade - printf "\nYou MUST reboot the server NOW to complete the change to the\n" - printf "the vSwitch. Attempts to modify networking on the server\n" + printf "\nYou MUST reboot the server NOW to complete the change to\n" + printf "Open vSwitch. Attempts to modify networking on the server\n" printf "or any hosted VM will fail until after the reboot and could\n" printf "leave the server in an state requiring manual recovery.\n\n" else - printf "\nTo use the new vSwitch, you should reboot the server\n" - printf "now. Failure to do so may result in incorrect operation.\n\n" + printf "\nTo use the new Open vSwitch install, you should reboot the\n" + printf "server now. Failure to do so may result in incorrect operation." + printf "\n\n" fi %preun if [ "$1" = "0" ]; then # $1 = 1 for upgrade - for s in vswitch vswitch-xapi-update; do + for s in openvswitch openvswitch-xapi-update; do chkconfig --del $s || printf "Could not remove $s init script." done fi @@ -291,7 +287,7 @@ if [ "$1" = "0" ]; then # $1 = 1 for upgrade rm -f /usr/lib/xsconsole/plugins-base/XSFeatureVSwitch.py \ /usr/lib/xsconsole/plugins-base/XSFeatureVSwitch.pyc \ /usr/lib/xsconsole/plugins-base/XSFeatureVSwitch.pyo \ - || printf "Could not remove vSwitch xsconsole plugin.\n" + || printf "Could not remove Open vSwitch xsconsole plugin.\n" # Restore original XenServer scripts for f in \ @@ -301,20 +297,20 @@ if [ "$1" = "0" ]; then # $1 = 1 for upgrade /usr/sbin/brctl do s=$(basename "$f") - if [ ! -f "/usr/lib/vswitch/xs-original/$s" ]; then - printf "Original XenServer $s script not present in /usr/lib/vswitch/xs-original\n" + if [ ! -f "/usr/lib/openvswitch/xs-original/$s" ]; then + printf "Original XenServer $s script not present in /usr/lib/openvswitch/xs-original\n" printf "Could not restore original XenServer script.\n" else (rm -f "$f" \ - && mv "/usr/lib/vswitch/xs-original/$s" "$f") \ + && mv "/usr/lib/openvswitch/xs-original/$s" "$f") \ || printf "Could not restore original XenServer $s script.\n" fi done # Remove all configuration files - rm -f /etc/ovs-vswitchd.conf.db - rm -f /etc/sysconfig/vswitch - rm -f /etc/ovs-vswitchd.cacert + rm -f /etc/openvswitch/conf.db + rm -f /etc/sysconfig/openvswitch + rm -f /etc/openvswitch/vswitchd.cacert rm -f /var/xapi/network.dbcache # Configure system to use bridge @@ -329,27 +325,27 @@ fi %files %defattr(-,root,root) -/etc/init.d/vswitch -/etc/init.d/vswitch-xapi-update -/etc/xapi.d/plugins/vswitch-cfg-update -/etc/logrotate.d/vswitch -/etc/profile.d/vswitch.sh -/lib/modules/%{xen_version}/kernel/net/vswitch/openvswitch_mod.ko -/lib/modules/%{xen_version}/kernel/net/vswitch/brcompat_mod.ko +/etc/init.d/openvswitch +/etc/init.d/openvswitch-xapi-update +/etc/xapi.d/plugins/openvswitch-cfg-update +/etc/logrotate.d/openvswitch +/etc/profile.d/openvswitch.sh +/lib/modules/%{xen_version}/kernel/net/openvswitch/openvswitch_mod.ko +/lib/modules/%{xen_version}/kernel/net/openvswitch/brcompat_mod.ko %if %(echo '%{xen_version}'|awk -F"." '{if ($3>=18) print 1; else print 0;}') -/lib/modules/%{xen_version}/kernel/net/vswitch/ip_gre_mod.ko +/lib/modules/%{xen_version}/kernel/net/openvswitch/ip_gre_mod.ko %endif -/usr/share/vswitch/scripts/refresh-network-uuids -/usr/share/vswitch/scripts/interface-reconfigure -/usr/share/vswitch/scripts/InterfaceReconfigure.py -/usr/share/vswitch/scripts/InterfaceReconfigureBridge.py -/usr/share/vswitch/scripts/InterfaceReconfigureVswitch.py -/usr/share/vswitch/scripts/vif -/usr/share/vswitch/scripts/xen-bugtool -/usr/share/vswitch/scripts/XSFeatureVSwitch.py -/usr/share/vswitch/scripts/brctl -/usr/share/vswitch/scripts/sysconfig.template -/usr/share/vswitch/vswitch.ovsschema +/usr/share/openvswitch/scripts/refresh-network-uuids +/usr/share/openvswitch/scripts/interface-reconfigure +/usr/share/openvswitch/scripts/InterfaceReconfigure.py +/usr/share/openvswitch/scripts/InterfaceReconfigureBridge.py +/usr/share/openvswitch/scripts/InterfaceReconfigureVswitch.py +/usr/share/openvswitch/scripts/vif +/usr/share/openvswitch/scripts/xen-bugtool +/usr/share/openvswitch/scripts/XSFeatureVSwitch.py +/usr/share/openvswitch/scripts/brctl +/usr/share/openvswitch/scripts/sysconfig.template +/usr/share/openvswitch/vswitch.ovsschema /usr/sbin/ovs-brcompatd /usr/sbin/ovs-vswitchd /usr/sbin/ovsdb-server @@ -370,5 +366,5 @@ fi /usr/share/man/man8/ovs-vsctl.8.gz /usr/share/man/man8/ovs-vswitchd.8.gz /var/lib/openvswitch -%exclude /usr/share/vswitch/scripts/*.pyc -%exclude /usr/share/vswitch/scripts/*.pyo +%exclude /usr/share/openvswitch/scripts/*.pyc +%exclude /usr/share/openvswitch/scripts/*.pyo diff --git a/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py b/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py index fba89bed0..e75a17d63 100644 --- a/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py +++ b/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py @@ -117,13 +117,13 @@ class VSwitchControllerDialogue(Dialogue): # ChoiceDef(Lang("Restart ovs-brcompatd"), # lambda: self.restartService("vswitch-brcompatd")) ] - self.menu = Menu(self, None, Lang("Configure vSwitch"), choiceDefs) + self.menu = Menu(self, None, Lang("Configure Open vSwitch"), choiceDefs) self.ChangeState("INITIAL") def BuildPane(self): pane = self.NewPane(DialoguePane(self.parent)) - pane.TitleSet(Lang("Configure vSwitch")) + pane.TitleSet(Lang("Configure Open vSwitch")) pane.AddBox() def ChangeState(self, inState): @@ -251,13 +251,13 @@ class VSwitchControllerDialogue(Dialogue): for host in hosts: Layout.Inst().TransientBanner("Updating host %d out of %d" % (self.hostsUpdated + 1, self.hostsInPool)) - session.xenapi.host.call_plugin(host, "vswitch-cfg-update", "update", {}) + session.xenapi.host.call_plugin(host, "openvswitch-cfg-update", "update", {}) self.hostsUpdated = self.hostsUpdated + 1 def _updateThisServer(self, session): data = Data.Inst() host = data.host.opaqueref() - session.xenapi.host.call_plugin(host, "vswitch-cfg-update", "update", {}) + session.xenapi.host.call_plugin(host, "openvswitch-cfg-update", "update", {}) class XSFeatureVSwitch: @@ -266,12 +266,12 @@ class XSFeatureVSwitch: def StatusUpdateHandler(cls, inPane): data = Data.Inst() - inPane.AddTitleField(Lang("vSwitch")) + inPane.AddTitleField(Lang("Open vSwitch")) inPane.NewLine() inPane.AddStatusField(Lang("Version", 20), - VSwitchService.Inst("vswitch", "ovs-vswitchd").version()) + VSwitchService.Inst("openvswitch", "ovs-vswitchd").version()) inPane.NewLine() @@ -295,11 +295,11 @@ class XSFeatureVSwitch: inPane.NewLine() inPane.AddStatusField(Lang("ovs-vswitchd status", 20), - VSwitchService.Inst("vswitch", "ovs-vswitchd").status()) + VSwitchService.Inst("openvswitch", "ovs-vswitchd").status()) inPane.AddStatusField(Lang("ovsdb-server status", 20), - VSwitchService.Inst("vswitch", "ovsdb-server").status()) + VSwitchService.Inst("openvswitch", "ovsdb-server").status()) inPane.AddStatusField(Lang("ovs-brcompatd status", 20), - VSwitchService.Inst("vswitch", "ovs-brcompatd").status()) + VSwitchService.Inst("openvswitch", "ovs-brcompatd").status()) inPane.AddKeyHelpField( { Lang("") : Lang("Reconfigure"), @@ -317,7 +317,7 @@ class XSFeatureVSwitch: { 'menuname' : 'MENU_NETWORK', 'menupriority' : 800, - 'menutext' : Lang('vSwitch') , + 'menutext' : Lang('Open vSwitch') , 'statusupdatehandler' : self.StatusUpdateHandler, 'activatehandler' : self.ActivateHandler } diff --git a/xenserver/usr_sbin_brctl b/xenserver/usr_sbin_brctl index fbaa6ad72..2035a4f62 100755 --- a/xenserver/usr_sbin_brctl +++ b/xenserver/usr_sbin_brctl @@ -22,9 +22,9 @@ import sys argv0 = sys.argv[0] -BRCTL = "/usr/lib/vswitch/xs-original/brctl" +BRCTL = "/usr/lib/openvswitch/xs-original/brctl" VSCTL = "/usr/bin/ovs-vsctl" -OVSDB_SERVER = "unix:/var/run/ovsdb-server" +OVSDB_SERVER = "unix:/var/run/openvswitch/db.sock" # Execute the real brctl program, passing the same arguments that were passed # to us. diff --git a/xenserver/usr_sbin_xen-bugtool b/xenserver/usr_sbin_xen-bugtool index 92fd27fcb..539ab028c 100755 --- a/xenserver/usr_sbin_xen-bugtool +++ b/xenserver/usr_sbin_xen-bugtool @@ -119,9 +119,10 @@ HP_CMA_LOG = '/var/spool/compaq/cma.log' HP_HPASMD_LOG = '/var/spool/compaq/hpasmd.log' VAR_LOG_DIR = '/var/log/' VNCTERM_CORE_DIR = '/var/xen/vncterm' -VSWITCH_CORE_DIR = '/var/xen/vswitch' -OVS_VSWITCH_CONF = '/etc/ovs-vswitchd.conf.db' -OVS_VSWITCH_DBCACHE = '/var/xapi/network.dbcache' +OPENVSWITCH_CORE_DIR = '/var/xen/openvswitch' +OPENVSWITCH_CONF = '/etc/openvswitch/conf.db' +OPENVSWITCH_DBCACHE = '/var/xapi/network.dbcache' +OPENVSWITCH_LOG_DIR = '/var/log/openvswitch' XENSOURCE_INVENTORY = '/etc/xensource-inventory' OEM_CONFIG_DIR = '/var/xsconfig' OEM_CONFIG_FILES_RE = re.compile(r'^.*xensource-inventory$') @@ -278,9 +279,9 @@ CAP_SYSTEM_LOGS = 'system-logs' CAP_SYSTEM_SERVICES = 'system-services' CAP_TAPDISK_LOGS = 'tapdisk-logs' CAP_VNCTERM = 'vncterm' -CAP_VSWITCH_CONFIG = 'vswitch-config' -CAP_VSWITCH_LOGS = 'vswitch-logs' -CAP_VSWITCH_STATUS = 'vswitch-status' +CAP_OPENVSWITCH_CONFIG = 'openvswitch-config' +CAP_OPENVSWITCH_LOGS = 'openvswitch-logs' +CAP_OPENVSWITCH_STATUS = 'openvswitch-status' CAP_WLB = 'wlb' CAP_X11_LOGS = 'X11' CAP_X11_AUTH = 'X11-auth' @@ -345,10 +346,10 @@ cap(CAP_SYSTEM_SERVICES, PII_NO, max_size=5*KB, max_time=20) cap(CAP_TAPDISK_LOGS, PII_NO, max_size=64*KB) cap(CAP_VNCTERM, PII_MAYBE, checked = False) -cap(CAP_VSWITCH_CONFIG, PII_YES, +cap(CAP_OPENVSWITCH_CONFIG, PII_YES, min_size=0, max_size=20*MB) -cap(CAP_VSWITCH_LOGS, PII_YES, max_size=20*MB) -cap(CAP_VSWITCH_STATUS, PII_YES, max_size=19*KB, +cap(CAP_OPENVSWITCH_LOGS, PII_YES, max_size=20*MB) +cap(CAP_OPENVSWITCH_STATUS, PII_YES, max_size=19*KB, max_time=30) cap(CAP_WLB, PII_NO, max_size=3*MB, max_time=20) @@ -497,7 +498,8 @@ def main(argv = None): CAP_NETWORK_CONFIG, CAP_NETWORK_STATUS, CAP_PROCESS_LIST, CAP_HIGH_AVAILABILITY, CAP_PAM, CAP_PERSISTENT_STATS, CAP_MULTIPATH, CAP_SYSTEM_LOGS, CAP_SYSTEM_SERVICES, CAP_TAPDISK_LOGS, - CAP_VNCTERM, CAP_VSWITCH_CONFIG, CAP_VSWITCH_LOGS, CAP_VSWITCH_STATUS, CAP_WLB, + CAP_VNCTERM, CAP_OPENVSWITCH_CONFIG, + CAP_OPENVSWITCH_LOGS, CAP_OPENVSWITCH_STATUS, CAP_WLB, CAP_X11_LOGS, CAP_X11_AUTH, CAP_XAPI_DEBUG, CAP_XAPI_SUBPROCESS, CAP_XENSERVER_CONFIG, CAP_XENSERVER_DOMAINS, CAP_XENSERVER_DATABASES, CAP_XENSERVER_INSTALL, CAP_XENSERVER_LOGS, CAP_XEN_INFO, CAP_XHA_LIVESET, CAP_YUM] @@ -710,24 +712,25 @@ exclude those logs from the archive. tree_output(CAP_VNCTERM, VNCTERM_CORE_DIR) - file_output(CAP_VSWITCH_CONFIG, [OVS_VSWITCH_CONF]) - file_output(CAP_VSWITCH_CONFIG, [OVS_VSWITCH_DBCACHE]) + file_output(CAP_OPENVSWITCH_CONFIG, [OPENVSWITCH_CONF]) + file_output(CAP_OPENVSWITCH_CONFIG, [OPENVSWITCH_DBCACHE]) - file_output(CAP_VSWITCH_LOGS, - [ VAR_LOG_DIR + x for x in - [ 'ovs-brcompatd.log', 'ovs-vswitchd.log', 'ovsdb-server.log', 'vswitch-cfg-update.log', 'vswitch-xsplugin.log' ] + + file_output(CAP_OPENVSWITCH_LOGS, + [ OPENVSWITCH_LOG_DIR + x for x in + [ 'ovs-brcompatd.log', 'ovs-vswitchd.log', 'ovsdb-server.log', + 'openvswitch-cfg-update.log', 'openvswitch-xsplugin.log' ] + [ f % n for n in range(1, 20) \ for f in ['ovs-brcompatd.log.%d', 'ovs-brcompatd.log.%d.gz', 'ovs-vswitchd.log.%d', 'ovs-vswitchd.log.%d.gz', 'ovsdb-server.log.%d', 'ovsdb-server.log.%d.gz']]]) - cmd_output(CAP_VSWITCH_STATUS, [OVS_DPCTL, 'show']) - tree_output(CAP_VSWITCH_STATUS, VSWITCH_CORE_DIR) + cmd_output(CAP_OPENVSWITCH_STATUS, [OVS_DPCTL, 'show']) + tree_output(CAP_OPENVSWITCH_STATUS, OPENVSWITCH_CORE_DIR) for d in dp_list(): - cmd_output(CAP_VSWITCH_STATUS, [OVS_OFCTL, 'show', d]) - cmd_output(CAP_VSWITCH_STATUS, [OVS_OFCTL, 'status', d]) - cmd_output(CAP_VSWITCH_STATUS, [OVS_OFCTL, 'dump-flows', d]) - cmd_output(CAP_VSWITCH_STATUS, [OVS_DPCTL, 'dump-flows', d]) + cmd_output(CAP_OPENVSWITCH_STATUS, [OVS_OFCTL, 'show', d]) + cmd_output(CAP_OPENVSWITCH_STATUS, [OVS_OFCTL, 'status', d]) + cmd_output(CAP_OPENVSWITCH_STATUS, [OVS_OFCTL, 'dump-flows', d]) + cmd_output(CAP_OPENVSWITCH_STATUS, [OVS_DPCTL, 'dump-flows', d]) cmd_output(CAP_WLB, [XE, 'pool-retrieve-wlb-diagnostics']) diff --git a/xenserver/usr_share_vswitch_scripts_refresh-network-uuids b/xenserver/usr_share_openvswitch_scripts_refresh-network-uuids similarity index 100% rename from xenserver/usr_share_vswitch_scripts_refresh-network-uuids rename to xenserver/usr_share_openvswitch_scripts_refresh-network-uuids diff --git a/xenserver/usr_share_vswitch_scripts_sysconfig.template b/xenserver/usr_share_openvswitch_scripts_sysconfig.template similarity index 92% rename from xenserver/usr_share_vswitch_scripts_sysconfig.template rename to xenserver/usr_share_openvswitch_scripts_sysconfig.template index 4d5efcab3..9bd51bc2b 100644 --- a/xenserver/usr_share_vswitch_scripts_sysconfig.template +++ b/xenserver/usr_share_openvswitch_scripts_sysconfig.template @@ -1,4 +1,4 @@ -### Configuration options for vswitch +### Configuration options for openvswitch # Copyright (C) 2009, 2010 Nicira Networks, Inc. # @@ -27,29 +27,29 @@ # COREFILE_PATTERN: Pattern used to determine path and filename for # core files when FORCE_COREFILES is 'y'. This is Linux specific. # See the manpage for "core". -# COREFILE_PATTERN="/var/log/%e-%t" +# COREFILE_PATTERN="/var/xen/openvswitch/%e-%t" # OVSDB_SERVER_REMOTES: Space-separated list of methods on which to have # ovsdb-server listen or connect for a JSON-RPC connection. -# OVSDB_SERVER_REMOTES="punix:/var/run/ovsdb-server db:Open_vSwitch,managers" +# OVSDB_SERVER_REMOTES="punix:/var/run/openvswitch/db.sock db:Open_vSwitch,managers" # OVSDB_SERVER_DB: File for which ovsdb-server uses for storage. -# OVSDB_SERVER_DB=/etc/ovs-vswitchd.conf.db +# OVSDB_SERVER_DB=/etc/openvswitch/conf.db # OVSDB_SERVER_PIDFILE: File in which to store the pid of the running # ovsdb-server. -# OVSDB_SERVER_PIDFILE=/var/run/ovsdb-server.pid +# OVSDB_SERVER_PIDFILE=/var/run/openvswitch/ovsdb-server.pid # OVSDB_SERVER_RUN_DIR: Set the directory in which ovsdb-server should be # run. This mainly affects where core files will be placed. -# OVSDB_SERVER_RUN_DIR=/var/xen/vswitch +# OVSDB_SERVER_RUN_DIR=/var/xen/openvswitch # OVSDB_SERVER_PRIORITY: "nice" priority at which to run ovsdb-server and # related processes. # OVSDB_SERVER_PRIORITY=-10 # OVSDB_SERVER_LOGFILE: File to send the FILE_LOGLEVEL log messages to. -# OVSDB_SERVER_LOGFILE=/var/log/ovsdb-server.log +# OVSDB_SERVER_LOGFILE=/var/log/openvswitch/ovsdb-server.log # OVSDB_SERVER_FILE_LOGLEVEL: Log level at which to log into the # OVSDB_SERVER_LOG file. If this is null or not set the logfile will @@ -99,19 +99,19 @@ # VSWITCHD_OVSDB_SERVER: Method to have ovs-vswitchd initiate a JSON-RPC # connection to an ovsdb-server instance. -# VSWITCHD_OVSDB_SERVER=unix:/var/run/ovsdb-server +# VSWITCHD_OVSDB_SERVER=unix:/var/run/openvswitch/db.sock # VSWITCHD_OVSDB_SCHEMA: Schema file to use for generating a new OVSDB # ovs-vswitchd database. -# VSWITCHD_OVSDB_SCHEMA=/usr/share/vswitch/vswitch.ovsschema +# VSWITCHD_OVSDB_SCHEMA=/usr/share/openvswitch/vswitch.ovsschema # VSWITCHD_PIDFILE: File in which to store the pid of the running # ovs-vswitchd. -# VSWITCHD_PIDFILE=/var/run/ovs-vswitchd.pid +# VSWITCHD_PIDFILE=/var/run/openvswitch/ovs-vswitchd.pid # VSWITCHD_RUN_DIR: Set the directory in which ovs-vswitchd should be # run. This mainly affects where core files will be placed. -# VSWITCHD_RUN_DIR=/var/xen/vswitch +# VSWITCHD_RUN_DIR=/var/xen/openvswitch # VSWITCHD_PRIORITY: "nice" priority at which to run ovs-vswitchd and related # processes. @@ -125,7 +125,7 @@ # VSWITCHD_MLOCKALL=yes # VSWITCHD_LOGFILE: File to send the FILE_LOGLEVEL log messages to. -# VSWITCHD_LOGFILE=/var/log/ovs-vswitchd.log +# VSWITCHD_LOGFILE=/var/log/openvswitch/ovs-vswitchd.log # VSWITCHD_FILE_LOGLEVEL: Log level at which to log into the # VSWITCHD_LOG file. If this is null or not set the logfile will @@ -176,18 +176,18 @@ # If this is the empty string, ovs-brcompatd will not be started and # the brcompat_mod kernel module will not be inserted. Note that # the default is to use brcompat! -# BRCOMPATD_PIDFILE=/var/run/ovs-brcompatd.pid +# BRCOMPATD_PIDFILE=/var/run/openvswitch/ovs-brcompatd.pid # BRCOMPATD_RUN_DIR: Set the directory in which ovs-brcompatd should be # run. This mainly affects where core files will be placed. -# BRCOMPATD_RUN_DIR=/var/xen/vswitch +# BRCOMPATD_RUN_DIR=/var/xen/openvswitch # BRCOMPATD_PRIORITY: "nice" priority at which to run ovs-vswitchd and related # processes. # BRCOMPATD_PRIORITY=-10 # BRCOMPATD_LOGFILE: File to send the FILE_LOGLEVEL log messages to. -# BRCOMPATD_LOGFILE=/var/log/ovs-brcompatd.log +# BRCOMPATD_LOGFILE=/var/log/openvswitch/ovs-brcompatd.log # BRCOMPATD_FILE_LOGLEVEL: Log level at which to log into the # BRCOMPATD_LOG file. If this is null or not set the logfile will -- 2.43.0