[openstack-dev] [neutron] How could an L2 agent extension access agent methods ?
Ihar Hrachyshka
ihrachys at redhat.com
Wed Sep 30 10:26:22 UTC 2015
> On 30 Sep 2015, at 12:08, thomas.morin at orange.com wrote:
>
> Hi Ihar,
>
> Ihar Hrachyshka :
>>> Miguel Angel Ajo :
>>>> Do you have a rough idea of what operations you may need to do?
>>> Right now, what bagpipe driver for networking-bgpvpn needs to interact with is:
>>> - int_br OVSBridge (read-only)
>>> - tun_br OVSBridge (add patch port, add flows)
>>> - patch_int_ofport port number (read-only)
>>> - local_vlan_map dict (read-only)
>>> - setup_entry_for_arp_reply method (called to add static ARP entries)
>>>
>> Sounds very tightly coupled to OVS agent.
>
>>
>>>> Please bear in mind, the extension interface will be available from different agent types
>>>> (OVS, SR-IOV, [eventually LB]), so this interface you're talking about could also serve as
>>>> a translation driver for the agents (where the translation is possible), I totally understand
>>>> that most extensions are specific agent bound, and we must be able to identify
>>>> the agent we're serving back exactly.
>>> Yes, I do have this in mind, but what we've identified for now seems to be OVS specific.
>> Indeed it does. Maybe you can try to define the needed pieces in high level actions, not internal objects you need to access to. Like ‘- connect endpoint X to Y’, ‘determine segmentation id for a network’ etc.
>
> I've been thinking about this, but would tend to reach the conclusion that the things we need to interact with are pretty hard to abstract out into something that would be generic across different agents. Everything we need to do in our case relates to how the agents use bridges and represent networks internally: linuxbridge has one bridge per Network, while OVS has a limited number of bridges playing different roles for all networks with internal segmentation.
>
> To look at the two things you mention:
> - "connect endpoint X to Y" : what we need to do is redirect the traffic destinated to the gateway of a Neutron network, to the thing that will do the MPLS forwarding for the right BGP VPN context (called VRF), in our case br-mpls (that could be done with an OVS table too) ; that action might be abstracted out to hide the details specific to OVS, but I'm not sure on how to name the destination in a way that would be agnostic to these details, and this is not really relevant to do until we have a relevant context in which the linuxbridge would pass packets to something doing MPLS forwarding (OVS is currently the only option we support for MPLS forwarding, and it does not really make sense to mix linuxbridge for Neutron L2/L3 and OVS for MPLS)
> - "determine segmentation id for a network": this is something really OVS-agent-specific, the linuxbridge agent uses multiple linux bridges, and does not rely on internal segmentation
>
> Completely abstracting out packet forwarding pipelines in OVS and linuxbridge agents would possibly allow defining an interface that agent extension could use without to know about anything specific to OVS or the linuxbridge, but I believe this is a very significant taks to tackle.
If you look for a clean way to integrate with reference agents, then it’s something that we should try to achieve. I agree it’s not an easy thing.
Just an idea: can we have a resource for traffic forwarding, similar to security groups? I know folks are not ok with extending security groups API due to compatibility reasons, so maybe fwaas is the place to experiment with it.
>
> Hopefully it will be acceptable to create an interface, even it exposes a set of methods specific to the linuxbridge agent and a set of methods specific to the OVS agent. That would mean that the agent extension that can work in both contexts (not our case yet) would check the agent type before using the first set or the second set.
The assumption of the whole idea of l2 agent extensions is that they are agent agnostic. In case of QoS, we implemented a common QoS extension that can be plugged in any agent [1], and a set of backend drivers (atm it’s just sr-iov [2] and ovs [3]) that are selected based on the driver type argument passed into the extension manager [4][5]. Your extension could use similar approach to select the backend.
[1]: https://git.openstack.org/cgit/openstack/neutron/tree/neutron/agent/l2/extensions/qos.py#n169
[2]: https://git.openstack.org/cgit/openstack/neutron/tree/neutron/plugins/ml2/drivers/mech_sriov/agent/extension_drivers/qos_driver.py
[3]: https://git.openstack.org/cgit/openstack/neutron/tree/neutron/plugins/ml2/drivers/openvswitch/agent/extension_drivers/qos_driver.py
[4]: https://git.openstack.org/cgit/openstack/neutron/tree/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py#n395
[5]: https://git.openstack.org/cgit/openstack/neutron/tree/neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py#n155
>
> Does this approach make sense ?
>
> -Thomas
>
> _________________________________________________________________________________________________________________________
>
> Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
> pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
> a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
> Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
>
> This message and its attachments may contain confidential or privileged information that may be protected by law;
> they should not be distributed, used or copied without authorisation.
> If you have received this email in error, please notify the sender and delete this message and its attachments.
> As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
> Thank you.
Note that you should really avoid putting that ^^ kind of signature into your emails intended for public mailing lists. If it’s confidential, why do you send it to everyone? And sorry, folks will copy it without authorisation, for archiving and indexing reasons and whatnot.
Ihar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150930/9767e81e/attachment.pgp>
More information about the OpenStack-dev
mailing list