<div dir="ltr">I think the 4th of the options you proposed would be the best. We don't want to give agents direct access to the agent object or else we will run the risk of breaking extensions all of the time during any kind of reorganization or refactoring. Having a well defined API in between will give us flexibility to move things around. </div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 25, 2015 at 1:32 AM,  <span dir="ltr"><<a href="mailto:thomas.morin@orange.com" target="_blank">thomas.morin@orange.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">
    <div>
      <p>Hi everyone,<br>
      </p>
      <p>(TL;DR: we would like an L2 agent extension to be able to call
        methods on the agent class, e.g. OVSAgent)<br>
      </p>
      <p>In the networking-bgpvpn project, we need the reference driver
        to interact with the ML2 openvswitch agent with new RPCs to
        allow exchanging information with the BGP VPN implementation
        running on the compute nodes. We also need the OVS agent to
        setup specific things on the OVS bridges for MPLS traffic.</p>
      <p>To extend the agent behavior, we currently create a new agent
        by mimicking the main() in ovs_neutron_agent.py but instead
        of instantiating instantiate OVSAgent, with instantiate a class
        that overloads the OVSAgent class with the additional behavior
        we need [1] .<br>
      </p>
      <p>This is really not the ideal way of extending the agent, and we
        would prefer using the L2 agent extension framework [2].
      </p>
      <p>Using the L2 agent extension framework would work, but only
        partially: it would easily allos us to register our RPC
        consumers, but not to let us access to some
        datastructures/methods of the agent that we need to use: setup_entry_for_arp_reply
        and local_vlan_map, access to the OVSBridge objects to
        manipulate OVS ports.<br>
      </p>
      <p>I've filled-in an RFE bug to track this issue [5].</p>
      <p>We would like something like one of the following:<br>
        1) augment the L2 agent extension interface
        (AgentCoreResourceExtension) to give access to the agent object
        (and thus let the extension call methods of the agent) by giving
        the agent as a parameter of the initialize method [4]<br>
        2) augment the L2 agent extension interface
        (AgentCoreResourceExtension) to give access to the agent object
        (and thus let the extension call methods of the agent) by giving
        the agent as a parameter of a new setAgent method<br>
        3) augment the L2 agent extension interface
        (AgentCoreResourceExtension) to give access only to
        specific/chosen methods on the agent object, for instance by
        giving a dict as a parameter of the initialize method [4], whose
        keys would be method names, and values would be pointer to these
        methods on the agent object<br>
        4) define a new interface with methods to access things inside
        the agent, this interface would be implemented by an object
        instantiated by the agent, and that the agent would pass to the
        extension manager, thus allowing the extension manager to passe
        the object to an extension through the initialize method of
        AgentCoreResourceExtension [4]<br>
        <br>
        Any feedback on these ideas...?<br>
        Of course any other idea is welcome...<br>
        <br>
        For the sake of triggering reaction, the question could be
        rephrased as: if we submit a change doing (1) above, would it
        have a reasonable chance of merging ?<br>
      </p>
      <p>-Thomas<br>
        <br>
        [1] <a href="https://github.com/openstack/networking-bgpvpn/blob/master/networking_bgpvpn/neutron/services/service_drivers/bagpipe/ovs_agent/ovs_bagpipe_neutron_agent.py" target="_blank">https://github.com/openstack/networking-bgpvpn/blob/master/networking_bgpvpn/neutron/services/service_drivers/bagpipe/ovs_agent/ovs_bagpipe_neutron_agent.py</a><br>
        [2] <a href="https://review.openstack.org/#/c/195439/" target="_blank">https://review.openstack.org/#/c/195439/</a><br>
        [3] <a href="https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/drivers/openvswitch/agent/extension_drivers/qos_driver.py#L30" target="_blank">https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/drivers/openvswitch/agent/extension_drivers/qos_driver.py#L30</a><br>
        [4] <a href="https://github.com/openstack/neutron/blob/master/neutron/agent/l2/agent_extension.py#L28" target="_blank">https://github.com/openstack/neutron/blob/master/neutron/agent/l2/agent_extension.py#L28</a><br>
        [5] <a href="https://bugs.launchpad.net/neutron/+bug/1499637" target="_blank">https://bugs.launchpad.net/neutron/+bug/1499637</a><br>
        <br>
      </p>
    </div>
  <pre>_________________________________________________________________________________________________________________________

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.
</pre></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><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div>Kevin Benton</div></div>
</div>