NTNX>日記

個人的な趣味による Nutanix Community Edition 日記。Japanese のみですみません。

Nutanix CE の IPAM で Open vSwitch の様子を見てみる。

Nutanix の IPAM(IP アドレス管理)機能を有効化した際の、AHV Open vSwitch の様子を見てみます。

今回も、下記の投稿と同じ環境を利用しています。

今回は、CVM でコマンドを実行しています。

仮想ネットワーク「nw-vlan-11-ipam」では、IPAM を有効化してあります。

nutanix@NTNX-624676c4-A-CVM:192.168.20.52:~$ acli net.get nw-vlan-11-ipam
nw-vlan-11-ipam {
  identifier: 11
  ip_config {
    dhcp_option_list {
      option_code: 15
      option_name: "domain"
      option_value: "go-lab.jp"
    }
    dhcp_option_list {
      option_code: 6
      option_name: "dns"
      option_value: "192.168.1.101, 192.168.1.102"
    }
    dhcp_option_list {
      option_code: 119
      option_name: "search_domains"
      option_value: "go-lab.jp"
    }
    dhcp_server_address: "192.168.11.254"
    ip_pool_list {
      end_address: "192.168.11.199"
      start_address: "192.168.11.100"
    }
    network_address: "192.168.11.0"
    prefix_length: 24
    route_list {
      gateway: "192.168.11.1"
      network_address: "0.0.0.0"
      prefix_length: 0
    }
  }
  logical_timestamp: 352
  name: "nw-vlan-11-ipam"
  type: "kBridged"
  uuid: "90a388c2-fbfd-4ca1-aead-35a1611f7862"
}

VM を作成して、nw-vlan-11-ipam ネットワークに接続する vNIC を追加します。

nutanix@NTNX-624676c4-A-CVM:192.168.20.52:~$ acli vm.create test-vm-01
test-vm-01: pending
test-vm-01: complete
nutanix@NTNX-624676c4-A-CVM:192.168.20.52:~$ acli vm.nic_create test-vm-01 network=nw-vlan-11-ipam
NicCreate: pending
NicCreate: complete

IP アドレス プールは CVM が管理しているので、この時点で IP アドレスが払い出されています。

nutanix@NTNX-624676c4-A-CVM:192.168.20.52:~$ acli vm.nic_list test-vm-01
NIC UUID                              MAC Address        IP Address      Network UUID                          Network Name
0a506e33-ccb3-4adf-b335-de6e6ebf514b  50:6b:8d:8d:14:3b  192.168.11.184  90a388c2-fbfd-4ca1-aead-35a1611f7862  nw-vlan-11-ipam

この時点での、br0 ブリッジの OpenFlow ルールです。

nutanix@NTNX-624676c4-A-CVM:192.168.20.52:~$ ssh root@192.168.5.1 ovs-ofctl dump-flows br0
FIPS mode initialized
Nutanix AHV
NXST_FLOW reply (xid=0x4):
 cookie=0x0, duration=8740027.648s, table=0, n_packets=0, n_bytes=0, idle_age=65534, hard_age=65534, priority=42,dl_type=0x9000 actions=drop
 cookie=0x0, duration=8740027.649s, table=0, n_packets=43300073, n_bytes=14007103473, idle_age=0, hard_age=65534, priority=41,in_port=5 actions=resubmit(,3)
 cookie=0x0, duration=8740336.525s, table=0, n_packets=3650, n_bytes=1235422, idle_age=65534, hard_age=65534, priority=0 actions=NORMAL
 cookie=0x0, duration=8740027.649s, table=0, n_packets=336024438, n_bytes=119540845952, idle_age=0, hard_age=65534, priority=40 actions=resubmit(,3)
 cookie=0x0, duration=8740027.648s, table=3, n_packets=1030956, n_bytes=43300152, idle_age=9, hard_age=65534, priority=1,arp,in_port=5 actions=NORMAL,output:4
 cookie=0x0, duration=8740027.648s, table=3, n_packets=132, n_bytes=42150, idle_age=1732, hard_age=65534, priority=1,udp,in_port=5,tp_dst=67 actions=NORMAL,output:4
 cookie=0x0, duration=8740027.648s, table=3, n_packets=316, n_bytes=129866, idle_age=1732, hard_age=65534, priority=1,udp,tp_dst=68 actions=NORMAL,output:4
 cookie=0x0, duration=8740027.649s, table=3, n_packets=378293037, n_bytes=133504453683, idle_age=0, hard_age=65534, priority=0 actions=NORMAL

VM をパワーオンします。

nutanix@NTNX-624676c4-A-CVM:192.168.20.52:~$ acli vm.on test-vm-01
test-vm-01: pending
test-vm-01: complete

この時点での、br0 ブリッジの OpenFlow ルールです。ポート 5 からの VLAN ID 11(0x000b)通信を対象にするルールが追加されました。br0 のポート 5 は、

nutanix@NTNX-624676c4-A-CVM:192.168.20.52:~$ ssh root@192.168.5.1 ovs-ofctl dump-flows br0
FIPS mode initialized
Nutanix AHV
NXST_FLOW reply (xid=0x4):
 cookie=0x0, duration=8740066.105s, table=0, n_packets=0, n_bytes=0, idle_age=65534, hard_age=65534, priority=42,dl_type=0x9000 actions=drop
 cookie=0x0, duration=8740066.106s, table=0, n_packets=43300226, n_bytes=14007118366, idle_age=0, hard_age=65534, priority=41,in_port=5 actions=resubmit(,3)
 cookie=0x0, duration=8740374.982s, table=0, n_packets=3650, n_bytes=1235422, idle_age=65534, hard_age=65534, priority=0 actions=NORMAL
 cookie=0x0, duration=8740066.106s, table=0, n_packets=336025861, n_bytes=119541250802, idle_age=0, hard_age=65534, priority=40 actions=resubmit(,3)
 cookie=0x0, duration=6.217s, table=3, n_packets=1, n_bytes=438, idle_age=2, priority=2,pkt_mark=0x2a00,udp,in_port=5,vlan_tci=0x000b/0x0fff,dl_dst=ff:ff:ff:ff:ff:ff,tp_dst=67 actions=output:6
 cookie=0x0, duration=8740066.105s, table=3, n_packets=1030964, n_bytes=43300488, idle_age=0, hard_age=65534, priority=1,arp,in_port=5 actions=NORMAL,output:4
 cookie=0x0, duration=8740066.105s, table=3, n_packets=132, n_bytes=42150, idle_age=1771, hard_age=65534, priority=1,udp,in_port=5,tp_dst=67 actions=NORMAL,output:4
 cookie=0x0, duration=8740066.105s, table=3, n_packets=317, n_bytes=130244, idle_age=2, hard_age=65534, priority=1,udp,tp_dst=68 actions=NORMAL,output:4
 cookie=0x0, duration=8740066.106s, table=3, n_packets=378294603, n_bytes=133504872274, idle_age=0, hard_age=65534, priority=0 actions=NORMAL

追加されたルールです。次の条件にマッチする通信が、br0 のポート 6 から送出(output:6)されます。

  • pkt_mark=0x2a00
  • udp
  • in_port=5(br0 のポート 5 からの通信)
  • vlan_tci=0x000b/0x0fff(VLAN ID 11)
  • dl_dst=ff:ff:ff:ff:ff:ff(宛先 MAC アドレスは ff:ff:ff:ff:ff:ff)
  • tp_dst=67(宛先ポートは 67/UDP)
nutanix@NTNX-624676c4-A-CVM:192.168.20.52:~$ ssh root@192.168.5.1 ovs-ofctl dump-flows br0 vlan_tci=0x000b/0x0fff
FIPS mode initialized
Nutanix AHV
NXST_FLOW reply (xid=0x4):
 cookie=0x0, duration=27.666s, table=3, n_packets=3, n_bytes=1326, idle_age=11, priority=2,pkt_mark=0x2a00,udp,in_port=5,vlan_tci=0x000b/0x0fff,dl_dst=ff:ff:ff:ff:ff:ff,tp_dst=67 actions=output:6

br0 のポート 5 (br0.u)の接続先には、IPAM を利用するユーザー VM の vNIC があります。ただし実際には、ユーザー VM の vNIC までに何段かブリッジ チェーンがあります。

ポート 6 は、br0-dhcp です。

nutanix@NTNX-624676c4-A-CVM:192.168.20.52:~$ ssh root@192.168.5.1 ovs-ofctl show br0
FIPS mode initialized
Nutanix AHV
OFPT_FEATURES_REPLY (xid=0x2): dpid:00001c697a630d37
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(eno1): addr:1c:69:7a:63:0d:37
     config:     0
     state:      0
     current:    1GB-FD COPPER AUTO_NEG
     advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
     supported:  10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
     speed: 1000 Mbps now, 1000 Mbps max
 2(vnet1): addr:fe:6b:8d:45:9a:90
     config:     0
     state:      0
     current:    10MB-FD COPPER
     speed: 10 Mbps now, 0 Mbps max
 3(vnet2): addr:fe:6b:8d:fd:8f:16
     config:     0
     state:      0
     current:    10MB-FD COPPER
     speed: 10 Mbps now, 0 Mbps max
 4(br0-arp): addr:6e:81:bf:fe:a4:e2
     config:     NO_FLOOD
     state:      0
     speed: 0 Mbps now, 0 Mbps max
 5(br0.u): addr:76:a9:7d:25:bf:0a
     config:     0
     state:      0
     speed: 0 Mbps now, 0 Mbps max
 6(br0-dhcp): addr:ae:1c:5c:a6:0a:07
     config:     NO_FLOOD
     state:      0
     speed: 0 Mbps now, 0 Mbps max
 LOCAL(br0): addr:1c:69:7a:63:0d:37
     config:     0
     state:      0
     speed: 0 Mbps now, 0 Mbps max
OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0

br0 の br0-dhcp ポートの先は、CVM の管理 IP アドレス宛の VXLAN になっています。この先に DHCP サーバ機能を提供する Acropolis があるはず・・・

nutanix@NTNX-624676c4-A-CVM:192.168.20.52:~$ ssh root@192.168.5.1 ovs-vsctl show | grep br0-dhcp -A2
FIPS mode initialized
Nutanix AHV
        Port "br0-dhcp"
            Interface "br0-dhcp"
                type: vxlan
                options: {key="1", remote_ip="192.168.20.52"}

以上。

©2023 gowatana
クリエイティブ・コモンズ・ライセンスこの 作品 は クリエイティブ・コモンズ 表示 4.0 国際 ライセンスの下に提供されています。