近日在学习OpenStack,使用时遇到些问题,故记录下。
安装的为官网目前最新版Liberty,我一开始下载安装的是早期版本(Earliest Version),发现有Dashboard登陆不进的情况,而且装了两台机都是一样的情况,登陆界面一直报“Unable to retrieve authorized projects.”错误,尝试许多方法都无效;故之后换最新版本(Most Recent Version),使用同样的安装配置却无此问题。
其它问题:
- 创建云主机时报错,提示Unexpected API Error,如图
查看nova-api日记录:[root@node1 ~]# tailf /var/log/nova/api.log | grep "ERROR" 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions [req-3180a7e7-1769-4399-bcb3-65765704d1ed 77a9e2da31934c089612b132eb1317c7 804843388d434710a6d7d8558c23ce77 - - -] Unexpected exception in API method 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions Traceback (most recent call last): 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/api/openstack/extensions.py", line 478, in wrapped 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions return f(*args, **kwargs) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/api/validation/__init__.py", line 73, in wrapper 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions return func(*args, **kwargs) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/api/validation/__init__.py", line 73, in wrapper 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions return func(*args, **kwargs) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/api/openstack/compute/servers.py", line 611, in create 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions **create_kwargs) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/hooks.py", line 149, in inner 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions rv = f(*args, **kwargs) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/compute/api.py", line 1581, in create 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions check_server_group_quota=check_server_group_quota) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/compute/api.py", line 1181, in _create_instance 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions auto_disk_config, reservation_id, max_count) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/compute/api.py", line 923, in _validate_and_build_base_options 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions requested_networks, max_count) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/compute/api.py", line 533, in _check_requested_networks 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions max_count) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/network/api.py", line 49, in wrapped 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions return func(self, context, *args, **kwargs) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/network/api.py", line 396, in validate_networks 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions requested_networks) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/network/rpcapi.py", line 204, in validate_networks 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions return self.client.call(ctxt, 'validate_networks', networks=networks) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/client.py", line 413, in call 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions return self.prepare().call(ctxt, method, **kwargs) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/client.py", line 158, in call 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions retry=self.retry) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/oslo_messaging/transport.py", line 90, in _send 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions timeout=timeout, retry=retry) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 470, in send 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions retry=retry) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 459, in _send 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions result = self._waiter.wait(msg_id, timeout) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 342, in wait 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions message = self.waiters.get(msg_id, timeout=timeout) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 244, in get 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions 'to message ID %s' % msg_id) 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions MessagingTimeout: Timed out waiting for a reply to message ID 6b9f994c995c44d892601c96b2c80652 2016-03-03 16:33:43.186 14992 ERROR nova.api.openstack.extensions
看样子是API出错,经多方查找,后与官方手册对比后发现是nova.conf配置文件中以下几项出现问题,起初我是直接注释去掉的,没有注意,更改完重新nova所有服务后无此错误:
[root@node1 ~]# vim /etc/nova/nova.conf
[DEFAULT] ... network_api_class = nova.network.neutronv2.api.API linuxnet_interface_driver = nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver security_group_api = neutron firewall_driver = nova.virt.firewall.NoopFirewallDriver
- 启动云主机时提示[错误: No valid host was found. There are not enough hosts available.],如图
提示没有有效的计算主机,云主机创建错误。这种情况先想到宿主机剩余资源是否够用,经查看足够使用。
然后查看指导服务日志:[root@node1 ~]# tailf /var/log/nova/conductor.log | grep "ERROR" 2016-03-03 14:52:39.097 4669 ERROR nova.scheduler.utils [req-2cfe58a1-7e32-46a5-b8d0-26796cdc230d 77a9e2da31934c089612b132eb1317c7 804843388d434710a6d7d8558c23ce77 - - -] [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] Error from last host: node1.txtyw.com (node node1.txtyw.com): [u'Traceback (most recent call last):\n', u' File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 1905, in _do_build_and_run_instance\n filter_properties)\n', u' File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2057, in _build_and_run_instance\n instance_uuid=instance.uuid, reason=six.text_type(e))\n', u'RescheduledException: Build of instance 2b7e6db2-bd9a-49df-a56e-c734ead7bc12 was re-scheduled: Binding failed for port 50a056dd-4bab-4b8f-9039-0efbfb0bb5a4, please check neutron logs for more information.\n'] 2016-03-03 14:52:39.136 4669 WARNING nova.scheduler.utils [req-2cfe58a1-7e32-46a5-b8d0-26796cdc230d 77a9e2da31934c089612b132eb1317c7 804843388d434710a6d7d8558c23ce77 - - -] [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] Setting instance to ERROR state.
计算服务日志:
[root@node1 ~]#tailf /var/log/nova/compute.log | grep "ERROR" 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [-] Instance failed network setup after 1 attempt(s) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager Traceback (most recent call last): 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 1564, in _allocate_network_async 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager dhcp_options=dhcp_options) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 727, in allocate_for_instance 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager self._delete_ports(neutron, instance, created_port_ids) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__ 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager self.force_reraise() 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager six.reraise(self.type_, self.value, self.tb) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 719, in allocate_for_instance 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager security_group_ids, available_macs, dhcp_opts) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 342, in _create_port 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager raise exception.PortBindingFailed(port_id=port_id) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager PortBindingFailed: Binding failed for port 50a056dd-4bab-4b8f-9039-0efbfb0bb5a4, please check neutron logs for more information. 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [req-2cfe58a1-7e32-46a5-b8d0-26796cdc230d 77a9e2da31934c089612b132eb1317c7 804843388d434710a6d7d8558c23ce77 - - -] [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] Instance failed to spawn 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] Traceback (most recent call last): 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2155, in _build_resources 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] yield resources 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2009, in _build_and_run_instance 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] block_device_info=block_device_info) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 2512, in spawn 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] write_to_disk=True) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 4383, in _get_guest_xml 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] network_info_str = str(network_info) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/nova/network/model.py", line 515, in __str__ 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] return self._sync_wrapper(fn, *args, **kwargs) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/nova/network/model.py", line 498, in _sync_wrapper 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] self.wait() 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/nova/network/model.py", line 530, in wait 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] self[:] = self._gt.wait() 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/eventlet/greenthread.py", line 175, in wait 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] return self._exit_event.wait() 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/eventlet/event.py", line 121, in wait 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] return hubs.get_hub().switch() 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 294, in switch 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] return self.greenlet.switch() 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/eventlet/greenthread.py", line 214, in main 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] result = function(*args, **kwargs) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 1581, in _allocate_network_async 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] six.reraise(*exc_info) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 1564, in _allocate_network_async 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] dhcp_options=dhcp_options) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 727, in allocate_for_instance 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] self._delete_ports(neutron, instance, created_port_ids) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__ 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] self.force_reraise() 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] six.reraise(self.type_, self.value, self.tb) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 719, in allocate_for_instance 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] security_group_ids, available_macs, dhcp_opts) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 342, in _create_port 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] raise exception.PortBindingFailed(port_id=port_id) 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12] PortBindingFailed: Binding failed for port 50a056dd-4bab-4b8f-9039-0efbfb0bb5a4, please check neutron logs for more information. 2016-03-03 14:52:38.840 4312 ERROR nova.compute.manager [instance: 2b7e6db2-bd9a-49df-a56e-c734ead7bc12]
两者均提示网络绑定出现问题,让查看neutron日志:
[root@node1 ~]# tailf /var/log/neutron/neutron.log | grep "ERROR" 2016-03-03 14:52:38.462 11947 ERROR neutron.plugins.ml2.managers [req-24ba50da-08a7-4984-b14c-34eac560965c c4badf551eaa48f5820eae9ffa0ae5c5 a52031f59dd5404b9bdbb3ecdd7e263b - - -] Failed to bind port 50a056dd-4bab-4b8f-9039-0efbfb0bb5a4 on host node1.txtyw.com 2016-03-03 14:52:38.463 11947 ERROR neutron.plugins.ml2.managers [req-24ba50da-08a7-4984-b14c-34eac560965c c4badf551eaa48f5820eae9ffa0ae5c5 a52031f59dd5404b9bdbb3ecdd7e263b - - -] Failed to bind port 50a056dd-4bab-4b8f-9039-0efbfb0bb5a4 on host node1.txtyw.com
提示为ml2插件绑定时出错,疑与neutron-linuxbridge-agent服务有关,服务使用脚本启动的,显示正常。于是使用命令重新启动服务后发现问题:
[root@node1 ~]# neutron-linuxbridge-agent --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/neutron/plugins/ml2/ml2_conf.ini --config-file=/etc/neutron/neutron/plugins/ml2/linuxbridge_agent.ini > /dev/null 2>&1 & [2] 13919 [2]+ Exit 1 neutron-linuxbridge-agent --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/neutron/plugins/ml2/ml2_conf.ini --config-file=/etc/neutron/neutron/plugins/ml2/linuxbridge_agent.ini > /dev/null 2>&1
发现进程很快就自已结束掉了,查看日志:
[root@node1 ~]# tailf /var/log/neutron/neutron.log | grep "ERROR" 2016-03-03 15:56:05.641 13919 ERROR neutron.plugins.ml2.drivers.linuxbridge.agent.linuxbridge_neutron_agent [-] Tunneling cannot be enabled without the local_ip bound to an interface on the host. Please configure local_ip None on the host interface to be used for tunneling and restart the agent. 2016-03-03 15:56:05.642 13919 ERROR neutron Traceback (most recent call last): 2016-03-03 15:56:05.642 13919 ERROR neutron File "/bin/neutron-linuxbridge-agent", line 10, in <module> 2016-03-03 15:56:05.642 13919 ERROR neutron sys.exit(main()) 2016-03-03 15:56:05.642 13919 ERROR neutron File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py", line 1184, in main 2016-03-03 15:56:05.642 13919 ERROR neutron launcher.wait() 2016-03-03 15:56:05.642 13919 ERROR neutron File "/usr/lib/python2.7/site-packages/oslo_service/service.py", line 309, in wait 2016-03-03 15:56:05.642 13919 ERROR neutron status, signo = self._wait_for_exit_or_signal() 2016-03-03 15:56:05.642 13919 ERROR neutron File "/usr/lib/python2.7/site-packages/oslo_service/service.py", line 294, in _wait_for_exit_or_signal 2016-03-03 15:56:05.642 13919 ERROR neutron self.stop() 2016-03-03 15:56:05.642 13919 ERROR neutron File "/usr/lib/python2.7/site-packages/oslo_service/service.py", line 215, in stop 2016-03-03 15:56:05.642 13919 ERROR neutron self.services.stop() 2016-03-03 15:56:05.642 13919 ERROR neutron File "/usr/lib/python2.7/site-packages/oslo_service/service.py", line 646, in stop 2016-03-03 15:56:05.642 13919 ERROR neutron service.stop() 2016-03-03 15:56:05.642 13919 ERROR neutron File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py", line 899, in stop 2016-03-03 15:56:05.642 13919 ERROR neutron self.set_rpc_timeout(self.quitting_rpc_timeout) 2016-03-03 15:56:05.642 13919 ERROR neutron File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py", line 1149, in set_rpc_timeout 2016-03-03 15:56:05.642 13919 ERROR neutron for rpc_api in (self.plugin_rpc, self.sg_plugin_rpc, 2016-03-03 15:56:05.642 13919 ERROR neutron AttributeError: 'LinuxBridgeNeutronAgentRPC' object has no attribute 'plugin_rpc' 2016-03-03 15:56:05.642 13919 ERROR neutron
neutron我设置为使用ml2插件,网络类型为flat,使用linuxbridge桥接。这下很明显了,提示Tunnel创建失败,没有配置local_ip。于是检查linuxbridge_agent.ini配置文件:
[root@node1 ~]# vim /etc/neutron/neutron/plugins/ml2/linuxbridge_agent.ini
... # (StrOpt) Local IP address to use for VXLAN endpoints (required) local_ip = 172.16.200.5
将其添加上后服务便启动正常
[root@node1 ~]# ps -aux | grep neutron-linuxbridge-agent | grep -v grep root 10156 1.1 1.0 349708 53532 pts/1 S 11:07 0:09 /bin/python /bin/neutron-linuxbridge-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/neutron/plugins/ml2/ml2_conf.ini --config-file /etc/neutron/neutron/plugins/ml2/linuxbridge_agent.ini
- neutron-dhcp-agent日志中报错,“sudo: sorry, you must have a tty to run sudo”,如下:
[root@node1 ~]# tailf /var/log/neutron/neutron.log 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent [-] Unable to enable dhcp for 51fb4fb4-1dec-4f2e-8568-519e398eeccd. 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent Traceback (most recent call last): 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/dhcp/agent.py", line 115, in call_driver 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent getattr(driver, action)(**action_kwargs) 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/dhcp.py", line 204, in enable 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent interface_name = self.device_manager.setup(self.network) 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/dhcp.py", line 1200, in setup 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent namespace=network.namespace) 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/interface.py", line 252, in plug 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent bridge, namespace, prefix) 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/interface.py", line 483, in plug_new 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent namespace2=namespace) 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 165, in add_veth 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent self.ensure_namespace(namespace2) 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 183, in ensure_namespace 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent if not self.netns.exists(name): 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 866, in exists 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent run_as_root=cfg.CONF.AGENT.use_helper_for_ns_read) 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 101, in _execute 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent log_fail_as_error=log_fail_as_error) 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/utils.py", line 159, in execute 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent raise RuntimeError(m) 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent RuntimeError: 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent Command: ['sudo', 'ip', '-o', 'netns', 'list'] 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent Exit code: 1 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent Stdin: 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent Stdout: 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent Stderr: sudo: sorry, you must have a tty to run sudo 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent 2016-03-04 11:08:13.943 9450 ERROR neutron.agent.dhcp.agent 2016-03-04 11:08:13.944 9450 INFO neutron.agent.dhcp.agent [-] Synchronizing state complete 2016-03-04 11:08:18.945 9450 INFO neutron.agent.dhcp.agent [-] Synchronizing state 2016-03-04 11:08:19.027 9450 ERROR neutron.agent.linux.utils [-] Command: ['sudo', 'ip', '-o', 'netns', 'list'] Exit code: 1 Stdin: Stdout: Stderr: sudo: sorry, you must have a tty to run sudo
这是因为sudo默认需要tty终端,修改下/etc/sudoers文件,注释掉Default requiretty即可
[root@node1 ~]# chmod u+w /etc/sudoers [root@node1 ~]# vim /etc/sudoers
... #Defaults requiretty