<div dir="ltr"><div><div><div>Bob,<br><br></div>Thanks for your detailed response. In it you "strongly recommend that any functionality trying to make decisions
based on connectivity do so by calling into the registered mechanism
drivers, so they can decide whether whatever they manage has
connectivity". After eading this I went through the mechanism driver API definition (currently at <a href="http://git.openstack.org/cgit/openstack/neutron/tree/neutron/plugins/ml2/driver_api.py#n549">http://git.openstack.org/cgit/openstack/neutron/tree/neutron/plugins/ml2/driver_api.py#n549</a>). The only method and the API that seems to be useful to implement your recommendation isĀ filter_hosts_with_segment_access (currently at line 914). Is this method the right way to go?<br><br></div><code>Thanks<br><br></code></div><code>Miguel<br></code></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 29, 2016 at 4:47 PM, Robert Kukura <span dir="ltr"><<a href="mailto:kukura@noironetworks.com" target="_blank">kukura@noironetworks.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
My answers below are from the perspective of normal (non-routed)
networks implemented in ML2. The support for routed networks should
build on this without breaking it.<span class=""><br>
<br>
<div>On 3/29/16 3:38 PM, Miguel Lavalle
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>Hi,<br>
<br>
</div>
I am writing a patchset to build a mapping between hosts
and network segments. The goal of this mapping is to be
able to say whether a host has access to a given network
segment. I am building this mapping assuming that if a
host A has a bridges mapping containing 'physnet 1' and a
segment has 'physnet 1' in its 'physical_network'
attribute, then the host has access to that segment.<br>
<br>
</div>
1) Is this assumption correct? Looking at method
check_segment_for_agent in <a href="http://git.openstack.org/cgit/openstack/neutron/tree/neutron/plugins/ml2/drivers/mech_agent.py#n180" target="_blank">http://git.openstack.org/cgit/openstack/neutron/tree/neutron/plugins/ml2/drivers/mech_agent.py#n180</a>
seems to me to suggest that my assumption is correct?<br>
</div>
</div>
</div>
</blockquote></span>
This is true for certain agent-based mechanism drivers, but cannot
be assumed to be the case for all mechanism drivers (even all those
that use agents. Any use of mapping info (i.e. from agents_db or
elsewhere) is specific to an individual mechanism driver. I'd
strongly recommend that any functionality trying to make decisions
based on connectivity do so by calling into the registered mechanism
drivers, so they can decide whether whatever they manage has
connectivity.<br>
<br>
Also note that connectivity may involve hierarchical port binding,
in which case you really need to try to bind a port to determine if
you have connectivity. I'm not suggesting that there is a
requirement to mix HPB and routed networks, but please try not to
build assumptions into ML2 plugin code that don't work with HPB or
that are only valid for a subset of mechanism drivers.<span class=""><br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div><br>
</div>
2) Furthermore, when a segment is mapped to a physical
network, is there a one to one relationship between segments
and physical nets?<br>
</div>
</div>
</blockquote></span>
Certainly different virtual networks can map to different segments
(i.e. VLANs) on the same physical network. It is even possible for
the same virtual network to have multiple segments on the same
physical network.<br>
<br>
-Bob<br>
<blockquote type="cite">
<div dir="ltr">
<div><br>
</div>
Thanks<br>
</div><span class="">
<br>
<fieldset></fieldset>
<br>
<pre>__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: <a href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a>
</pre>
</span></blockquote>
<br>
</div>
<br>__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>