Re: example of mapping ovs interfaces of tenant vm to neutron port, subnet, tenant id

Richard Woo <richardwoo2003@...>

Thanks, Flavio, I tried it. These tools are awesome! 

On Thu, Jul 16, 2015 at 10:45 PM, Flavio Fernandes <ffernand@...> wrote:
Hi folks,

I was asked for an example dump of an openstack config on ovsdb netvirt and how one can piece mail the ovs ports
to the overlay network that goes with it.

For that, I ‘devstacked' 3 nodes using my one trick pony github [1] repo. ;)

Then, I created 2 tenants with 2 internal subnets and put 2 vms in each with floating ips.

The output of operational tree using my handy tool [3] looked like this [4] ([5] with flows).

The output from neutron’s rest interface gave me this [6].

Pulling the string for a tenant port in openstack compute node —as an example-- you can see that:

* lines 14, 15, 30, 31, 37 and 40 from [4] represent the tunnel ports that interconnect the openstack nodes

* line 42 from [4] is:  of:6   tapbd8efa88-36   mac:fa:16:3e:fb:d9:bf   ifaceId:bd8efa88-3665-409a-a7fa-47663a9089b2.
 So, the tenant vm that owns that port is in compute node 

  br-int in that node is aka openflow:191757013640004 (charlie)

  If you search for ‘47663a9089b2’ in [6], you will find it belongs to neutron port that has address and
  belongs to subnet id 8daa2590-67d9-45c1-b956-f820aa5dba43. That is on line 691 of [6].

  Furthermore you can see that it belongs to tenant 33d676feac934d98a809eadfd8e5e985, mentioned in line 702.
* with that, you can connect the dots and find all neutron ports that belong to a certain subnet / tenant, as well as the bridge
  and openstack nodes they are located.

These where the curl commands that dumped me the crud tables in neutron northbound [7]. I’m pretty sure that can be obtained
via mdsal’s restconf too, but I am not too familiar with that yet.

Hope this helps. :)

— flavio


$ ./ -f
alpha -> openflow:50647211443526
bravo -> openflow:8796758886516
charlie -> openflow:191757013640004
delta -> openflow:8796757453186
echo -> openflow:68498488746567
foxtrot -> openflow:8796764052230
ovsdbNode: mgr: version:2.3.2
of:1 tap165bbfcf-50 mac:fa:16:3e:43:d0:5f ifaceId:165bbfcf-50ec-4e33-b978-5e2310097403
of:2 patch-ext
of:3 vxlan-
of:4 vxlan-
of:5 tap207df591-ca mac:fa:16:3e:97:c3:a5 ifaceId:207df591-ca7f-4da3-b156-5af408b14ac7
of:6 tapce6a55b8-6f mac:fa:16:3e:bd:aa:21 ifaceId:ce6a55b8-6f6b-419a-814c-7075f22d0fe3
of:7 tap79cb76bd-d9 mac:fa:16:3e:b3:52:57 ifaceId:79cb76bd-d959-44bf-b203-1af6f55def8d
of:8 tap412bb62b-48 mac:fa:16:3e:8a:5c:3b ifaceId:412bb62b-48ba-454e-b370-207fd550f12b
of:9 tap5f960323-fc mac:fa:16:3e:b8:26:17 ifaceId:5f960323-fcaa-4b6a-aea7-f25c579fa909
of:10 tape713da3b-5e mac:fa:16:3e:83:11:af ifaceId:e713da3b-5e04-4496-b5a4-14aa8ebcd5f9
of:1 eth2
of:2 patch-int
ovsdbNode: mgr: version:2.3.2
of:1 eth2
of:2 patch-int
of:1 vxlan-
of:2 vxlan-
of:3 tap055b988d-4e mac:fa:16:3e:50:48:1c ifaceId:055b988d-4e4c-48f9-a479-50b725c10655
of:4 patch-ext
of:5 tap70290b63-bc mac:fa:16:3e:18:1c:64 ifaceId:70290b63-bc50-4191-bf00-55f1b9794ef8
ovsdbNode: mgr: version:2.3.2
of:1 vxlan-
of:2 tapbce1a32b-3b mac:fa:16:3e:92:06:83 ifaceId:bce1a32b-3b4b-4ba1-a05b-b157989abccb
of:3 patch-ext
of:4 vxlan-
of:5 tap2c38c301-52 mac:fa:16:3e:2c:6b:e0 ifaceId:2c38c301-526a-49b0-b4d6-5c74cb7e5c22
of:6 tapbd8efa88-36 mac:fa:16:3e:fb:d9:bf ifaceId:bd8efa88-3665-409a-a7fa-47663a9089b2
of:1 eth2
of:2 patch-int
ofLinks (discover via lldp):
charlie:1 <-> alpha:4
charlie:3 <-> foxtrot:2
charlie:4 <-> echo:2
alpha:2 <-> bravo:2
alpha:3 <-> echo:1
echo:4 <-> delta:2
delta:1 -> bravo:1
bravo:1 <-> foxtrot:1

ovsdb-dev mailing list

Join to automatically receive all group messages.