make openvswitch compatible with oVirt (tight with brctl)

简介:
在openvswitch网站的首页, 指出openvswitch已经整合到了oVirt管理软件, 但是实际使用oVirt时, 发现并没有这样, (我用的是oVirt 3.4.3).
It has also been integrated into many virtual management systems including OpenStack, openQRM, OpenNebula and oVirt. 

额外在管理机和HOST节点安装openvswitch, 并且将ovirtmgmt网桥改成openvswitch管理后, oVirt管理平台里面, HOST节点的EVENT显示ovirtmgmt没有绑定到任何接口,
Network ovirtmgmt is not attached to any interface on host 150.

说明oVirt还在使用brctl来查看接口信息. 使用brctl查看, 确实如此.
[root@150 openvswitch-1.9.3]# brctl show
bridge name     bridge id               STP enabled     interfaces
ovirtmgmt               /sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
0000.00221960778f       no


openvswitch的 INSTALL.bridge 安装说明文件指出, 可以将openvswitch安装为替换brctl的模式, 但是不建议这么做, 仅仅当应用程序和brctl绑定使用时才需要这么做, 详细的内容如下 :
[root@150 openvswitch-1.9.3]# cat INSTALL.bridge 
              Replacing a Linux Bridge with Open vSwitch
              ==========================================

This file documents how Open vSwitch may be used as a drop-in
replacement for a Linux kernel bridge in an environment that includes
elements that are tightly tied to the Linux bridge tools
(e.g. "brctl") and architecture.  We recommend directly using the
management tools provided with Open vSwitch rather than these
compatibility hooks for environments that are not tightly tied to the
Linux bridging tools; they are more efficient and better reflect the
actual operation and status.

Installation Procedure
----------------------

The procedure below explains how to use the Open vSwitch bridge
compatibility support.  This procedure is written from the perspective
of a system administrator manually loading and starting Open vSwitch
in bridge compatibility mode, but of course in practice one would want
to update system scripts to follow these steps.  If you do edit your
system configuration files to start Open vSwitch at boot time, make
sure that it starts up before any bridge configuration (e.g. before
any calls to "brctl" or "ifup" of any bridge interfaces), to ensure
that the Open vSwitch kernel modules are loaded before the Linux
kernel bridge module.

1. Build, install, and start up the Open vSwitch kernel modules and
   userspace programs as described in INSTALL.

   It is important to run "make install", because some Open vSwitch
   programs expect to find files in locations selected at installation
   time.  The instructions below assume that files are installed in
   their default locations, under /usr/local.

2. Load the brcompat kernel module (which was built in step 1), e.g.:

      % insmod datapath/linux/brcompat.ko

   (openvswitch.ko should already have been loaded.)

3. Start ovs-brcompatd:

      % ovs-brcompatd --pidfile --detach

   (ovsdb-server and ovs-vswitchd should already have been loaded.)

4. Now you should be able to manage the Open vSwitch using brctl and
   related tools.  For example, you can create an Open vSwitch bridge,
   add interfaces to it, then print information about bridges with the
   commands:

      % brctl addbr br0
      % brctl addif br0 eth0
      % brctl addif br0 eth1
      % brctl show

   Each of these commands actually uses or modifies the Open vSwitch
   configuration database, then notifies the ovs-vswitchd daemon of
   the change.  For example, after executing the commands above
   starting from an empty configuration file, "ovs-vsctl list-ports
   br0" should show that bridge br0 contains two ports, eth0 and eth1.


接下来按照openvswitch的提示, 加载brcompat模块, 并使用brctl来管理看看.
[root@150 openvswitch-1.9.3]# locate brcompat.ko
/lib/modules/2.6.32-431.20.3.el6.x86_64/extra/openvswitch/brcompat.ko
[root@150 openvswitch-1.9.3]# lsmod|grep brcom
[root@150 openvswitch-1.9.3]# insmod /lib/modules/2.6.32-431.20.3.el6.x86_64/extra/openvswitch/brcompat.ko
[root@150 openvswitch-1.9.3]# lsmod|grep brcom
brcompat                5905  0 
openvswitch            96678  1 brcompat

告警了, 这个兼容性将来要移除了.
[root@150 openvswitch-1.9.3]# ovs-brcompatd --pidfile --detach
2014-08-06T00:23:14Z|00001|brcompatd|WARN|Bridge compatibility is deprecated and may be removed no earlier than February 2013
[root@150 openvswitch-1.9.3]# ps -ewf|grep ovs-b
root     18676     1  0 08:23 ?        00:00:00 ovs-brcompatd --pidfile --detach


现在使用brctl查看网桥信息, 还是有问题, 和一开始一样.
[root@150 openvswitch-1.9.3]# brctl show
bridge name     bridge id               STP enabled     interfaces
;vdsmdummy;             8000.000000000000       no
ovirtmgmt               /sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
0000.00221960778f       no

使用ovs-vsctl没有问题.
[root@150 openvswitch-1.9.3]# ovs-vsctl show
fb8f1987-c908-4a8f-bc2c-1f8c19f034fc
    Bridge ovirtmgmt
        Port ovirtmgmt
            Interface ovirtmgmt
                type: internal
        Port "em1"
            Interface "em1"
    ovs_version: "1.9.3"

使用brctl 添加一个网桥, 添加的网桥, 查看信息还是有问题.
[root@150 openvswitch-1.9.3]# brctl addbr br1
[root@150 openvswitch-1.9.3]# brctl show
bridge name     bridge id               STP enabled     interfaces
;vdsmdummy;             8000.000000000000       no
br1             /sys/class/net/br1/bridge: No such file or directory
/sys/class/net/br1/bridge: No such file or directory
/sys/class/net/br1/bridge: No such file or directory
/sys/class/net/br1/bridge: No such file or directory
/sys/class/net/br1/bridge: No such file or directory
/sys/class/net/br1/bridge: No such file or directory
/sys/class/net/br1/bridge: No such file or directory
/sys/class/net/br1/bridge: No such file or directory
/sys/class/net/br1/bridge: No such file or directory
/sys/class/net/br1/bridge: No such file or directory
/sys/class/net/br1/bridge: No such file or directory
/sys/class/net/br1/bridge: No such file or directory
0000.a28e5dc5ae47       no
ovirtmgmt               /sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
/sys/class/net/ovirtmgmt/bridge: No such file or directory
0000.00221960778f       no

看样子现在要用oVirt的话, 还是用bridge-utils带的brctl吧.
相关文章
checking for spandsp >= 3.0... configure: error: no usable spandsp; please install spandsp3 devel pa
checking for spandsp >= 3.0... configure: error: no usable spandsp; please install spandsp3 devel pa
505 0
|
Kubernetes 安全 应用服务中间件
Kubernetes CKS【24】---System Hardening - Kernel Hardening Tools(seccomp)
Kubernetes CKS【24】---System Hardening - Kernel Hardening Tools(seccomp)
Kubernetes CKS【24】---System Hardening - Kernel Hardening Tools(seccomp)
|
弹性计算 关系型数据库 Linux
How to Install CMS Made Simple v2.2 on LAMP in CentOS 7.2
In this tutorial, we will be setting up CMS Made Simple on a LAMP stack with an Alibaba Cloud ECS instance (CentOS 7.2).
3867 0
How to Install CMS Made Simple v2.2 on LAMP in CentOS 7.2
|
Ubuntu 关系型数据库 MySQL
How to Install and Configure Icinga2 Monitoring Tool on Ubuntu 16.04
In this tutorial, we will explore how to install Docker on Alibaba Cloud and learn some important Docker commands to help you deploy and manage your container services.
3008 0
How to Install and Configure Icinga2 Monitoring Tool on Ubuntu 16.04
|
JavaScript 关系型数据库 MySQL