Weitere ähnliche Inhalte Ähnlich wie OVN 設定サンプル | OVN config example 2015/12/27 (20) Mehr von Kentaro Ebisawa (20) Kürzlich hochgeladen (20) OVN 設定サンプル | OVN config example 2015/12/271. OVN 設定サンプル
Open Virtual Network : OVN Config example
Twitter: @ebiken | ebiken@gmail.com
Open Virtual Network : OVN Config example | 2015/12/27 1
2. About OVN ~ Open Virtual Network (1/2)
• Open Virtual Network とは?
• 複数の仮想スイッチ(サーバー)を横断する仮想ネットワークを構築するしくみ。
• L2/L3 switch, tunnel, ACL, Security Group 等を提供
Open Virtual Network : OVN Config example | 2015/12/27 2
Server
(Hypervisor)
VM-1 VM-2 VM-A
Server
(Hypervisor)
VM-3 VM-A
Logical Switch Logical Switch
Logical
Switch
VM-1 VM-2 VM-AVM-3 VM-B
Logical Router
物理構成 論理構成
OVN利用
3. About OVN ~ Open Virtual Network (2/2)
• Open vSwitch (OVS) を利用して構成
• OVSには変更を加えない(既存機能を利用)
• 多くの OpenFlow Extensionを利用するため、現状ではOVSのみサポート。
• ex: resubmit, registry, tunnel metadata, conntrack etc.
• テナントを分ける仮想ネットワークを構築可能。
• ホスト:仮想マシン(KVM, Xen, Hyper-V)、コンテナ(Docker)等
• 仮想スイッチ:Open vSwitch (OVS)
• CMS(Cloud Management System): OpenStack等
• 詳細は次Slide 「OVN参考情報リンク集」 を参照
Open Virtual Network : OVN Config example | 2015/12/27 3
4. OVN参考情報リンク集
• 「OVN (Open Virtual Network) の紹介」 by 進藤さん
• http://blog.shin.do/2015/12/ovn-open-virtual-network-
%E3%81%AE%E7%B4%B9%E4%BB%8B/
• 日本語の説明BLOG
• Network Heresy: OVN, Bringing Native Virtual Networking to OVS
• http://networkheresy.com/2015/01/13/ovn-bringing-native-virtual-networking-to-ovs/
• 最初の(オフィシャル)アナウンスBLOG
• OVN: Open Virtual Network for Open vSwitch
• Slides (PDF) : http://openvswitch.org/support/slides/OVN-Vancouver.pdf
• Video:
• https://www.openstack.org/summit/vancouver-2015/summit-videos/presentation/ovn-native-virtual-
networking-for-open-vswitch
• OpenStackとの位置づけを含む解説@OpenStack Summit Vancouver
Open Virtual Network : OVN Config example | 2015/12/27 4
5. OVN アーキテクチャ
Open Virtual Network : OVN Config example | 2015/12/27 5
ovn-northd
Northbound DB
(ovnnb.db)
Southbound DB
(ovnsb.db)
ovn-controller
ovs-vswitchd
OVS DB
(conf.db, vtep.db) .
CMS
(OpenStack etc)
OVSDB
OpenFlow
Communication Protocols ovn-northd
論理トポロジー( Northbound DB)を物理ト
ポロジー(Southbound DB)に変換&保存
Logical Flowを生成し SB-DB に保存
ovn-controller
ローカルスイッチ(OVS)上の物理・
論理ポートの紐づけや状態を
Sourthbound DBに登録
物理トポロジー(Southbound DB)を
元にOVSを設定(Flow Rule投入等)
構成情報はデータベースを通じ
て伝達(OVSDB Protocol)
OVSは同居する ovn-controller
が制御(OVSDB + OpenFlow)
ovn-controller
ovs-vswitchd
管理サーバー
Chassis (Hypervisor) Chassis (Hypervisor)
Chassis (Hypervisor)
VMとOVSを収容するサーバー
OVS DB
(conf.db, vtep.db) .
6. OVN構成・設定例
ovn-northd x 1 + ovn-controller(OVS) x2
Configuration examples.
Open Virtual Network : OVN Config example | 2015/12/27 6
7. 構成・設定例:ovn-northd x 1 + ovn-controller(OVS) x2
Open Virtual Network : OVN Config example | 2015/12/27 7
Northbound DB (ovnnb.db)
ovn-northd
vtap1
veth1
172.16.2.1/24
ns: host1
vtap2
veth2
172.16.2.2/24
ns: host2
bridge: br-int
ovn-
controller
vtap3
veth3
172.16.2.3/24
ns: host3
vtap4
veth4
172.16.2.4/24
ns: host4
bridge: br-int
Tunnel
(Geneve)
Southbound DB (ovnsb.db)
構成概要
物理サーバー3台構成:ovn01/02/03 (但し、
実際はVirtualBoxでVM 3台作成し試験)
作業簡略化のため namespace (ns) を用いて
VMを作成(実際にはネットワークのコンテナ)
namespace (ns) は4つ:host1/2/3/4
Tenant 2つ:青(host1, host4)、赤(host2, host3)
はそれぞれ後述の2つの論理スイッチ(sw0,
sw1)に接続される。
疎通確認結果をわかりやすくするために
host1~4 全てに異なるIP address を使用。
実際は異なるテナント間でIPアドレスが重複し
ても動作する。 (当然ですが)
CMSは利用せず、論理トポロジーは ovn01 上
で ovn-nbctl コマンドを使い設定。
異なるサーバー(Hypervisor)上のVM を
2つのテナントに分け接続する構成・設定例
intent : 172.16.0.0/24
172.16.0.10/24
172.16.0.20/24 172.16.0.30/24
server: ovn02
server: ovn01
server: ovn03
OVS DB
(conf.db, vtep.db)
ovn-
controller
OVS DB
(conf.db, vtep.db)
8. 論理構成
Open Virtual Network : OVN Config example | 2015/12/27 8
veth1
172.16.2.1/24
ns: host1
veth2
172.16.2.2/24
ns: host2
veth3
172.16.2.3/24
ns: host3
veth4
172.16.2.4/24
ns: host4
sw1
sw0
Logical Switch : sw0, sw1
sw-port1
vtap1
sw-port2
vtap2
sw-port3
vtap3
sw-port4
vtap4
9. 構成・設定例:ovn-northd x 1 + ovn-controller(OVS) x2
Open Virtual Network : OVN Config example | 2015/12/27 9
設定手順 (using Ubuntu15.10)
全サーバー共通基本設定
1. Install Ubuntu 15.10 Server
2. Update / Upgrade and install build-essential
3. Download OVS (OVN) source code
4. Install OVS (OVN) prerequisites
5. Build OVS (OVN)
6. Configure hostname
7. Configure network connecting servers (intnet)
8. Confirm you can ping between servers
Server ovn01: ovnsb, ovnnb, ovn-northdの設定&開始
1. Create OVN database (northbound + southbound)
2. Start ovsdb-server
3. Start ovn-northd
Server ovn02,ovn03: ovs-vswitchd, ovn-controller設定・開始
1. Create database (conf.db, vtep.db)
2. Start ovsdb-server & initialize DB
3. Start ovs-vswitchd
4. Set external-ids on conf.db
5. Start ovn-controller, ovn-controller-vtep
Server ovn02,ovn03: namespace (VM) host1/host2の設定
1. vtap / veth の作成
2. create namespace and attach veth
3. change interface status to “up” and assign IP address
OVN Logical Network の設定
1. Create logical switches and ports
2. Check MAC address of VMs
3. Set MAC address to each logical ports (based on 2.)
4. Bind Logical ports and Physical ports
10. 全サーバー共通基本設定(ovn01/02/03 全3台にて実施)
Open Virtual Network : OVN Config example | 2015/12/27 10
1) Install Ubuntu 15.10 Server
Software Selection: OpenSSH server
2) Update/Upgrade and install build-essential
$ sudo -i
# apt-get update
# apt-get upgrade
# apt-get install build-essential
# exit
3) Download OVS (OVN) source code
~$ sudo apt-get install git
~$ git clone https://github.com/openvswitch/ovs.git
Read "INSTALL.md" for steps to installation. (including prerequisites)
インストール手順詳細は “INSTALL.md” を参照
~$ cd ovs
~/ovs$ vi INSTALL.md
4) Install OVS (OVN) prerequisites | 必要なパッケージをインストール
>> autoconf, automake, libtool-bin, perl, python
$ sudo apt-get install autoconf
$ autoconf --version
autoconf (GNU Autoconf) 2.69
$ automake --version
automake (GNU automake) 1.15
$ sudo apt-get install libtool-bin
$ libtool --version
libtool (GNU libtool) 2.4.2
$ perl --version
This is perl 5, version 20, subversion 2 (v5.20.2)
$ sudo apt-get install python
5) Build OVS (OVN) | OVS (OVN) のビルド
$ cd ovs/
~/ovs$ ./boot.sh
~/ovs$ ./configure
~/ovs$ make
11. 全サーバー共通基本設定(ovn01/02/03 全3台にて実施)
Open Virtual Network : OVN Config example | 2015/12/27 11
6) Configure hostname | ホスト名設定
$ sudo vi /etc/hostname
# pick one from ovn01, ovn02, ovn03
ovn0X
$ sudo vi /etc/hosts
127.0.0.1 localhost
# pick one from ovn01, ovn02, ovn03
127.0.1.1 ovn0X
$ sudo reboot
7) Configure network connecting servers (intnet)
サーバー間ネットワークの設定。VirtualBox 5.0.10 on Win で intent
(内部ネットワーク)を設定した際のインターフェース名は “enp0s8”
$ sudo vi /etc/network/interfaces
# interface connecting hosts
auto enp0s8
iface enp0s8 inet static
# pic one from 172.16.0.10, 20, 30
address 172.16.0.XX
netmask 255.255.255.0
$ sudo service networking restart
8) Confirm you can ping between servers | ping で疎通確認
ebiken@ovn01:~$ ping 172.16.0.20
PING 172.16.0.20 (172.16.0.20) 56(84) bytes of data.
64 bytes from 172.16.0.20: icmp_seq=1 ttl=64 time=0.624 ms
...
ebiken@ovn02:~$ ping 172.16.0.10
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=0.260 ms
…
ebiken@ovn03:~$ ping 172.16.0.10
PING 172.16.0.10 (172.16.0.10) 56(84) bytes of data.
64 bytes from 172.16.0.10: icmp_seq=1 ttl=64 time=0.260 ms
12. Server ovn01: ovnsb, ovnnb, ovn-northd の設定&開始
Open Virtual Network : OVN Config example | 2015/12/27 12
1) Create OVN database (northbound + southbound)
ovn-northd と同じサーバー上に作成。
• ovnsb.db: OVN_Northbound // ovn-nb(5)
• ovnnb.db: OVN_Southbound // ovn-sb(5)
~/ovs$ sudo mkdir -p /usr/local/etc/openvswitch
~/ovs$ sudo ovsdb-tool create /usr/local/etc/openvswitch/ovnsb.db ovn/ovn-sb.ovsschema
~/ovs$ sudo ovsdb-tool create /usr/local/etc/openvswitch/ovnnb.db ovn/ovn-nb.ovsschema
2) Start ovsdb-server
$ sudo ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock
--remote=ptcp:6632
--detach --pidfile --log-file
/usr/local/etc/openvswitch/ovnsb.db
/usr/local/etc/openvswitch/ovnnb.db
• “--remote=ptcp:6632” オプションにより、port 6632 経由で ovn-controllerから接続可能になる。
• ファイル名指定無しで --log-file オプションを指定するとovsdb-server は以下ファイルにログを出力する。
• /usr/local/var/log/openvswitch/ovsdb-server.log
3) Start ovn-northd(8)
$ sudo ovn-northd --pidfile --detach --log-file
Northbound DB (ovnnb.db)
ovn-northd
ovn-controller
Southbound DB (ovnsb.db)
intent : 172.16.0.0/24
172.16.0.10/24
172.16.0.20,30/24
server: ovn02,03
server: ovn01
port 6632
13. Server ovn02,ovn03: ovs-vswitchd, ovn-controller設定・開始
Open Virtual Network : OVN Config example | 2015/12/27 13
0) Load kernel module
$ lsmod | grep openvswitch
$ sudo /sbin/modprobe openvswitch
• “lsmod | grep openvswitch” でKernel Moduleがロード済みか確認
1) Create database | OVS用データベース(conf.db, vtep.db)の作成
$ sudo mkdir -p /usr/local/etc/openvswitch
~/ovs$ sudo ovsdb-tool create /usr/local/etc/openvswitch/vtep.db vtep/vtep.ovsschema
~/ovs$ sudo ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
2) Start ovsdb-server & initialize DB
$ sudo ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock
--detach --pidfile --log-file
/usr/local/etc/openvswitch/vtep.db
/usr/local/etc/openvswitch/conf.db
$ sudo ovs-vsctl --no-wait -- init
ovn-
controller
172.16.0.20,30/24
server: ovn02,03
OVS DB
(conf.db, vtep.db)
14. Server ovn02,ovn03: ovs-vswitchd, ovn-controller設定・開始
Open Virtual Network : OVN Config example | 2015/12/27 14
3) Start ovs-vswitchd
$ sudo ovs-vswitchd --pidfile --detach --log-file
4) Set external-ids on conf.db:Open_vSwitch Table
• conf.db:Open_vSwitch Table にexternal-idsを設定。(”set open” は “set Open_vSwitch” の略)
• ovn-controller 起動時に external-idsを元に ovn-controller は Chassis (Hypervisor/Server) を ovnsb.db: Chassis table に登録。
• Bridge “br-int” はovn-controller 起動時に自動生成(br-int = integration bridge)
Server: ovn02
$ sudo ovs-vsctl set open . external-ids:system-id=56b18105-5706-46ef-80c4-ff20979ab002
$ sudo ovs-vsctl set open . external-ids:ovn-remote=tcp:172.16.0.10:6632
$ sudo ovs-vsctl set open . external-ids:ovn-encap-type=geneve
$ sudo ovs-vsctl set open . external-ids:ovn-encap-ip=172.16.0.20
Server: ovn03
$ sudo ovs-vsctl set open . external-ids:system-id=56b18105-5706-46ef-80c4-ff20979ab003
$ sudo ovs-vsctl set open . external-ids:ovn-remote=tcp:172.16.0.10:6632
$ sudo ovs-vsctl set open . external-ids:ovn-encap-type=geneve
$ sudo ovs-vsctl set open . external-ids:ovn-encap-ip=172.16.0.30
5) Start ovn-controller(8), ovn-controller-vtep(8)
$ sudo ovn-controller --pidfile --detach --log-file
bridge: br-int
ovn-
controller
172.16.0.20,30/24
server: ovn02,03
OVS DB
(conf.db, vtep.db)
15. Server ovn02,ovn03: namespace (VM) host1 / host2 の設定
Open Virtual Network : OVN Config example | 2015/12/27 15
1) vtap / veth の作成
Server: ovn02
$ sudo ip link add veth1 type veth peer name vtap1
$ sudo ip link add veth2 type veth peer name vtap2
Server: ovn03
$ sudo ip link add veth3 type veth peer name vtap3
$ sudo ip link add veth4 type veth peer name vtap4
2) create namespace and attach veth
• namespaceを作成しvethを紐付け。
• これにより vethX は各namespace(hostY)からのみ参照可能となる。
Server: ovn02
$ sudo ip netns add host1
$ sudo ip netns add host2
$ sudo ip link set veth1 netns host1
$ sudo ip link set veth2 netns host2
Server: ovn03
$ sudo ip netns add host3
$ sudo ip netns add host4
$ sudo ip link set veth3 netns host3
$ sudo ip link set veth4 netns host4
vtap1
veth1
ns: host1
vtap2
veth2
ns: host2
bridge: br-int
ovn-
controller
172.16.0.20,30/24
server: ovn02,03
OVS DB
(conf.db, vtep.db)
16. Server ovn02,ovn03: namespace (VM) host1 / host2 の設定
Open Virtual Network : OVN Config example | 2015/12/27 16
3) change interface status to “up” and assign IP address
Server: ovn02
$ sudo ip link set dev vtap1 up
$ sudo ip link set dev vtap2 up
$ sudo ip netns exec host1 ip link set veth1 up
$ sudo ip netns exec host2 ip link set veth2 up
$ sudo ip netns exec host1 ifconfig lo up
$ sudo ip netns exec host2 ifconfig lo up
$ sudo ip netns exec host1 ip addr add 172.16.2.1/24 dev veth1
$ sudo ip netns exec host2 ip addr add 172.16.2.2/24 dev veth2
Server: ovn03
$ sudo ip link set dev vtap3 up
$ sudo ip link set dev vtap4 up
$ sudo ip netns exec host3 ip link set veth3 up
$ sudo ip netns exec host4 ip link set veth4 up
$ sudo ip netns exec host3 ifconfig lo up
$ sudo ip netns exec host4 ifconfig lo up
$ sudo ip netns exec host3 ip addr add 172.16.2.3/24 dev veth3
$ sudo ip netns exec host4 ip addr add 172.16.2.4/24 dev veth4
vtap1
veth1
172.16.2.1/24
ns: host1
vtap2
veth2
172.16.2.2/24
ns: host2
bridge: br-int
ovn-
controller
172.16.0.20,30/24
server: ovn02,03
OVS DB
(conf.db, vtep.db)
17. 3) Set MAC address to each logical ports
• “2)” で確認したMAC address を各論理ポートに設定
Server: ovn01
$ sudo ovn-nbctl lport-set-addresses sw-port1 62:1a:d6:91:49:3d
$ sudo ovn-nbctl lport-set-addresses sw-port2 ae:de:c6:a4:f9:e4
$ sudo ovn-nbctl lport-set-addresses sw-port3 c2:5b:26:02:7f:87
$ sudo ovn-nbctl lport-set-addresses sw-port4 92:89:78:df:69:c9
OVN Logical Network の設定
Open Virtual Network : OVN Config example | 2015/12/27 17
1) Create a logical switch named "sw0“ and 4 logical ports on "sw0"
• ovn01 にて2つの論理スイッチ(sw0, sw1)と4つの論理ポートを作成
Server: ovn01
$ sudo -i
# ovn-nbctl lswitch-add sw0
# ovn-nbctl lswitch-add sw1
# ovn-nbctl lport-add sw0 sw-port1
# ovn-nbctl lport-add sw1 sw-port2
# ovn-nbctl lport-add sw1 sw-port3
# ovn-nbctl lport-add sw0 sw-port4
2) Check MAC address of veth1,2,3,4 on Server: ovn02, 03
• veth1,2,3,4 の MAC address を確認。以下はovn02: veth1の例。
root@ovn02:~$ sudo ip netns exec host1 ip a
…
9: veth1@if8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast state UP group default qlen 1000
link/ether 62:1a:d6:91:49:3d brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.16.2.1/24 scope global veth1
valid_lft forever preferred_lft forever
inet6 fe80::601a:d6ff:fe91:493d/64 scope link
valid_lft forever preferred_lft forever
18. OVN Logical Network の設定
Open Virtual Network : OVN Config example | 2015/12/27 18
4) Bind Logical ports (sw-portX) and Physical ports (vtapX)
• 論理ポート(sw-portX)と物理ポート(vtapX)の紐づけ
Server: ovn02
$ sudo ovs-vsctl add-port br-int vtap1 -- set Interface vtap1 external_ids:iface-id=sw-port1
sudo ovs-vsctl add-port br-int vtap2 -- set Interface vtap2 external_ids:iface-id=sw-port2
Server: ovn03
$ sudo ovs-vsctl add-port br-int vtap3 -- set Interface vtap3 external_ids:iface-id=sw-port3
$ sudo ovs-vsctl add-port br-int vtap4 -- set Interface vtap4 external_ids:iface-id=sw-port4
5) ping による疎通確認
Server: ovn02
• host1-> host2, host3 :異なる論理スイッチ上のため ping 不可
$ sudo ip netns exec host1 ping 172.16.2.2
PING 172.16.2.2 (172.16.2.2) 56(84) bytes of data.
From 172.16.2.1 icmp_seq=1 Destination Host Unreachable
$ sudo ip netns exec host1 ping 172.16.2.3
PING 172.16.2.3 (172.16.2.3) 56(84) bytes of data.
From 172.16.2.1 icmp_seq=1 Destination Host Unreachable
• OK: host1 -> host4 : 同じ論理スイッチ上のため ping 可能
$ sudo ip netns exec host1 ping 172.16.2.4
PING 172.16.2.4 (172.16.2.4) 56(84) bytes of data.
64 bytes from 172.16.2.4: icmp_seq=1 ttl=64 time=1.58 ms
19. 参考:コマンドアウトプット各種
Open Virtual Network : OVN Config example | 2015/12/27 19
Server: ovn01
$ sudo ovn-nbctl show
lswitch 655db232-136a-4234-b259-b10ea3b0bda5 (sw0)
lport sw-port1
addresses: 62:1a:d6:91:49:3d
lport sw-port4
addresses: 92:89:78:df:69:c9
lswitch 0aafe3cf-832c-404f-9250-894a8dd8f88e (sw1)
lport sw-port3
addresses: c2:5b:26:02:7f:87
lport sw-port2
addresses: ae:de:c6:a4:f9:e4
$ sudo ovn-sbctl show
Chassis "56b18105-5706-46ef-80c4-ff20979ab002"
Encap geneve
ip: "172.16.0.20"
Port_Binding "sw-port2"
Port_Binding "sw-port1"
Chassis "56b18105-5706-46ef-80c4-ff20979ab003"
Encap geneve
ip: "172.16.0.30"
Port_Binding "sw-port4"
Port_Binding "sw-port3“
Server: ovn01
$ sudo ovsdb-client list-dbs
OVN_Northbound
OVN_Southbound
ebiken@ovn01:~/ovs$ sudo ovsdb-client list-tables OVN_Northbound
Table
-------------------
Logical_Router
Logical_Port
Logical_Switch
ACL
Logical_Router_Port
ebiken@ovn01:~/ovs$ sudo ovsdb-client list-tables OVN_Southbound
Table
----------------
Chassis
Encap
Multicast_Group
Logical_Flow
Datapath_Binding
Port_Binding
20. 参考:コマンドアウトプット各種
Open Virtual Network : OVN Config example | 2015/12/27 20
Server: ovn02
$ sudo ovs-vsctl show
db8c7f2f-6112-4aba-af09-6f968fdd348d
Bridge br-int
fail_mode: secure
Port "ovn-56b181-0"
Interface "ovn-56b181-0"
type: geneve
options: {key=flow, remote_ip="172.16.0.30"}
Port "vtap2"
Interface "vtap2"
Port "vtap1"
Interface "vtap1"
Port br-int
Interface br-int
type: internal
Server: ovn03
$ sudo ovs-vsctl show
db15ad7c-0612-4620-b259-042361a5accc
Bridge br-int
fail_mode: secure
Port "ovn-56b181-0"
Interface "ovn-56b181-0"
type: geneve
options: {key=flow, remote_ip="172.16.0.20"}
Port "vtap4"
Interface "vtap4"
Port "vtap3"
Interface "vtap3"
Port br-int
Interface br-int
type: internal
Server: ovn01
$ sudo ovsdb-client dump OVN_Southbound Chassis
Chassis table
_uuid encaps name vtep_logical_switches
------------------------------------ -------------------------------------- -------------------------------------- ---------------------
dfb07059-3f8e-4c6e-8c19-12f9e29d1089 [50e21f4c-1686-4ee3-9a0c-900d1533e422] "56b18105-5706-46ef-80c4-ff20979ab002" []
fe402522-e01a-4f87-8dfa-b91a22ade24b [4714934b-9a67-4d4b-90f0-c49b584ff222] "56b18105-5706-46ef-80c4-ff20979ab003" []
$ sudo ovsdb-client dump OVN_Southbound Datapath_Binding
Datapath_Binding table
_uuid external_ids tunnel_key
------------------------------------ ------------------------------------------------------- ----------
0817de82-4ffe-48c7-86fa-3df901fb1ccb {logical-switch="0aafe3cf-832c-404f-9250-894a8dd8f88e"} 2
185b458b-ba7b-439b-bce8-ba9cedd690f7 {logical-switch="655db232-136a-4234-b259-b10ea3b0bda5"} 1
21. 参考:コマンドアウトプット各種
Open Virtual Network : OVN Config example | 2015/12/27 21
Server: ovn02
$ sudo ovsdb-client dump Open_vSwitch Open_vSwitch
Open_vSwitch table
_uuid bridges cur_cfg datapath_types db_version
------------------------------------ -------------------------------------- ------- ---------------- ----------
db8c7f2f-6112-4aba-af09-6f968fdd348d [f2e00409-d348-45f0-8b6d-d21ef78d2a6a] 6 [netdev, system] []
external_ids
----------------------------------------------------------------------------------------------------------------------------------------
{ovn-encap-ip="172.16.0.20", ovn-encap-type=geneve, ovn-remote="tcp:172.16.0.10:6632", system-id="56b18105-5706-46ef-80c4-ff20979ab002"}
iface_types manager_options next_cfg other_config ovs_version ssl statistics
------------------------------------------------------------------------ --------------- -------- ------------ ----------- --- ----------
[geneve, gre, internal, ipsec_gre, lisp, patch, stt, system, tap, vxlan] [] 6 {} [] [] {}
system_type system_version
----------- --------------
[] []
(見やすいようにフォーマットを一部修正しています)
22. 参考:コマンドアウトプット各種
Open Virtual Network : OVN Config example | 2015/12/27 22
ebiken@ovn02:~/ovs$ sudo ovs-ofctl show br-int
OFPT_FEATURES_REPLY (xid=0x2): dpid:00000a04e0f2f045
n_tables:254, n_buffers:256
capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS
ARP_MATCH_IP
actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan
mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src
mod_tp_dst
1(ovn-56b181-0): addr:6e:8c:bc:49:f4:6e
config: 0
state: 0
speed: 0 Mbps now, 0 Mbps max
2(vtap1): addr:06:26:83:78:2c:fa
config: 0
state: 0
current: 10GB-FD COPPER
speed: 10000 Mbps now, 0 Mbps max
3(vtap2): addr:46:e4:5a:8c:e3:30
config: 0
state: 0
current: 10GB-FD COPPER
speed: 10000 Mbps now, 0 Mbps max
LOCAL(br-int): addr:0a:04:e0:f2:f0:45
config: PORT_DOWN
state: LINK_DOWN
speed: 0 Mbps now, 0 Mbps max
OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0
23. 参考:コマンドアウトプット各種
Open Virtual Network : OVN Config example | 2015/12/27 23
ebiken@ovn02:~/ovs$ sudo ovs-ofctl dump-tables br-int
OFPST_TABLE reply (xid=0x2):
table 0 ("classifier"):
active=3, lookup=16, matched=16
max_entries=1000000
matching:
in_port: exact match or wildcard
eth_src: exact match or wildcard
eth_dst: exact match or wildcard
eth_type: exact match or wildcard
vlan_vid: exact match or wildcard
vlan_pcp: exact match or wildcard
ip_src: exact match or wildcard
ip_dst: exact match or wildcard
nw_proto: exact match or wildcard
nw_tos: exact match or wildcard
tcp_src: exact match or wildcard
tcp_dst: exact match or wildcard
table 1 ("table1"):
active=0, lookup=0, matched=0
(same features)
table 16 ("table16"):
active=8, lookup=8, matched=8
(same features)
...
table 17 ("table17"):
active=2, lookup=8, matched=8
(same features)
table 18 ("table18"): ditto
table 19 ("table19"):
active=6, lookup=8, matched=8
(same features)
table 20 ("table20"):
active=0, lookup=0, matched=0
(same features)
...
table 32 ("table32"):
active=5, lookup=8, matched=8
(same features)
table 33 ("table33"):
active=4, lookup=10, matched=10
(same features)
table 34 ("table34"):
active=5, lookup=10, matched=10
(same features)
table 35 ("table35"):
active=0, lookup=0, matched=0
(same features)
...
table 48 ("table48"):
active=2, lookup=8, matched=8
(same features)
table 49 ("table49"): ditto
table 50 ("table50"):
active=6, lookup=8, matched=8
(same features)
table 51 ("table51"):
active=0, lookup=0, matched=0
(same features)
...
table 64 ("table64"):
active=2, lookup=8, matched=8
(same features)
table 65 ("table65"):
active=0, lookup=0, matched=0
(same features)
...
Note: Tables not listed here are “ditto”
ex:
table 252 ("table252"): ditto
table 253 ("table253"): ditto
24. 参考:コマンドアウトプット各種
Open Virtual Network : OVN Config example | 2015/12/27 24
ebiken@ovn02:~/ovs$ sudo ovs-ofctl dump-flows
ovs-ofctl: 'dump-flows' command requires at least 1 arguments
ebiken@ovn02:~/ovs$ sudo ovs-ofctl dump-flows br-int
NXST_FLOW reply (xid=0x4):
cookie=0x0, duration=2437.006s, table=0, n_packets=13, n_bytes=770, idle_age=1611, priority=100,in_port=1 actions=move:NXM_NX_TUN_ID[0..23]-
>OXM_OF_METADATA[0..23],move:NXM_NX_TUN_METADATA0[16..30]->NXM_NX_REG6[0..14],move:NXM_NX_TUN_METADATA0[0..15]->NXM_NX_REG7[0..15],resubmit(,33)
cookie=0x0, duration=1713.077s, table=0, n_packets=19, n_bytes=910, idle_age=1602, priority=100,in_port=2 actions=load:0x1->NXM_NX_REG5[],load:0x1->OXM_OF_METADATA[],load:0x1-
>NXM_NX_REG6[],resubmit(,16)
cookie=0x0, duration=1712.380s, table=0, n_packets=3, n_bytes=238, idle_age=1674, priority=100,in_port=3 actions=load:0x2->NXM_NX_REG5[],load:0x2->OXM_OF_METADATA[],load:0x1-
>NXM_NX_REG6[],resubmit(,16)
cookie=0x0, duration=2236.429s, table=16, n_packets=0, n_bytes=0, idle_age=2236, priority=100,metadata=0x1,vlan_tci=0x1000/0x1000 actions=drop
cookie=0x0, duration=2236.407s, table=16, n_packets=0, n_bytes=0, idle_age=2236, priority=100,metadata=0x2,vlan_tci=0x1000/0x1000 actions=drop
cookie=0x0, duration=2236.429s, table=16, n_packets=0, n_bytes=0, idle_age=2236, priority=100,metadata=0x1,dl_src=01:00:00:00:00:00/01:00:00:00:00:00 actions=drop
cookie=0x0, duration=2236.407s, table=16, n_packets=0, n_bytes=0, idle_age=2236, priority=100,metadata=0x2,dl_src=01:00:00:00:00:00/01:00:00:00:00:00 actions=drop
cookie=0x0, duration=2236.429s, table=16, n_packets=19, n_bytes=910, idle_age=1602, priority=50,reg6=0x1,metadata=0x1 actions=resubmit(,17)
cookie=0x0, duration=2236.407s, table=16, n_packets=3, n_bytes=238, idle_age=1674, priority=50,reg6=0x1,metadata=0x2 actions=resubmit(,17)
cookie=0x0, duration=2236.400s, table=16, n_packets=0, n_bytes=0, idle_age=2236, priority=50,reg6=0x2,metadata=0x2 actions=resubmit(,17)
cookie=0x0, duration=2236.385s, table=16, n_packets=0, n_bytes=0, idle_age=2236, priority=50,reg6=0x2,metadata=0x1 actions=resubmit(,17)
cookie=0x0, duration=2236.429s, table=17, n_packets=19, n_bytes=910, idle_age=1602, priority=0,metadata=0x1 actions=resubmit(,18)
cookie=0x0, duration=2236.407s, table=17, n_packets=3, n_bytes=238, idle_age=1674, priority=0,metadata=0x2 actions=resubmit(,18)
cookie=0x0, duration=2236.429s, table=18, n_packets=19, n_bytes=910, idle_age=1602, priority=0,metadata=0x1 actions=resubmit(,19)
cookie=0x0, duration=2236.407s, table=18, n_packets=3, n_bytes=238, idle_age=1674, priority=0,metadata=0x2 actions=resubmit(,19)
cookie=0x0, duration=2236.429s, table=19, n_packets=16, n_bytes=672, idle_age=1602, priority=100,metadata=0x1,dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=load:0xffff-
>NXM_NX_REG7[],resubmit(,32)
cookie=0x0, duration=2236.407s, table=19, n_packets=0, n_bytes=0, idle_age=2236, priority=100,metadata=0x2,dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=load:0xffff-
>NXM_NX_REG7[],resubmit(,32)
cookie=0x0, duration=1744.254s, table=19, n_packets=0, n_bytes=0, idle_age=1744, priority=50,metadata=0x1,dl_dst=62:1a:d6:91:49:3d actions=load:0x1->NXM_NX_REG7[],resubmit(,32)
cookie=0x0, duration=1744.240s, table=19, n_packets=0, n_bytes=0, idle_age=1744, priority=50,metadata=0x2,dl_dst=ae:de:c6:a4:f9:e4 actions=load:0x1->NXM_NX_REG7[],resubmit(,32)
cookie=0x0, duration=1744.225s, table=19, n_packets=3, n_bytes=238, idle_age=1674, priority=50,metadata=0x2,dl_dst=c2:5b:26:02:7f:87 actions=load:0x2->NXM_NX_REG7[],resubmit(,32)
cookie=0x0, duration=1742.714s, table=19, n_packets=3, n_bytes=238, idle_age=1611, priority=50,metadata=0x1,dl_dst=92:89:78:df:69:c9 actions=load:0x2->NXM_NX_REG7[],resubmit(,32)
cookie=0x0, duration=1701.198s, table=32, n_packets=0, n_bytes=0, idle_age=1701, priority=100,reg7=0xffff,metadata=0x2 actions=load:0x2-
>NXM_NX_TUN_ID[0..23],set_field:0xffff/0xffffffff->tun_metadata0,move:NXM_NX_REG6[0..14]->NXM_NX_TUN_METADATA0[16..30],output:1,resubmit(,33)
cookie=0x0, duration=1701.198s, table=32, n_packets=3, n_bytes=238, idle_age=1674, priority=100,reg7=0x2,metadata=0x2 actions=load:0x2->NXM_NX_TUN_ID[0..23],set_field:0x2/0xffffffff-
>tun_metadata0,move:NXM_NX_REG6[0..14]->NXM_NX_TUN_METADATA0[16..30],output:1
cookie=0x0, duration=1701.178s, table=32, n_packets=3, n_bytes=238, idle_age=1611, priority=100,reg7=0x2,metadata=0x1 actions=load:0x1->NXM_NX_TUN_ID[0..23],set_field:0x2/0xffffffff-
>tun_metadata0,move:NXM_NX_REG6[0..14]->NXM_NX_TUN_METADATA0[16..30],output:1
... snip ...