<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div dir="ltr">Hi Irena,<br>
      <br>
      Irena Berezovsky :<br>
      > I would like to second  Kevin. This can be done in a similar
      way as ML2 Plugin passed plugin_context <br>
      > to ML2 Extension Drivers:
<a class="moz-txt-link-freetext" href="https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/driver_api.py#L910">https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/driver_api.py#L910</a>.<br>
      <br>
      Yes, this would be similar and could indeed be named agent_context
      .<br>
      <br>
      However, contrarily to ML2 plugin which provides a context when
      calling most driver methods, I don't think that here we would need
      a context to be passed at each call of an
      AgentCoreResourceExtension, providing a interface to hook to the
      agent at initialize seems enough to me.<br>
      <br>
      Thanks,<br>
      <br>
      -Thomas<br>
      <br>
      <br>
      <div>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Fri, Sep 25, 2015 at 11:57 AM,
            Kevin Benton <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:blak111@gmail.com" target="_blank">blak111@gmail.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              <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">
                  <div>
                    <div class="h5">On Fri, Sep 25, 2015 at 1:32 AM, <span
                        dir="ltr"><<a moz-do-not-send="true"
                          href="mailto:thomas.morin@orange.com"
                          target="_blank">thomas.morin@orange.com</a>></span>
                      wrote:<br>
                    </div>
                  </div>
                  <blockquote class="gmail_quote" style="margin:0px 0px
                    0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                    <div>
                      <div class="h5">
                        <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 moz-do-not-send="true"
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 moz-do-not-send="true"
                                href="https://review.openstack.org/#/c/195439/"
                                target="_blank">https://review.openstack.org/#/c/195439/</a><br>
                              [3] <a moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true"
                                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>
                      </div>
                    </div>
__________________________________________________________________________<br>
                    OpenStack Development Mailing List (not for usage
                    questions)<br>
                    Unsubscribe: <a moz-do-not-send="true"
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 moz-do-not-send="true"
                      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>
                <span class=""><font color="#888888"><br>
                    <br clear="all">
                    <div><br>
                    </div>
                    -- <br>
                    <div>
                      <div>Kevin Benton</div>
                    </div>
                  </font></span></div>
              <br>
__________________________________________________________________________<br>
              OpenStack Development Mailing List (not for usage
              questions)<br>
              Unsubscribe: <a moz-do-not-send="true"
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 moz-do-not-send="true"
                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>
      </div>
    </div>
    <blockquote
cite="mid:CALqgCCodFKCp_ar5M6+9b9Ngiqf1qc6Rk-SKrF2GBYzc9f2CMw@mail.gmail.com"
      type="cite">
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: <a class="moz-txt-link-abbreviated" href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a>
<a class="moz-txt-link-freetext" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a>
</pre>
    </blockquote>
    <br>
  <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></body>
</html>