0%

openstack接口状态异常

错误信息

neutron错误日志Exit code: 2; Stdin: ; Stdout: ; Stderr: sudo: unable to resolve host pxea4badb2

问题现象

openstack的router中创建了一个联通两个vlan的路由器,发现两个接口轮流处于build状态

查看日志

  • /var/log/neutron/neutron-linuxbridge-agent.log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
115265 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent   File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
115266 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent six.reraise(self.type_, self.value, self.tb)
115267 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent File "/usr/lib/python2.7/dist-packages/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neut ron_agent.py", line 419, in add_tap_interface
115268 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent tap_device_name, device_owner)
115269 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent File "/usr/lib/python2.7/dist-packages/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neut ron_agent.py", line 451, in _add_tap_interface
115270 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent segmentation_id)
115271 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent File "/usr/lib/python2.7/dist-packages/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neut ron_agent.py", line 403, in ensure_physical_in_bridge
115272 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent physical_interface)
115273 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent File "/usr/lib/python2.7/dist-packages/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neut ron_agent.py", line 221, in ensure_flat_bridge
115274 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent gateway):
115275 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent File "/usr/lib/python2.7/dist-packages/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neut ron_agent.py", line 362, in ensure_bridge
115276 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent self.update_interface_ip_details(bridge_name, interface, ips, gateway)
115277 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent File "/usr/lib/python2.7/dist-packages/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neut ron_agent.py", line 301, in update_interface_ip_details
115278 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent dst_device.addr.add(cidr=ip['cidr'])
115279 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent File "/usr/lib/python2.7/dist-packages/neutron/agent/linux/ip_lib.py", line 597, in add
115280 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent self._as_root([net.version], tuple(args))
115281 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent File "/usr/lib/python2.7/dist-packages/neutron/agent/linux/ip_lib.py", line 384, in _as_root
115282 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent use_root_namespace=use_root_namespace)
115283 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent File "/usr/lib/python2.7/dist-packages/neutron/agent/linux/ip_lib.py", line 96, in _as_root
115284 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent log_fail_as_error=self.log_fail_as_error)
115285 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent File "/usr/lib/python2.7/dist-packages/neutron/agent/linux/ip_lib.py", line 105, in _execute
115286 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent log_fail_as_error=log_fail_as_error)
115287 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent File "/usr/lib/python2.7/dist-packages/neutron/agent/linux/utils.py", line 146, in execute
115288 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent raise ProcessExecutionError(msg, returncode=returncode)
115289 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent ProcessExecutionError: Exit code: 2; Stdin: ; Stdout: ; Stderr: sudo: unable to resolve host pxea4badb2 17413
115290 2018-09-11 16:59:59.274 1553 ERROR neutron.plugins.ml2.drivers.agent._common_agent RTNETLINK answers: File exists

问题原因

  • sudo: unable to resolve host pxea4badb2

无法解析主机名

查看/etc/hosts中缺少了本地hostname的IP地址映射

  • Exit code: 2; Stdin: ; Stdout: ; Stderr:

问题比较不直观,google之后,有人说是因为bridge上配置了IP,导致冲突了

经查看controller上,发现一个bridge和一个无力网卡配置了同样的IP,可能是因为之前使用flat网络后切换为vlan网络,没有清理openstack中创建的配置导致。

将bridge上的IP地址删除后,恢复正常