On 04/24/2012 09:02 AM, Isaku Yamahata wrote:
> Cc to ryu-devel.
>
> On Tue, Apr 24, 2012 at 05:47:43AM -0000, Gary Kotton wrote:
>> Hi,
>> I found a number of problems with the Quantum agents. These happen when
>> the Quantum server is down (for example the host running the server is
>> rebooted).
>> I would like to update the RYU agent code to deal with these problems.
>> Are there uint tests that I can run to check this?
>> Thanks
> Thank you for testing! I'm afraid Ryu plugin has poor unit test for now.
> It's the area that we have to address. (patches are very welcome, off course)
Thanks for your prompt answer.
> Does the attached patch help?
No, now in all cases.
> Although it might not apply cleanly because it's for the gre demo tree,
> you get the idea.
> If you're seeing different issue, can you please elaborate on it?
In some cases when the host running the quantum server/plugin is down 
(for example it was rebooted), then the the daemon loop would exit with 
an exception when the db was accessed.

I have yet to update the ryu code (I updated the linuxbridge and ovs 
code). I'll send you updates to see if they are relevant.

Thanks
Gary

> thanks,
>
> commit a043d85c63d93d6812937c034640ebe892670c05
> Author: Isaku Yamahata<[email protected]>
> Date:   Tue Apr 10 11:56:07 2012 +0900
>
>      plugins/ryu/agent: fix exception
>
>      When starting up, the network is expected to be created by quantum 
> server.
>      However there is a race between quantum server startup and quantum agent
>      startup. So have agent also make the network.
>
>      Traceback (most recent call last):
>        File 
> "/opt/stack/quantum/quantum/plugins/ryu/agent/ryu_quantum_agent.py", line 
> 540, in<module>
>          main()
>        File 
> "/opt/stack/quantum/quantum/plugins/ryu/agent/ryu_quantum_agent.py", line 
> 534, in main
>          plugin.daemon_loop()
>        File 
> "/opt/stack/quantum/quantum/plugins/ryu/agent/ryu_quantum_agent.py", line 
> 490, in daemon_loop
>          self.gre_ports.update()
>        File 
> "/opt/stack/quantum/quantum/plugins/ryu/agent/ryu_quantum_agent.py", line 
> 367, in update
>          self._add_port(node)
>        File 
> "/opt/stack/quantum/quantum/plugins/ryu/agent/ryu_quantum_agent.py", line 
> 344, in _add_port
>          self.int_br.datapath_id, ofport)
>        File "/opt/stack/ryu/ryu/app/client.py", line 91, in create_port
>          self._do_request('POST', self.path_port % (network_id, dpid, port))
>        File "/opt/stack/ryu/ryu/app/client.py", line 55, in _do_request
>          res.getheaders(), res.read())
>      httplib.HTTPException: (<httplib.HTTPResponse instance at 0x25e7a28>, 
> 'code 404 reason Resource not found', [('date', 'Tue, 10 Apr 2012 02:26:03 
> GMT'), ('content-length', '466'), ('content-type', 'application/json')], 
> '{"displayError": "The server does not have data for the request.", "error": 
> "You submitted the following request.\\n\\n    POST 
> /v1.0/networks/__NW_ID_VPORT_GRE__/00004e7f48e36243_\\n\\nThis request is not 
> valid. The following paths were evaluated and failed\\nfor the indicated 
> reason.\\n\\n    - /networks/{network-id}/{dpid}_{port-id}\\n      Invalid 
> format: 00004e7f48e36243_\\n\\nYou can get a list of all valid requests with 
> the following request.\\n\\n    GET /v1.0/doc"}')
>
>      Signed-off-by: Isaku Yamahata<[email protected]>
>
> diff --git a/quantum/plugins/ryu/agent/ryu_quantum_agent.py 
> b/quantum/plugins/ryu/agent/ryu_quantum_agent.py
> index a46ff2b..78b2d9e 100755
> --- a/quantum/plugins/ryu/agent/ryu_quantum_agent.py
> +++ b/quantum/plugins/ryu/agent/ryu_quantum_agent.py
> @@ -321,6 +321,7 @@ class GREPortSet(object):
>       def setup(self):
>           _ovs_node_update(self.db, self.int_br.datapath_id, self.tunnel_ip)
>
> +        self.api.update_network(rest_nw_id.NW_ID_VPORT_GRE)
>           for port in self.int_br.get_gre_ports():
>               try:
>                   node = self.db.ovs_node.filter(
> @@ -385,6 +386,7 @@ class VifPortSet(object):
>           self.api.update_port(network_id, port.switch.datapath_id, 
> port.ofport)
>           if port.vif_mac is not None:
>               # external port doesn't have mac address
> +            self.api.update_network(network_id)
>               self.api.update_mac(network_id, port.switch.datapath_id,
>                                   port.ofport, port.vif_mac)
>           else:
>
>


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to