1. Controller节点

1.1 安装 OVS和OVN

安装 Python3.7:

yum -y groupinstall "Development tools"
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel zlib1g-dev zlib* libffi-devel wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
tar -xvJf Python-3.7.2.tar.xz
mkdir /usr/local/python3 cd Python-3.7.2
./configure --prefix=/usr/local/python3 --enable-optimizations --with-ssl make && make install ln -s /usr/local/python3/bin/python3 /usr/local/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip3 python3 -V
pip3 -V

安装 ovs和ovn:

yum install -y epel-release net-tools gcc gcc-c++  kernel-devel kernel-headers kernel.x86_64 \
numactl-devel.x86_64 numactl-libs.x86_64 libpcap.x86_64 libpcap-devel.x86_64 pciutils \
autoconf automake libtool git clone https://github.com/openvswitch/ovs.git
git branch -a
git checkout
git checkout origin/branch-2.12
./boot.sh
./configure
make
make install # 配置数据库
mkdir -p /usr/local/etc/openvswitch
ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema # 启动 ovsdb-server
mkdir -p /usr/local/var/run/openvswitch
mkdir -p /usr/local/var/log/openvswitch/
ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \
--remote=db:Open_vSwitch,Open_vSwitch,manager_options \
--private-key=db:Open_vSwitch,SSL,private_key \
--certificate=db:Open_vSwitch,SSL,certificate \
--bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \
--pidfile --detach --log-file ovs-vsctl --no-wait init
ovs-vswitchd --pidfile --detach --log-file

# 启动 ovn_northd
/usr/local/share/openvswitch/scripts/ovn-ctl start_northd

其他:

yum install -y python-networking-ovn

允许远程访问 osvdb-server:(将 0.0.0.0 替换成管理网络接口的IP,可以避免监听所有接口)

ovn-nbctl set-connection ptcp:6641:0.0.0.0 -- set connection . inactivity_probe=60000
ovn-sbctl set-connection ptcp:6642:0.0.0.0 -- set connection . inactivity_probe=60000

如果使用 vtep,则还需如下配置:

ovs-appctl -t ovsdb-server ovsdb-server/add-remote ptcp:6640:0.0.0.0

编辑配置文件 /etc/neutron/neutron.conf,添加或修改如下内容:

[DEFAULT]
...
core_plugin = ml2
service_plugins = ovn-router # 其他配置

注:其他配置正常(https://docs.openstack.org/neutron/latest/install/controller-install-rdo.html)。

编辑配置文件 /etc/neutron/plugins/ml2/ml2_conf.ini:

[ml2]
...
mechanism_drivers = ovn
type_drivers = local,flat,vlan,geneve
tenant_network_types = geneve
extension_drivers = port_security
overlay_ip_version = 4 [ml2_type_flat]
flat_networks = PHYSICAL_NETWORK [ml2_type_geneve]
vni_ranges = 1:65536
max_header_size = 38 [ml2_type_vlan]
network_vlan_ranges = PHYSICAL_NETWORK:MIN_VLAN_ID:MAX_VLAN_ID [securitygroup]
enable_security_group = true [ovn]
ovn_nb_connection = tcp:IP_ADDRESS:6641
ovn_sb_connection = tcp:IP_ADDRESS:6642
ovn_l3_scheduler = OVN_L3_SCHEDULER

将 PHYSICAL_NETWORK 替换为物理网络名称(自己取即可),如, provider。

MIN_VXLAN_ID:MAX_VLAN_ID 定义了最小、最大可用的 vlan id,如,1001:2000。

将 IP_ADDRESS 替换为 controller 节点上运行 osvdb-server 服务的IP地址。

OVN_L3_SCHEDULER可选值:

  • leastloaded:let the scheduler to select a compute node with the least number of gateway ports.
  • chance:let the scheduler to randomly select a compute node from the available list of compute nodes.

Set ovn-cms-options with enable-chassis-as-gw in Open_vSwitch table’s external_ids column. Then if this chassis has proper bridge mappings, it will be selected for scheduling gateway routers.

ovs-vsctl set open . external-ids:ovn-cms-options=enable-chassis-as-gw

重新填充数据库:(DBPASS:数据库登录密码,NEUTRON_DBPASS:neutron服务连接数据库时使用的密码)

mysql -uroot -p$DBPASS <<EOF
DROP DATABASE IF EXISTS neutron;
CREATE DATABASE neutron; GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY '$NEUTRON_DBPASS';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY '$NEUTRON_DBPASS'; quit
EOF su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron

停止 linux-bridge 等服务(因为此处将 controller 节点也用作了 network 节点),并重新启动 neutron-server:

systemctl stop neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service
systemctl disable neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service systemctl restart neutron-server.service

2. Network节点

不再需要 DHCP 和 L3 功能。

3. Compute节点

使用 controller 节点上的 ovs 数据库:

systemctl start openvswitch
ovs-vsctl set open . external-ids:ovn-remote=tcp:IP_ADDRESS:6642

将 IP_ADDRESS 替换为 controller 上运行 ovsdb-server 服务的 IP地址。

ovs-vsctl set open . external-ids:ovn-encap-type=geneve,vxlan
ovs-vsctl set open . external-ids:ovn-encap-ip=IP_ADDRESS

Replace IP_ADDRESS with the IP address of the overlay network interface on the compute node.

4. Controller节点

启动 ovn-controller:

/usr/local/share/openvswitch/scripts/ovn-ctl start_controller

5. 验证

# openstack network create net1
# openstack subnet create --subnet-range 172.0.0.0/24 --network net1 subnet1
# openstack port create --network net1 --fixed-ip subnet=subnet1,ip-address=172.0.0.10 port1 # ovn-nbctl show
switch 00d310e3-1919-4dc8-a6d4-c9baaba1b006 (neutron-4c3d437a-f161-4c3e-9a57-606e9f80ed14) (aka net1)
port 40e23569-fd75-40fb-ae07-ce93053a007b (aka port1)
addresses: ["fa:16:3e:98:22:c7 172.0.0.10"]

参考资料

https://docs.openstack.org/neutron/latest/install/ovn/manual_install.html

https://www.cnblogs.com/xiujin/p/11477419.html

https://www.cnblogs.com/gaozhengwei/p/7100140.html

OpenStack使用OVN的更多相关文章

  1. 【Network】OVS、VXLAN/GRE、OVN等 实现 Docker/Kubernetes 网络的多租户隔离

    多租户隔离 DragonFlow与OVN | SDNLAB | 专注网络创新技术 Neutron社区每周记(6.25~7.6)| OVS将加入Linux基金会?OVN或抛弃ovsdb? | Unite ...

  2. 我的第二本译作《精通OpenStack》上架啦:书籍介绍和译者序

    1. 书籍简介 英文书名:Mastering OpenStack Second Edition 作者:[德] 奥马尔-海德希尔(Omar Khedher)[印] 坚登-杜塔-乔杜里(Chanda Du ...

  3. 我的第二本译作《精通OpenStack》上架啦:前言、目录和样章

    1. 前言 今天,随着新功能和子项目的增加,OpenStack已成为一个不断扩展的大型开源项目.随着数以百计大型企业采用并不断为OpenStack生态系统做出贡献,OpenStack必将成为下一代私有 ...

  4. 如何借助 OVN 来提高 OVS 在云计算环境中的性能

    众所周知,OpenvSwitch 以其丰富的功能和不错的性能,已经成为 Openstack 部署中最受欢迎的虚拟交换机.由于 Openstack Neutron 的架构引入了一些性能问题,比如 neu ...

  5. ovs ovn 学习资料

    0.A Primer on OVN http://blog.spinhirne.com/2016/09/a-primer-on-ovn.html 1.Open Virtual Networking W ...

  6. (转)Openstack Cascading和Nova Cell

    Openstack是看着AWS成长起来的,这点毋庸置疑:所以AWS大规模商用已成事实的情况下,Openstack也需要从架构和产品实现上进行优化,以满足大规模商用的要求.从已有的实现来看其中两种方式值 ...

  7. 在Packstack环境手动安装OVN

    安装OpenStack(allinone)环境 ### 参考"Packstack使用"章节安装,但是不要配置外网网络 安装OVN组件 ### 控制节点 # yum install ...

  8. OVN架构翻译

    概述 ovn-controller是OVN在虚拟机上的agent,北向连接OVN的南向数据库,学习OVN的配置和状态,并使用虚拟机的状态来填充PN表以及Binding表的Chassis列:南向连接op ...

  9. OpenStack日志分析

    日志文件说明 Nova日志 OpenStack计算服务日志位于/var/log/nova目录下(此目录在Controller和Compute节点都存在),默认权限拥有者是nova用户 文件名 作用 n ...

随机推荐

  1. java基础模拟考试三套试卷

    卷1: 一.单选题(15道,共30分) //1.下列关于JDK.JRE.JVM关系描述正确的是 (A) A:JDK是开发工具,包含了JRE.JRE是运行环境,包含了JVM.JVM是虚拟机,可以保证跨平 ...

  2. VS中使用RDLC提示类型不一致

    问题描述 错误"基类包括字段"XXXXXXX",但其类型(Microsoft.Reporting.WebForms.ReportViewer)与控件(Microsoft. ...

  3. 【electron+vue3+ts实战便笺exe】二、electron+vue3开发内容

    不要让自己的上限成为你的底线 本来以为有万字的..没想到才堪堪近6000字.为了水文的嫌疑,只挑了重点的地方讲,比如component内的组件就挑了右键弹窗去说明,建议在看本文的时候边查看项目,有不懂 ...

  4. mysql多个TimeStamp设置

    mysql多个TimeStamp设置 2012-11-02 12:58  轩脉刃  阅读(39590)  评论(3)  编辑  收藏 timestamp设置默认值是Default CURRENT_TI ...

  5. [leetcode72]166. Fraction to Recurring Decimal手动实现除法

    让人火大的一道题,特殊情况很多 不过也学到了: java中int类型的最大值的绝对值比最小值的绝对值小1 int最小值的绝对值还是负的,除以-1也是 这种时候最好转为long类型进行处理 long n ...

  6. redo log 有什么作用?

    mysql 为了提升性能不会把每次的修改都实时同步到磁盘,而是会先存到Boffer Pool(缓冲池)里头,把这个当作缓存来用.然后使用后台线程去做缓冲池和磁盘之间的同步. 那么问题来了,如果还没来的 ...

  7. Java优雅停机

    Java的优雅停机通常通过注册JDK的ShootDownHook实现,当系统接受到退出指令后,首先标记系统处于退出状态,不再接受新的消息,然后将积压的消息处理完,最后调用资源回收接口将资源销毁,最后各 ...

  8. Linux 时间同步 01 简介

    Linux 时间同步 01 简介 目录 Linux 时间同步 01 简介 时间同步 公共NTP服务器地址及IP 系统时间相关文件 时间同步 大数据产生与处理系统是各种计算设备集群的,计算设备将统一.同 ...

  9. 自定义注解,更优雅的使用MP分页功能

    分页功能使用 MP的分页功能是通过MyBatis的插件实现的,使用起来也非常简单.下面先介绍下使用方式. step1:配置分页插件 @Configuration @EnableTransactionM ...

  10. 【Azure Redis 缓存】Azure Redis功能性讨论

    关于使用Azure Redis服务在以下九大方面的功能性的解说: 高可用 备份可靠性 配置自动化 部署多样性 快速回档功能 数据扩容 SLA稳定性 数据安全性 监控系统 一:高可用 Azure Cac ...