.\" -*- nroff -*- .de IQ . br . ns . IP "\\$1" .. .TH ovs\-vswitchd 8 "June 2009" "Open vSwitch" "Open vSwitch Manual" .\" This program's name: .ds PN ovs\-vswitchd .\" SSL peer program's name: .ds SN ovs\-controller . .SH NAME ovs\-vswitchd \- Open vSwitch daemon . .SH SYNOPSIS \fBovs\-vswitchd \fR[\fIdatabase\fR] . .SH DESCRIPTION A daemon that manages and controls any number of Open vSwitch switches on the local machine. .PP The \fIdatabase\fR argument specifies how \fBovs\-vswitchd\fR connects to \fBovsdb\-server\fR. The default is \fBunix:/var/run/openvswitch/db.sock\fR. The following forms are accepted: .IP "\fBssl:\fIip\fB:\fIport\fR" The specified SSL \fIport\fR on the host at the given \fIip\fR, which must be expressed as an IP address (not a DNS name). The \fB\-\-private\-key\fR, \fB\-\-certificate\fR, and \fB\-\-ca\-cert\fR options are mandatory when this form is used. . .IP "\fBtcp:\fIip\fB:\fIport\fR" Connect to the given TCP \fIport\fR on \fIip\fR. . .IP "\fBunix:\fIfile\fR" Connect to the Unix domain server socket named \fIfile\fR. .IP "\fBpssl:\fIport\fR[\fB:\fIip\fR]" Listen on the given SSL \fIport\fR for a connection. By default, \fB\*(PN\fR listens for connections to any local IP address, but specifying \fIip\fR limits connections to those from the given \fIip\fR. The \fB\-\-private\-key\fR, \fB\-\-certificate\fR, and \fB\-\-ca\-cert\fR options are mandatory when this form is used. . .IP "\fBptcp:\fIport\fR[\fB:\fIip\fR]" Listen on the given TCP \fIport\fR for a connection. By default, \fB\*(PN\fR listens for connections to any local IP address, but \fIip\fR may be specified to listen only for connections to the given \fIip\fR. . .IP "\fBpunix:\fIfile\fR" Listen on the Unix domain server socket named \fIfile\fR for a connection. .PP \fBovs\-vswitchd\fR retrieves its configuration from \fIdatabase\fR at startup. It sets up Open vSwitch datapaths and then operates switching across each bridge described in its configuration files. As the database changes, \fBovs\-vswitchd\fR automatically updates its configuration to match. .PP Upon receipt of a SIGHUP signal, \fBovs\-vswitchd\fR reopens its log file, if one was specified on the command line. .PP \fBovs\-vswitchd\fR switches may be configured with any of the following features: . .IP \(bu L2 switching with MAC learning. . .IP \(bu NIC bonding with automatic fail-over and source MAC-based TX load balancing ("SLB"). . .IP \(bu 802.1Q VLAN support. . .IP \(bu Port mirroring, with optional VLAN tagging. . .IP \(bu NetFlow v5 flow logging. . .IP \(bu sFlow(R) monitoring. . .IP \(bu Connectivity to an external OpenFlow controller, such as NOX. . .PP Only a single instance of \fBovs\-vswitchd\fR is intended to run at a time. A single \fBovs\-vswitchd\fR can manage any number of switch instances, up to the maximum number of supported Open vSwitch datapaths. .PP \fBovs\-vswitchd\fR does all the necessary management of Open vSwitch datapaths itself. Thus, external tools, such \fBovs\-dpctl\fR(8), are not needed for managing datapaths in conjunction with \fBovs\-vswitchd\fR, and their use to modify datapaths when \fBovs\-vswitchd\fR is running can interfere with its operation. (\fBovs\-dpctl\fR may still be useful for diagnostics.) .PP An Open vSwitch datapath kernel module must be loaded for \fBovs\-vswitchd\fR to be useful. Please refer to the \fBINSTALL.Linux\fR file included in the Open vSwitch distribution for instructions on how to build and load the Open vSwitch kernel module. .PP .SH OPTIONS .IP "\fB\-\-mlockall\fR" Causes \fBovs\-vswitchd\fR to call the \fBmlockall()\fR function, to attempt to lock all of its process memory into physical RAM, preventing the kernel from paging any of its memory to disk. This helps to avoid networking interruptions due to system memory pressure. .IP Some systems do not support \fBmlockall()\fR at all, and other systems only allow privileged users, such as the superuser, to use it. \fBovs\-vswitchd\fR emits a log message if \fBmlockall()\fR is unavailable or unsuccessful. . .ds DD \ \fBovs\-vswitchd\fR detaches only after it has connected to the \ database, retrieved the initial configuration, and set up that \ configuration. .TP \fB\-\-pidfile\fR[\fB=\fIpidfile\fR] Causes a file (by default, \fB\*(PN.pid\fR) to be created indicating the PID of the running process. If the \fIpidfile\fR argument is not specified, or if it does not begin with \fB/\fR, then it is created in \fB/var/run/openvswitch\fR. .IP If \fB\-\-pidfile\fR is not specified, no pidfile is created. . .TP \fB\-\-overwrite\-pidfile\fR By default, when \fB\-\-pidfile\fR is specified and the specified pidfile already exists and is locked by a running process, \fB\*(PN\fR refuses to start. Specify \fB\-\-overwrite\-pidfile\fR to cause it to instead overwrite the pidfile. .IP When \fB\-\-pidfile\fR is not specified, this option has no effect. . .TP \fB\-\-detach\fR Causes \fB\*(PN\fR to detach itself from the foreground session and run as a background process. \*(DD . .TP \fB\-\-monitor\fR Creates an additional process to monitor the \fB\*(PN\fR daemon. If the daemon dies due to a signal that indicates a programming error (e.g. \fBSIGSEGV\fR, \fBSIGABRT\fR), then the monitor process starts a new copy of it. If the daemon die or exits for another reason, the monitor process exits. .IP This option is normally used with \fB\-\-detach\fR, but it also functions without it. . .TP \fB\-\-no\-chdir\fR By default, when \fB\-\-detach\fR is specified, \fB\*(PN\fR changes its current working directory to the root directory after it detaches. Otherwise, invoking \fB\*(PN\fR from a carelessly chosen directory would prevent the administrator from unmounting the file system that holds that directory. .IP Specifying \fB\-\-no\-chdir\fR suppresses this behavior, preventing \fB\*(PN\fR from changing its current working directory. This may be useful for collecting core files, since it is common behavior to write core dumps into the current working directory and the root directory is not a good directory to use. .IP This option has no effect when \fB\-\-detach\fR is not specified. .SS "Public Key Infrastructure Options" .de IQ . br . ns . IP "\\$1" .. .IP "\fB\-p\fR \fIprivkey.pem\fR" .IQ "\fB\-\-private\-key=\fIprivkey.pem\fR" Specifies a PEM file containing the private key used as \fB\*(PN\fR's identity for outgoing SSL connections. . .IP "\fB\-c\fR \fIcert.pem\fR" .IQ "\fB\-\-certificate=\fIcert.pem\fR" Specifies a PEM file containing a certificate that certifies the private key specified on \fB\-p\fR or \fB\-\-private\-key\fR to be trustworthy. The certificate must be signed by the certificate authority (CA) that the peer in SSL connections will use to verify it. . .IP "\fB\-C\fR \fIcacert.pem\fR" .IQ "\fB\-\-ca\-cert=\fIcacert.pem\fR" Specifies a PEM file containing the CA certificate that \fB\*(PN\fR should use to verify certificates presented to it by SSL peers. (This may be the same certificate that SSL peers use to verify the certificate specified on \fB\-c\fR or \fB\-\-certificate\fR, or it may be a different one, depending on the PKI design in use.) . .IP "\fB\-C none\fR" .IQ "\fB\-\-ca\-cert=none\fR" Disables verification of certificates presented by SSL peers. This introduces a security risk, because it means that certificates cannot be verified to be those of known trusted hosts. .IP "\fB\-\-bootstrap\-ca\-cert=\fIcacert.pem\fR" When \fIcacert.pem\fR exists, this option has the same effect as \fB\-C\fR or \fB\-\-ca\-cert\fR. If it does not exist, then \fB\*(PN\fR will attempt to obtain the CA certificate from the SSL peer on its first SSL connection and save it to the named PEM file. If it is successful, it will immediately drop the connection and reconnect, and from then on all SSL connections must be authenticated by a certificate signed by the CA certificate thus obtained. .IP \fBThis option exposes the SSL connection to a man-in-the-middle attack obtaining the initial CA certificate\fR, but it may be useful for bootstrapping. .IP This option is only useful if the SSL peer sends its CA certificate as part of the SSL certificate chain. The SSL protocol does not require the server to send the CA certificate, but \fB\*(SN\fR(8) can be configured to do so with the \fB\-\-peer\-ca\-cert\fR option. .IP This option is mutually exclusive with \fB\-C\fR and \fB\-\-ca\-cert\fR. .TP \fB\-v\fImodule\fR[\fB:\fIfacility\fR[\fB:\fIlevel\fR]], \fB\-\-verbose=\fImodule\fR[\fB:\fIfacility\fR[\fB:\fIlevel\fR]] . Sets the logging level for \fImodule\fR in \fIfacility\fR to \fIlevel\fR: . .RS .IP \(bu \fImodule\fR may be any valid module name (as displayed by the \fB\-\-list\fR action on \fBovs\-appctl\fR(8)), or the special name \fBANY\fR to set the logging levels for all modules. . .IP \(bu \fIfacility\fR may be \fBsyslog\fR, \fBconsole\fR, or \fBfile\fR to set the levels for logging to the system log, the console, or a file respectively, or \fBANY\fR to set the logging levels for both facilities. If it is omitted, \fIfacility\fR defaults to \fBANY\fR. .IP Regardless of the log levels set for \fBfile\fR, logging to a file will not take place unless \fB\-\-log\-file\fR is also specified (see below). . .IP \(bu \fIlevel\fR must be one of \fBoff\fR, \fBemer\fR, \fBerr\fR, \fBwarn\fR, \fBinfo\fR, or \fBdbg\fR, designating the minimum severity of a message for it to be logged. If it is omitted, \fIlevel\fR defaults to \fBdbg\fR. See \fBovs\-appctl\fR(8) for a definition of each log level. .RE . .TP \fB\-v\fR, \fB\-\-verbose\fR Sets the maximum logging verbosity level, equivalent to \fB\-\-verbose=ANY:ANY:dbg\fR. . .TP \fB\-vPATTERN:\fIfacility\fB:\fIpattern\fR, \fB\-\-verbose=PATTERN:\fIfacility\fB:\fIpattern\fR Sets the log pattern for \fIfacility\fR to \fIpattern\fR. Refer to \fBovs\-appctl\fR(8) for a description of the valid syntax for \fIpattern\fR. . .TP \fB\-\-log\-file\fR[\fB=\fIfile\fR] Enables logging to a file. If \fIfile\fR is specified, then it is used as the exact name for the log file. The default log file name used if \fIfile\fR is omitted is \fB/var/log/openvswitch/\*(PN.log\fR. .TP \fB\-h\fR, \fB\-\-help\fR Prints a brief help message to the console. . .TP \fB\-V\fR, \fB\-\-version\fR Prints version information to the console. .TP \fB\-\-check\-leaks=\fIfile\fR . Logs information about memory allocation and deallocation to \fIfile\fR, to allow for debugging memory leaks in \fB\*(PN\fR. This option slows down \fB\*(PN\fR considerably, so it should only be used when a memory leak is suspected. Use the \fBovs\-parse\-leaks\fR script to interpret the leak file. .TP \fB\-\-leak\-limit=\fIsize\fR . Limits size of the leak file as specified by \fB\-\-check\-leaks\fR to \fIsize\fR bytes. Finding leaks sometimes requires allowing the leak file to grow very large, up to 1GB. By default, files are limited to 10MB. . .SH "RUNTIME MANAGEMENT COMMANDS" \fBovs\-appctl\fR(8) can send commands to a running \fBovs\-vswitchd\fR process. The currently supported commands are described below. The command descriptions assume an understanding of how to configure Open vSwitch. .SS "GENERAL COMMANDS" .IP "\fBexit\fR" Causes \fBovs\-vswitchd\fR to gracefully terminate. .IP "\fBcoverage/log\fR" Logs coverage counters at level warn. .IP "\fBqos/show\fR \fIinterface\fR" Queries the kernel for Quality of Service configuration and statistics associated with the given \fIinterface\fR. .IP "\fBcfm/show\fR [\fIinterface\fR]" Displays detailed information about Connectivity Fault Management configured on \fIinterface\fR. If \fIinterface\fR is not specified, then displays detailed information about all interfaces with CFM enabled. .SS "BRIDGE COMMANDS" These commands manage bridges. .IP "\fBfdb/flush\fR [\fIbridge\fR]" Flushes \fIbridge\fR MAC address learning table, or all learning tables if no \fIbridge\fR is given. .IP "\fBfdb/show\fR \fIbridge\fR" Lists each MAC address/VLAN pair learned by the specified \fIbridge\fR, along with the port on which it was learned and the age of the entry, in seconds. .IP "\fBbridge/reconnect\fR [\fIbridge\fR]" Makes \fIbridge\fR drop all of its OpenFlow controller connections and reconnect. If \fIbridge\fR is not specified, then all bridges drop their controller connections and reconnect. .IP This command might be useful for debugging OpenFlow controller issues. . .IP "\fBbridge/dump\-flows\fR \fIbridge\fR" Lists all flows in \fIbridge\fR, including those normally hidden to commands such as \fBovs\-ofctl dump\-flows\fR. Flows set up by mechanisms such as in-band control and fail-open are hidden from the controller since it is not allowed to modify or override them. .SS "BOND COMMANDS" These commands manage bonded ports on an Open vSwitch's bridges. To understand some of these commands, it is important to understand a detail of the bonding implementation called ``source load balancing'' (SLB). Instead of directly assigning Ethernet source addresses to slaves, the bonding implementation computes a function that maps an 48-bit Ethernet source addresses into an 8-bit value (a ``MAC hash'' value). All of the Ethernet addresses that map to a single 8-bit value are then assigned to a single slave. .IP "\fBbond/list\fR" Lists all of the bonds, and their slaves, on each bridge. . .IP "\fBbond/show\fR \fIport\fR" Lists all of the bond-specific information about the given bonded \fIport\fR: updelay, downdelay, time until the next rebalance. Also lists information about each slave: whether it is enabled or disabled, the time to completion of an updelay or downdelay if one is in progress, whether it is the active slave, the MAC hashes assigned to the slave, and the MAC learning table entries that hash to each MAC. Any LACP information related to this bond may be found using the \fBlacp/show\fR command. .IP "\fBbond/migrate\fR \fIport\fR \fIhash\fR \fIslave\fR" Only valid for SLB bonds. Assigns a given MAC hash to a new slave. \fIport\fR specifies the bond port, \fIhash\fR the MAC hash to be migrated (as a decimal number between 0 and 255), and \fIslave\fR the new slave to be assigned. .IP The reassignment is not permanent: rebalancing or fail-over will cause the MAC hash to be shifted to a new slave in the usual manner. .IP A MAC hash cannot be migrated to a disabled slave. .IP "\fBbond/set\-active\-slave\fR \fIport\fR \fIslave\fR" Sets \fIslave\fR as the active slave on \fIport\fR. \fIslave\fR must currently be enabled. .IP The setting is not permanent: a new active slave will be selected if \fIslave\fR becomes disabled. .IP "\fBbond/enable\-slave\fR \fIport\fR \fIslave\fR" .IQ "\fBbond/disable\-slave\fR \fIport\fR \fIslave\fR" Enables (or disables) \fIslave\fR on the given bond \fIport\fR, skipping any updelay (or downdelay). .IP This setting is not permanent: it persists only until the carrier status of \fIslave\fR changes. .IP "\fBbond/hash\fR \fImac\fR [\fIvlan\fR] [\fIbasis\fR]" Returns the hash value which would be used for \fImac\fR with \fIvlan\fR and \fIbasis\fR if specified. . .IP "\fBlacp/show\fR [\fIport\fR]" Lists all of the LACP related information about the given \fIport\fR: active or passive, aggregation key, system id, and system priority. Also lists information about each slave: whether it is enabled or disabled, whether it is attached or detached, port id and priority, actor information, and partner information. If \fIport\fR is not specified, then displays detailed information about all interfaces with CFM enabled. . .SS "OFPROTO COMMANDS" These commands manage the core OpenFlow switch implementation (called \fBofproto\fR). . .IP "\fBofproto/list\fR" Lists the names of the running ofproto instances. These are the names that may be used on \fBofproto/trace\fR. . .IP "\fBofproto/trace \fIswitch priority tun_id in_port packet\fR" .IQ "\fBofproto/trace \fIswitch odp_flow \fB\-generate\fR" Traces the path of an imaginary packet through \fIswitch\fR. Both forms require \fIswitch\fR, the switch on which the packet arrived (one of those listed by \fBofproto/list\fR). The first form specifies a packet's contents explicitly: .RS .IP "\fIpriority\fR" Packet QoS priority. Use \fB0\fR if QoS is not setup. .IP "\fItun_id\fR" The tunnel ID on which the packet arrived. Use \fB0\fR if the packet did not arrive through a tunnel. .IP "\fIin_port\fR" The OpenFlow port on which the packet arrived. Use \fB65534\fR if the packet arrived on \fBOFPP_LOCAL\fR, the local port. .IP "\fIpacket\fR" A sequence of hex digits specifying the packet's contents. An Ethernet frame is at least 14 bytes long, so there must be at least 28 hex digits. Obviously, it is inconvenient to type in the hex digits by hand, so the \fBovs\-pcap\fR(1) and \fBovs\-tcpundump\fR(1) utilities provide easier ways. .RE .IP The second form specifies the packet's contents implicitly: .RS .IP "\fIodp_flow\fR" A flow in the form printed by \fBovs\-dpctl\fR(8)'s \fBdump\-flows\fR command. This is not an OpenFlow flow: besides other differences, it never contains wildcards. \fB\*(PN\fR generates an arbitrary packet that has the specified \fIodp_flow\fR. .RE .IP \fB\*(PN\fR will respond with extensive information on how the packet would be handled if it were to be received. The packet will not actually be sent, but side effects such as MAC learning will occur. . .IP "\fBofproto/trace \fIswitch odp_flow\fR" Traces the path of a packet in an imaginary flow through \fIswitch\fR. The arguments are: .RS .IP "\fIswitch\fR" The switch on which the packet arrived (one of those listed by \fBofproto/list\fR). .IP "\fIodp_flow\fR" A flow in the form printed by \fBovs\-dpctl\fR(8)'s \fBdump\-flows\fR command. This is not an OpenFlow flow: besides other differences, it never contains wildcards. .RE .IP \fB\*(PN\fR will respond with extensive information on how a packet in \fIodp_flow\fR would be handled if it were received by \fIswitch\fR. No packet will actually be sent. Some side effects may occur, but MAC learning in particular will not. .IP This form of \fBofproto/trace\fR cannot determine the complete set of datapath actions in some corner cases. If the results say that this is the case, rerun \fBofproto/trace\fR supplying a packet in the flow to get complete results. .SS "VLOG COMMANDS" These commands manage \fB\*(PN\fR's logging settings. .IP "\fBvlog/set\fR \fImodule\fR[\fB:\fIfacility\fR[\fB:\fIlevel\fR]]" Sets the logging level for \fImodule\fR in \fIfacility\fR to \fIlevel\fR: . .RS .IP \(bu \fImodule\fR may be any valid module name (as displayed by the \fB\-\-list\fR action on \fBovs\-appctl\fR(8)), or the special name \fBANY\fR to set the logging levels for all modules. . .IP \(bu \fIfacility\fR may be \fBsyslog\fR, \fBconsole\fR, or \fBfile\fR to set the levels for logging to the system log, the console, or a file respectively, or \fBANY\fR to set the logging levels for both facilities. If it is omitted, \fIfacility\fR defaults to \fBANY\fR. .IP The log level for the \fBfile\fR facility has no effect unless \fB\*(PN\fR was invoked with the \fB\-\-log\-file\fR option. .IP \(bu \fIlevel\fR must be one of \fBoff\fR, \fBemer\fR, \fBerr\fR, \fBwarn\fR, \fBinfo\fR, or \fBdbg\fR, designating the minimum severity of a message for it to be logged. If it is omitted, \fIlevel\fR defaults to \fBdbg\fR. .RE .IP "\fBvlog/set PATTERN:\fIfacility\fB:\fIpattern\fR" Sets the log pattern for \fIfacility\fR to \fIpattern\fR. Refer to \fBovs\-appctl\fR(8) for a description of the valid syntax for \fIpattern\fR. . .IP "\fBvlog/list\fR" Lists the supported logging modules and their current levels. . .IP "\fBvlog/reopen\fR" Causes \fB\*(PN\fR to close and reopen its log file. (This is useful after rotating log files, to cause a new log file to be used.) .IP This has no effect unless \fB\*(PN\fR was invoked with the \fB\-\-log\-file\fR option. .SS "STRESS OPTION COMMANDS" These command manage stress options, which allow developers testing Open vSwitch to trigger behavior that otherwise would occur only in corner cases. Developers and testers can thereby more easily discover bugs that would otherwise manifest only rarely or nondeterministically. Stress options may cause surprising behavior even when they do not actually reveal bugs, so they should only be enabled as part of testing Open vSwitch. . .IP "\fBstress/enable\fR" .IQ "\fBstress/disable\fR" All stress options are disabled by default. Use \fBstress/enable\fR to enable stress options and \fBstress/disable\fR to disable them. . .IP "\fBstress/list\fR" Lists and describes the available stress options and their settings in tabular form. The columns in the table are: .RS .IP "NAME" A single-word identifier for the option, used to identify stress options to \fBstress/set\fR. . .IP "DESCRIPTION" A description for a person unfamiliar with the detailed internals of the code what behavior the option affects. . .IP "PERIOD" Currently configured trigger period. If the stress option is disabled, this is \fBdisabled\fR. Otherwise this is a number giving the number of occurrences of the event between activations of the stress option triggers. . .IP "MODE" If the stress option is disabled, this is \fBn/a\fR. Otherwise it is \fBperiodic\fR if the stress option triggers after exactly the period, or \fBrandom\fR if it triggers randomly but on average after the number of occurrences specified by the period. . .IP "COUNTER" If the stress option is disabled, this is \fBn/a\fR. Otherwise it is the number of occurrences of the event before the next time the stress option triggers. . .IP "HITS" The number of times that this stress option has triggered since this program started. . .IP "RECOMMENDED" A suggested period for a person unfamiliar with the internals. It should put reasonable stress on the system without crippling it. . .IP "MINIMUM" .IQ "MAXIMUM" Minimum and maximum values allowed for the period. . .IP "DEFAULT" The default period, used when stress options have been enabled (with \fBstress/enable\fR) but this particular stress option has not been specifically configured (with \fBstress/set\fR). It is \fBdisabled\fR if the option is disabled by default. It is nonzero for options that can be left on at low levels without noticeable impact to the end user. .RE . .IP "\fBstress/set \fIoption\fR \fIperiod\fR [\fBrandom\fR|\fBperiodic\fR]" Sets the period at which stress \fIoption\fR triggers to \fIperiod\fR. A \fIperiod\fR of 0 disables \fIoption\fR. Specify \fBrandom\fR to make the option trigger randomly with an average period of \fIperiod\fR, or \fBperiodic\fR to trigger exactly every \fIperiod\fR events; the latter is the default. .IP If stress options have not been enabled with \fBstress/enable\fR, this command has no effect. .SH "SEE ALSO" .BR ovs\-appctl (8), .BR ovs\-brcompatd (8), .BR ovsdb\-server (1), \fBINSTALL.Linux\fR in the Open vSwitch distribution.