Reviewed: https://review.openstack.org/557908 Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=7b0f6330d6f877f3d2093a64c2bca4c14334574c Submitter: Zuul Branch: master
commit 7b0f6330d6f877f3d2093a64c2bca4c14334574c Author: Sławek Kapłoński <sla...@kaplonski.pl> Date: Fri Mar 30 10:24:59 2018 +0200 Handle AgentNotFoundByTypeHost exception properly During listing router_ids on host it is possible that on some hosts there are no L3 agents. In such case AgentNotFoundByTypeHost exception is raised in neutron.db.agents_db module in _get_agent_by_type_and_host() method. Now this exception is properly handled during listing routers on host. Change-Id: Ia5ff1b57ef63c98b4ada4f2d46c45336e413be3d Closes-Bug: #1737917 ** Changed in: neutron Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron. https://bugs.launchpad.net/bugs/1737917 Title: NeutronServerTrytoFindL3agentOnComputeNodewhenWeUseLinuxBridge Status in neutron: Fix Released Bug description: Hi all Cool Developer of Openstack,I followed the pike install doc and successful running openstack now,and In Neutron configuration section,Verify operation Networking Option 2: Self-service networks(I choosed Self-Servrice network to deploy on Centos7x64 everything up to date)there we see: The output should indicate four agents on the controller node and one agent on each compute node. $ openstack network agent list +--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+ | ID | Agent Type | Host | Availability Zone | Alive | State | Binary | +--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+ | f49a4b81-afd6-4b3d-b923-66c8f0517099 | Metadata agent | controller | None | True | UP | neutron-metadata-agent | | 27eee952-a748-467b-bf71-941e89846a92 | Linux bridge agent | controller | None | True | UP | neutron-linuxbridge-agent | | 08905043-5010-4b87-bba5-aedb1956e27a | Linux bridge agent | compute1 | None | True | UP | neutron-linuxbridge-agent | | 830344ff-dc36-4956-84f4-067af667a0dc | L3 agent | controller | nova | True | UP | neutron-l3-agent | | dd3644c9-1a3a-435a-9282-eb306b4b0391 | DHCP agent | controller | nova | True | UP | neutron-dhcp-agent | +--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+ and I run this command on controller node too after setup and configuration for openstack is over and then got this output: [root@controller neutron]# openstack network agent list +--------------------------------------+--------------------+------------+------ -------------+-------+-------+---------------------------+ | ID | Agent Type | Host | Avail ability Zone | Alive | State | Binary | +--------------------------------------+--------------------+------------+------ -------------+-------+-------+---------------------------+ | 010608cc-01cf-4143-97d7-df617aaf2ac1 | Linux bridge agent | compute1 | None | :-) | UP | neutron-linuxbridge-agent | | 09cd7c61-b874-44a2-afd1-691bedbb8a97 | Metadata agent | controller | None | :-) | UP | neutron-metadata-agent | | 865bcc2f-183f-4c3a-8b05-b6724beca5f0 | L3 agent | controller | nova | :-) | UP | neutron-l3-agent | | 960a7d2c-5345-4245-8494-3adf885a61ff | DHCP agent | controller | nova | :-) | UP | neutron-dhcp-agent | | c2bb1518-817a-4d6e-a159-7ac01858f874 | Linux bridge agent | controller | None | :-) | UP | neutron-linuxbridge-agent | +--------------------------------------+--------------------+------------+------ -------------+-------+-------+---------------------------+ seems running normally just like what we got in offical docs.and ip netns on controller: [root@controller neutron]# ip netns exec qrouter-89466cea-7d58-4a45-92da-e636c0 958358 ping -c 5 www.bing.com PING cn-0001.cn-msedge.net (202.89.233.100) 56(84) bytes of data. 64 bytes from 202.89.233.100 (202.89.233.100): icmp_seq=1 ttl=115 time=31.6 ms 64 bytes from 202.89.233.100 (202.89.233.100): icmp_seq=2 ttl=115 time=31.5 ms 64 bytes from 202.89.233.100 (202.89.233.100): icmp_seq=3 ttl=115 time=31.4 ms 64 bytes from 202.89.233.100 (202.89.233.100): icmp_seq=4 ttl=115 time=32.4 ms 64 bytes from 202.89.233.100 (202.89.233.100): icmp_seq=5 ttl=115 time=31.8 ms --- cn-0001.cn-msedge.net ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4003ms rtt min/avg/max/mdev = 31.490/31.810/32.405/0.397 ms [root@controller neutron]# ip netns qrouter-89466cea-7d58-4a45-92da-e636c0958358 (id: 2) qdhcp-fca97929-aed3-45dc-9f19-f7ead767fbc3 (id: 0) qdhcp-c08c44ed-d71e-4acb-b1a5-3ebc4715a01d (id: 1) and every virtual machine on openstack runs perfectly(self network or provider network,access to Internet),except one day I log into compute node,and found the linuxbridge.log seems too big(over 300mb),quickly I use grep to filter out most INFO information and got so many ERROR log like this(also the only one type of error happens every fix period): 2017-12-13 17:23:16.030 1334 INFO neutron.agent.securitygroups_rpc [req-7fbf230a -bf45-4817-a7e8-447005e1700a - - - - -] Security group member updated [u'626f761 f-7451-42cf-afbf-724da51190c0'] 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt [req-7fbf230a-bf45-4817-a7e8-447005e1700a - - - - -] Error occurred while rem oving port tapa97e89f4-2d: RemoteError: Remote error: AgentNotFoundByTypeHost Ag ent with agent_type=L3 agent and host=compute1 could not be found [u'Traceback (most recent call last):\n', u' File "/usr/lib/python2.7/site-pack ages/oslo_messaging/rpc/server.py", line 160, in _process_incoming\n res = se lf.dispatcher.dispatch(message)\n', u' File "/usr/lib/python2.7/site-packages/o slo_messaging/rpc/dispatcher.py", line 213, in dispatch\n return self._do_dis patch(endpoint, method, ctxt, args)\n', u' File "/usr/lib/python2.7/site-packag es/oslo_messaging/rpc/dispatcher.py", line 183, in _do_dispatch\n result = fu nc(ctxt, **new_args)\n', u' File "/usr/lib/python2.7/site-packages/neutron/plug ins/ml2/rpc.py", line 234, in update_device_down\n n_const.PORT_STATUS_DOWN, host)\n', u' File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/rpc.py" , line 331, in notify_l2pop_port_wiring\n l2pop_driver.obj.update_port_down(p ort_context)\n', u' File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/ drivers/l2pop/mech_driver.py", line 253, in update_port_down\n admin_context, agent_host, [port[\'device_id\']]):\n', u' File "/usr/lib/python2.7/site-packa ges/neutron/db/l3_agentschedulers_db.py", line 303, in list_router_ids_on_host\n context, constants.AGENT_TYPE_L3, host)\n', u' File "/usr/lib/python2.7/sit e-packages/neutron/db/agents_db.py", line 291, in _get_agent_by_type_and_host\n host=host)\n', u'AgentNotFoundByTypeHost: Agent with agent_type=L3 agent and host=compute1 could not be found\n']. 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt Traceback (most recent call last): 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/agent/_c ommon_agent.py", line 336, in treat_devices_removed 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt cfg.CONF.host) 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt File "/usr/lib/python2.7/site-packages/neutron/agent/rpc.py", line 139, in update_device_down 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt agent_id=agent_id, host=host) 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt File "/usr/lib/python2.7/site-packages/neutron/common/rpc.py", line 162, in call 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt return self._original_context.call(ctxt, method, **kwargs) 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/client.py", line 169, in call 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt retry=self.retry) 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt File "/usr/lib/python2.7/site-packages/oslo_messaging/transport.py", line 1 23, in _send 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt timeout=timeout, retry=retry) 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt File "/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.p y", line 578, in send 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt retry=retry) 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt File "/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.p y", line 569, in _send 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt raise result 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt RemoteError: Remote error: AgentNotFoundByTypeHost Agent with agent_type=L3 a gent and host=compute1 could not be found 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt [u'Traceback (most recent call last):\n', u' File "/usr/lib/python2.7/site-p ackages/oslo_messaging/rpc/server.py", line 160, in _process_incoming\n res = self.dispatcher.dispatch(message)\n', u' File "/usr/lib/python2.7/site-package s/oslo_messaging/rpc/dispatcher.py", line 213, in dispatch\n return self._do_ dispatch(endpoint, method, ctxt, args)\n', u' File "/usr/lib/python2.7/site-pac kages/oslo_messaging/rpc/dispatcher.py", line 183, in _do_dispatch\n result = func(ctxt, **new_args)\n', u' File "/usr/lib/python2.7/site-packages/neutron/p lugins/ml2/rpc.py", line 234, in update_device_down\n n_const.PORT_STATUS_DOW N, host)\n', u' File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/rpc. py", line 331, in notify_l2pop_port_wiring\n l2pop_driver.obj.update_port_dow n(port_context)\n', u' File "/usr/lib/python2.7/site-packages/neutron/plugins/m l2/drivers/l2pop/mech_driver.py", line 253, in update_port_down\n admin_conte xt, agent_host, [port[\'device_id\']]):\n', u' File "/usr/lib/python2.7/site-pa ckages/neutron/db/l3_agentschedulers_db.py", line 303, in list_router_ids_on_hos t\n context, constants.AGENT_TYPE_L3, host)\n', u' File "/usr/lib/python2.7/ site-packages/neutron/db/agents_db.py", line 291, in _get_agent_by_type_and_host \n host=host)\n', u'AgentNotFoundByTypeHost: Agent with agent_type=L3 agent a nd host=compute1 could not be found\n']. 2017-12-13 17:23:16.172 1334 ERROR neutron.plugins.ml2.drivers.agent._common_age nt 2017-12-13 17:23:16.174 1334 INFO neutron.plugins.ml2.drivers.agent._common_agen t [req-7fbf230a-bf45-4817-a7e8-447005e1700a - - - - -] Attachment tap8d780fbe-84 removed 2017-12-13 17:23:16.218 1334 INFO neutron.plugins.ml2.drivers.agent._common_agen t [req-7fbf230a-bf45-4817-a7e8-447005e1700a - - - - -] Port tap8d780fbe-84 updat ed. 2017-12-13 17:23:16.218 1334 INFO neutron.plugins.ml2.drivers.agent._common_agen t [req-7fbf230a-bf45-4817-a7e8-447005e1700a - - - - -] Attachment tap3ca9698e-61 removed Here we see "AgentNotFoundByTypeHost: Agent with agent_type=L3 agent a nd host=compute1 could not be found\n" So I come back to the compute node neutron configration section to check if there was setup l3 agent on compute node I was missing,But checked and found there never mentions that we need to install l3 agent on compute node. I googled these keywords and found only a little posts about this problem,and most posts was about dhcp agent cannot found or old release of openstack,so Is there a bug on neutron what should I do to avoid this,should I install l3 agent on compute node or just ignore this error info since all VMs runns as usual? ----------------------------------- Release: 11.0.3.dev21 on 2017-12-11 21:40 SHA: 1caba2d2e0f5c9752a858f28957d7dbb33640180 Source: https://git.openstack.org/cgit/openstack/neutron/tree/doc/source/install/verify-option2.rst URL: https://docs.openstack.org/neutron/pike/install/verify-option2.html To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/1737917/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp