aboutsummaryrefslogtreecommitdiff
path: root/xenserver/etc_init.d_openvswitch
AgeCommit message (Collapse)Author
2012-02-29xenserver: Restart ovs-xapi-sync on kmod reload.Ethan Jackson
Some users never restart OVS, they just reload the kernel module on each new version. Since ovs-xapi-sync is a daemon, a restart is required to use the new code. Therefore, without this patch, users could unwittingly use stale versions of ovs-xapi-sync. Bug #9919. Signed-off-by: Ethan Jackson <ethan@nicira.com> Diagnosed-by: Ben Pfaff <blp@nicira.com>
2011-12-09utilites: rename ovs-lib.sh to ovs-libChris Wright
Rename this helper script to simply ovs-lib, since it's primarily a library of helper functions. Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-10-05xenserver: ovs-xapi-sync should create a log file.Ethan Jackson
2011-06-29xenserver: Restart HA daemon after force-reload-kmod.Ben Pfaff
Otherwise its heartbeats start failing after the reload and the XenServer reboots after a minute or so. Thanks to Justin Pettit for figuring out that this was HA-related. Bug #5706. Reported-by: Henrik Amren <henrik@nicira.com>
2011-06-21Avoid inserting duplicate iptables rules when restarting vswitch.Ben Pfaff
On startup, some OVS initscripts insert an iptables rule to allow GRE traffic (because GRE support is an important OVS feature). I noticed that, each time I restarted OVS, this added another GRE-related rule to the iptables chain. This is wasteful, because each additional rule increases the time it takes to process a packet in the IP stack. This commit avoids the problem by inserting an iptables rule when there isn't already an appropriate rule. It also avoids inserting an iptables rule if the iptables policy is ACCEPT, meaning that packets are accepted by default; in such a case, if the GRE packet would be dropped, it is because the system administrator made that decision explicitly. Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-06-20Fix force-reload-kmod initscript command implementations.Ben Pfaff
I screwed this up in the recent conversion. Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-06-17Fix typo in "--force-corefiles" and "force-reload-kmod".Ben Pfaff
Reported-by: Andrew Evans <aevans@nicira.com>
2011-06-17Refactor initscripts into distro-independent and distro-specific pieces.Ben Pfaff
This should make it easier to add OVS support to new distributions.
2011-06-16xenserver: Don't delete pidfile in stop_daemon.Ben Pfaff
Deleting the pidfile introduces a minor race: if some other process is starting a daemon at the same time that the init script is stopping the same daemon, then this could delete the new daemon's pidfile. This is really a theoretical risk, because no one should be starting and stopping a single daemon at the same time.
2011-06-16xenserver: Don't require confirmation to restart vswitch.Ben Pfaff
Early development versions of ovs-vswitchd didn't always restart successfully, so we required confirmation if "restart" was invoked interactively. Recent versions do just fine, so drop the confirmation prompt. Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-06-16xenserver: Use $OVS_XAPI_SYNC_PIDFILE consistently.Ben Pfaff
This variable was used in some places but not in others. Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-03-29xenserver: Wait for ovs-xapi-sync to exit in "stop" command.Ben Pfaff
It seems possible that "restart" or a quick application of "stop" then "start" could kill ovs-xapi-sync without starting it again, if ovs-xapi-sync takes a little while to die, long enough for the next instance of it to see that its pidfile is still open and locked. I hope that this fixes some odd races that we've noticed in the "restart" command. Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-03-10ovsdb: Implement garbage collection.Ben Pfaff
2011-02-18ovsdb: Remove 'managers' column from 'Open vSwitch' table.Andrew Evans
We had retained but deprecated the use of the older 'managers' column in the 'Open vSwitch' table for compatibility with applications that might still use it, but that created more problems than it solved. This commit removes the 'managers' column from the schema, and removes all references to it from the code, init scripts, documentation, and tests.
2011-02-15Avoid unneeded database compaction at startup, and improve backups.Ben Pfaff
Until now, Open vSwitch "start" has always converted the database to the current database schema. This compacts the database, which as a side effect throws away useful information about the transactions that were executed to bring the database into its current state. This can make debugging database-related problems more difficult. This commit changes the "start" command to only convert the database if the database schema has changed. It also adds the database checksum to the backup file name, to avoid overwriting backups in the case where the checksum changed but the developer neglected to update the version number. I tested an earlier version of the xenserver changes but not any version of the Debian changes.
2011-02-11xenserver: Rename ovs-external-ids to ovs-xapi-sync.Justin Pettit
With commit 5692e3 (xenserver: Set fail_mode on internal bridges.), the responsibilities of ovs-external-ids got expanded beyond just monitoring external-ids. This commit renames the script to more accurately describe its job. Signed-off-by: Justin Pettit <jpettit@nicira.com>
2011-02-11xenserver: Remove support for XenServer versions older than 5.6 FP1.Justin Pettit
Commit 404c169247b1c3ac2ebad887f0421478a6cef924 breaks compatibility with XenServers older than 5.6 FP1. This commit removes the last vestiges of support for those older XenServer versions. Signed-off-by: Justin Pettit <jpettit@nicira.com>
2011-02-08xenserver: Introduce "force-reload-kmod" to reload kernel module.Ben Pfaff
Running "service openvswitch force-reload-kmod" will now save the kernel configuration state of Open vSwitch interfaces, stop the vswitch, unload the kernel module, reload the kernel module, restart the vswitch, and restore kernel configuration state. It is a reasonably safe way to upgrade or downgrade the Open vSwitch kernel module on a running system. Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-02-07xenserver: Consistently use spaces instead of tabs in init script.Justin Pettit
2011-02-02xenserver: Make ovsdb-server look for remotes in manager_options column.Andrew Evans
(ovsdb-server will still use any managers found in the managers column as well.)
2011-01-27xenserver: Use "ovs-dpctl dump-dps" instead of parsing "ovs-dpctl show".Ben Pfaff
Might as well use the dump-dps command as intended. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-10xenserver: Remove "Required-" parameters from "openvswitch" init script.Justin Pettit
Commit 72dfb3b (xenserver: Add LSB init info to scripts.) added LSB init info to the XenServer scripts. This was verified to work on XenServer 5.5, but newer versions of XenServer interpret these values and alter when "openvswitch" gets called. This causes XenServer to not come up with its networking configuration properly. By removing the "Required-" parameters, OVS will properly come up. This is just a temporary fix, and a more proper one will be forthcoming.
2011-01-07xenserver: Remove Linux bridge on startup if no bridges exist.Patrick Mullaney
Otherwise, if the bridge module is loaded but no bridges exist, on all but the most recent Linux kernels this prevents the Open vSwitch kernel module from loading. Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-01-07xenserver: Add defaults for ENABLE_BRCOMPAT, ENABLE_FAKE_PROC_NET.Patrick Mullaney
On non-XenServer systems there is no $PRODUCT_VERSION to test for default behavior, so use reasonable defaults in that case. Signed-off-by: Patrick Mullaney <pm.mullaney@gmail.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-01-07xenserver: Don't require /etc/xensource/network.conf if not on XenServer.Patrick Mullaney
On XenServer systems, the "network mode" (that is, whether the network uses OpenvSwitch or the Linux bridge) is stored in /etc/xensource/network.conf. On other systems, we can't expect it to be there. This changes the init script to tolerate its absence, treating that as meaning that Open vSwitch should be used (otherwise, why did the admin install it?). NETWORK_MODE can always be overridden in /etc/sysconfig/openvswitch anyway. Signed-off-by: Patrick Mullaney <pm.mullaney@gmail.com> [changed back to read /etc/xensource/network.conf if present] Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-01-07xenserver: Only start ovs-external-ids on XenServer.Patrick Mullaney
ovs-external-ids's job is to synchronize UUIDs between XAPI and OVSDB. Non-XenServer systems don't have XAPI so they don't need ovs-external-ids. Signed-off-by: Patrick Mullaney <pm.mullaney@gmail.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-01-07xenserver: Generate system UUID for non-XenServer systems.Ben Pfaff
Currently the scripts in xensever/ are intended specifically for XenServer, but supporting other distros seems like a worthy goal, so this is a step in the right direction. It would be good to be able to determine a suitable system-type and system-version, but those are less important than system-id. Signed-off-by: Patrick Mullaney <pm.mullaney@gmail.com> [changed not to set xs-system-uuid on non-XenServer systems] [whitespace changes] [changed to handle missing uuidgen, suggested by Justin Pettit] Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-01-07xenserver: Be compatible with non-XenServer func libraries in init script.Ben Pfaff
XenServer has its function library in /etc/init.d/functions but other distros have it in different places. Currently this init script is specifically intended for XenServer but adding compatibility with other distros seems like a worthwhile goal. Also, SuSE does not have the "action" function, so test whether it is implemented and when not supply a fallback. Signed-off-by: Patrick Mullaney <pm.mullaney@gmail.com> [changed to only define action() if not already defined] Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-01-07xenserver: Add LSB init info to scripts.Ben Pfaff
XenServer itself does not use this information as part of startup, but other distributions that may wish to derive their startup scripts from these may need it. Signed-off-by: Patrick Mullaney <pm.mullaney@gmail.com> [updated some info in xenserver/etc_init.d_openvswitch-xapi-update] [used Debian LSB info for xenserver/etc_init.d/openvswitch] Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-12-27Implement database schema versioning.Ben Pfaff
As the database schema evolves, it might be useful to have an identifier for the particular version in use. This commit adds that feature.
2010-12-27vswitchd: Add OVS version to database, give system info its own columns.Ben Pfaff
Until now, nothing in the database has reported the Open vSwitch version number. This commit adds that. In addition, this commits moves the system type and version from external-ids to individual columns, because we decided that these were important enough not to relegate them to a grab-bag field.
2010-09-22xenserver: monitor-external-ids should run with --monitorEthan Jackson
The init script starts monitor-external-ids with --monitor when configured to do so. Also made changes to guarantee that --monitor actually restarts ovs-external-ids. Signed-off-by: Ethan Jackson <ethan@nicira.com>
2010-09-22xenserver: Rename monitor-external-ids -> ovs-external-idsEthan Jackson
Renamed the monitor-external-ids script ovs-external-ids. Hopefully this will make it clearer who owns it when someone does ps xa. Also removed trailing whitespace from ovs-external-ids. Signed-off-by: Ethan Jackson <ethan@nicira.com>
2010-09-21xenserver: reload sends SIGHUP to monitor-external-idsEthan Jackson
When the init script's reload function is called it will send a SIGHUP to monitor-external-ids. This will cause monitor-external-ids to re-generate everything. Feature #3668.
2010-09-17ovs-vsctl: Remove default timeout.Ben Pfaff
On overloaded XenServers the current default timeout of 5 seconds can occasionally be reached, which causes VM startup to fail. This commit fixes the problem by removing the default timeout and changing each invocation of ovs-vsctl within the tree to specify its own timeout, if appropriate. Bug #3573.
2010-09-10xenserver: Don't delete pidfile when stopping monitor-external-idsJustin Pettit
It's not necessary to explicitly delete the pidfile when stopping monitor-external-ids through the init script, since the daemon will take care of that.
2010-08-26xenserver: Finish renaming system-level external_ids.Ben Pfaff
vswitch.xml was updated to describe system-id and xs-system-uuid but the implementation of this update was incomplete. CC: Justin Pettit <jpettit@nicira.com> CC: Jeremy Stribling <strib@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-08-25xenserver: Add monitor-external-ids daemonJustin Pettit
The monitor-external-ids daemon monitors the external_ids columns of the Bridge and Interface OVSDB tables. Its primary responsibility is to set the "bridge-id" and "iface-id" keys in the Bridge and Interface tables, respectively. It also looks for the use of "network-uuids" in the Bridge table and duplicates its value to the preferred "xs-network-uuids". Signed-off-by: Justin Pettit <jpettit@nicira.com>
2010-08-25xenserver: Report the system type and version as external idsJustin Pettit
The configuration schema defines the system-type and system-version external-ids for the Open_vSwitch table. This commit adds support for reporting them on XenServer. Signed-off-by: Justin Pettit <jpettit@nicira.com>
2010-08-12Wait for daemons to die in init.d script "stop" commands.Ben Pfaff
Sometimes it takes a moment for the OVS daemons to die. When that happens, the "start" half of "openvswitch restart" can fail when ovsdb-tool runs, because ovsdb-server will still have the lock on the database if it has not exited yet. So this commit just makes the "stop" half wait for the daemons to really die. Bug #3369.
2010-08-02xenserver: Add "reload" and "force-reload" support to init script.Ben Pfaff
I can't easily find anything that documents what commands Fedora init scripts should support, but many of them support "reload" and "force-reload". This commit adds support for them to the XenServer init scripts. (The Debian init scripts already had support.) Debian does document that reload and force-reload should be supported: http://www.debian.org/doc/debian-policy/ch-opersys.html#s-writing-init Reported-by: Reid Price <reid@nicira.com> Bug #3266.
2010-06-09xenserver: Remove some ovs-xenserverd support that I missed.Ben Pfaff
Oops. Must have been too giddy to look carefully the first time. This time I'll test it before I push.
2010-06-08xenserver: Don't complain for "bridge" network.conf valueJustin Pettit
Just silently don't start OVS daemons if /etc/xensource/network.conf contains a value of "bridge". This allows the init script to be called regardless of whether OVS or bridge is configured.
2010-06-08xenserver: Don't start OVS if network.conf isn't "openvswitch"Justin Pettit
The OVS processes would start as long as "/etc/xensource/network.conf" didn't contain "bridge". The other OVS scripts, however, would complain (and not run) if it wasn't "vswitch" or "openvswitch". This commit will only start the OVS processes if a value of "vswitch" or "openvswitch" is present, so some consistency is provided. (If "/etc/xensource/network.conf" is not "bridge", "vswitch", or "openvswitch", then XAPI will refuse to run anyway, so not much is going to happen on the system.)
2010-06-03xenserver: make ovs-xenserverd startup configurable and disable it for 5.6.0 ↵Ian Campbell
onwards. In my testing with XenServer 5.6.810 without ovs-xenserverd the vswitch bridge external-id network-uuid field was always kept up to date over both pool join and pool eject. I believe this is because xapi is restarted on both pool join and pool eject and on restart all PIFs are plugged again. This causes the vswitch field to be updated, either via a call to interface reconfigure or via an explicit ovs-vsctl call in the case of internal networks. I think the only reason this daemon would still be required with XenServer 5.5 is that the explicit call to ovs-vsctl for internl networks is not present there. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-05-18patch: Remove veth driver.Jesse Gross
Now that we have a new patch implementation, remove the veth driver and its userspace components. Then rename 'patchnew' to 'patch'. The new implementation is a drop-in replacement for the old one.
2010-05-04xenserver: Make Open vSwitch disable itself in "bridge" mode.Ben Pfaff
When /etc/xensource/network.conf contains the word "bridge", the system is supposed to use the Linux bridge, not Open vSwitch. This commit makes OVS honor this setting, which until now it has mainly ignored. Reported-by: Reid Price <reid@nicira.com>
2010-04-27xenserver: Use start_daemon for xenserverd also in /etc/init.d/openvswitch.Ben Pfaff
Reported-by: Justin Pettit <jpettit@nicira.com>
2010-04-27xenserver: Report correct daemon names at startup in /etc/init.d/openvswitch.Ben Pfaff
Reported-by: Justin Pettit <jpettit@nicira.com>
2010-04-27xenserver: Use daemon-specific dir for pidfile in /etc/init.d/openvswitch.Ben Pfaff
Reported-by: Justin Pettit <jpettit@nicira.com>