声明:绝对原创,欢迎转载,但请标明出处,谢谢!
最近在做openstack与Docker的集成工作,走了不少弯路,遇到不少问题,不过最终搭建成功了。现在将过程分享出来,以供参考。
一、环境介绍
1、软件环境:
CentOs7 64位、OpenStack(Juno)、Docker version 1.5.0
2、网络:
$vim /etc/hosts 192.168.245.148 compute1 192.168.245.141 controller
3、安装前提:
3.1 控制节点安装
身份认证服务——Keystone
镜像服务——Glance
计算服务——Nova
网络服务——Nova-network
Web界面——Dashboard
3.2 计算节点安装:
计算服务——Nova
网络服务——Nova-network
3.3 计算节点与控制节点已联通
二、计算节点配置
1、管理员权限:
$su
2、关闭防火墙、selinux
$systemctl stop firewalld.service $setenforce
3、安装Docker
$yum install docker
4、获得Docker CentOs镜像、开启容器
$docker pull centos $docker images centos $docker run -i -t centos /bin/bash $exit
5、nova-docker-driver安装前准备工作
5.1 安装pip
官网下载安装包 https://pypi.python.org/pypi/pip 。解压之后:
$python setup.py install
5.2 安装Python-dev
$yum install python-devel
6、nova-docker-driver安装
$pip install -e git+https://github.com/stackforge/nova-docker#egg=novadocker $cd src/novadocker/ $python setup.py install
7、Nova配置
配置 /etc/nova/nova.conf
$vim /etc/nova/nova.conf [DEFAULT] compute_driver = novadocker.virt.docker.DockerDriver
创建文件夹 /etc/nova/rootwrap.d在其中创建文件docker.filters,内容如下:
# nova-rootwrap command filters for setting up network in the docker driver # This file should be owned by (and only-writeable by) the root user [Filters] # nova/virt/docker/driver.py: 'ln', '-sf', '/var/run/netns/.*' ln: CommandFilter, /bin/ln, root
三、控制节点配置
$vim /etc/glance/glance-api.conf container_formats=ami,ari,aki,bare,ovf,ova,docker
四、docker镜像发布
$vim admin.sh export OS_TENANT_NAME=admin export OS_USERNAME=admin export OS_PASSWORD=YOUR_PASS export OS_AUTH_URL=http://controller:35357/v2.0
$source admin.sh $docker save centos | glance image-create --is-public=True --container-format=docker --disk-format=raw --name centos
至此,基本的安装配置已完成,你可以尝试在控制节点的web界面上启动centOS的镜像实例。
但事实远非如此,以下记录排错过程。涉及到的日志文件有
控制节点上:/var/log/nova/nova-scheduler.log、/var/log/nova/nova-conductor.log
计算节点上:/var/log/nova/nova-compute.log、/var/log/messages、systemctl status openstack-nova-network.service –l 、systemctl status openstack-nova-compute.service -l
问题1:计算节点Nova-compute启动报错
Apr :: localhost systemd: Starting OpenStack Nova Compute Server...
Apr :: localhost nova-compute: -- ::23.701 DEBUG nova.servicegroup.api [-] ServiceGroup driver defined as an instance of db __new__ /usr/lib/python2./site-packages/nova/servicegroup/api.py:
Apr :: localhost nova-compute: -- ::23.967 INFO nova.virt.driver [-] Loading compute driver 'novadocker.virt.docker.DockerDriver'
Apr :: localhost nova-compute: -- ::23.975 ERROR nova.virt.driver [-] Unable to load the virtualization driver
Apr :: localhost nova-compute: -- ::23.975 TRACE nova.virt.driver Traceback (most recent call last):
Apr :: localhost nova-compute: -- ::23.975 TRACE nova.virt.driver File "/usr/lib/python2.7/site-packages/nova/virt/driver.py", line , in load_compute_driver
Apr :: localhost nova-compute: -- ::23.975 TRACE nova.virt.driver virtapi)
Apr :: localhost nova-compute: -- ::23.975 TRACE nova.virt.driver File "/usr/lib/python2.7/site-packages/nova/openstack/common/importutils.py", line , in import_object_ns
Apr :: localhost nova-compute: -- ::23.975 TRACE nova.virt.driver return import_class(import_str)(*args, **kwargs)
Apr :: localhost nova-compute: -- ::23.975 TRACE nova.virt.driver File "/usr/lib/python2.7/site-packages/nova/openstack/common/importutils.py", line , in import_class
Apr :: localhost nova-compute: -- ::23.975 TRACE nova.virt.driver __import__(mod_str)
Apr :: localhost nova-compute: -- ::23.975 TRACE nova.virt.driver File "/usr/lib/python2.7/site-packages/novadocker/virt/docker/__init__.py", line , in <module>
Apr :: localhost nova-compute: -- ::23.975 TRACE nova.virt.driver from novadocker.virt.docker import driver
Apr :: localhost nova-compute: -- ::23.975 TRACE nova.virt.driver File "/usr/lib/python2.7/site-packages/novadocker/virt/docker/driver.py", line , in <module>
Apr :: localhost nova-compute: -- ::23.975 TRACE nova.virt.driver from oslo_log import log
Apr :: localhost nova-compute: -- ::23.975 TRACE nova.virt.driver ImportError: No module named oslo_log
Apr :: localhost nova-compute: -- ::23.975 TRACE nova.virt.driver
Apr :: localhost systemd: openstack-nova-compute.service: main process exited, code=exited, status=/FAILURE
Apr :: localhost systemd: Failed to start OpenStack Nova Compute Server.
Apr :: localhost systemd: Unit openstack-nova-compute.service entered failed state.
Apr :: localhost systemd: openstack-nova-compute.service holdoff time over, scheduling restart.
Apr :: localhost systemd: Stopping OpenStack Nova Compute Server...
解决方法:安装oslo.log,下载oslo.log-1.1.0.tar.gz,解压缩,python setup.py install
问题2:计算节点Nova-compute启动报错
Apr :: localhost systemd: Starting OpenStack Nova Compute Server...
Apr :: localhost nova-compute: -- ::12.216 DEBUG nova.servicegroup.api [-] ServiceGroup driver defined as an instance of db __new__ /usr/lib/python2./site-packages/nova/servicegroup/api.py:
Apr :: localhost nova-compute: -- ::12.435 INFO nova.virt.driver [-] Loading compute driver 'novadocker.virt.docker.DockerDriver'
Apr :: localhost nova-compute: -- ::12.497 INFO nova.openstack.common.periodic_task [-] Skipping periodic task _periodic_update_dns because its interval is negative
Apr :: localhost nova-compute: -- ::12.545 CRITICAL nova [-] TypeError: __init__() takes at least arguments ( given)
Apr :: localhost nova-compute: -- ::12.545 TRACE nova Traceback (most recent call last):
Apr :: localhost nova-compute: -- ::12.545 TRACE nova File "/usr/bin/nova-compute", line , in <module>
Apr :: localhost nova-compute: -- ::12.545 TRACE nova sys.exit(main())
Apr :: localhost nova-compute: -- ::12.545 TRACE nova File "/usr/lib/python2.7/site-packages/nova/cmd/compute.py", line , in main
Apr :: localhost nova-compute: -- ::12.545 TRACE nova db_allowed=CONF.conductor.use_local)
Apr :: localhost nova-compute: -- ::12.545 TRACE nova File "/usr/lib/python2.7/site-packages/nova/service.py", line , in create
Apr :: localhost nova-compute: -- ::12.545 TRACE nova db_allowed=db_allowed)
Apr :: localhost nova-compute: -- ::12.545 TRACE nova File "/usr/lib/python2.7/site-packages/nova/service.py", line , in __init__
Apr :: localhost nova-compute: -- ::12.545 TRACE nova self.manager = manager_class(host=self.host, *args, **kwargs)
Apr :: localhost nova-compute: -- ::12.545 TRACE nova File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line , in __init__
Apr :: localhost nova-compute: -- ::12.545 TRACE nova self.driver = driver.load_compute_driver(self.virtapi, compute_driver)
Apr :: localhost nova-compute: -- ::12.545 TRACE nova File "/usr/lib/python2.7/site-packages/nova/virt/driver.py", line , in load_compute_driver
Apr :: localhost nova-compute: -- ::12.545 TRACE nova virtapi)
Apr :: localhost nova-compute: -- ::12.545 TRACE nova File "/usr/lib/python2.7/site-packages/nova/openstack/common/importutils.py", line , in import_object_ns
Apr :: localhost nova-compute: -- ::12.545 TRACE nova return import_class(import_str)(*args, **kwargs)
Apr :: localhost nova-compute: -- ::12.545 TRACE nova File "/usr/lib/python2.7/site-packages/novadocker/virt/docker/driver.py", line , in __init__
Apr :: localhost nova-compute: -- ::12.545 TRACE nova default='nova.virt.firewall.NoopFirewallDriver')
Apr :: localhost nova-compute: -- ::12.545 TRACE nova File "/usr/lib/python2.7/site-packages/nova/virt/firewall.py", line , in load_driver
Apr :: localhost nova-compute: -- ::12.545 TRACE nova return fw_class(*args, **kwargs)
Apr :: localhost nova-compute: -- ::12.545 TRACE nova TypeError: __init__() takes at least arguments ( given)
Apr :: localhost nova-compute: -- ::12.545 TRACE nova
Apr :: localhost systemd: openstack-nova-compute.service: main process exited, code=exited, status=/FAILURE
Apr :: localhost systemd: Failed to start OpenStack Nova Compute Server.
Apr :: localhost systemd: Unit openstack-nova-compute.service entered failed state.
Apr :: localhost systemd: openstack-nova-compute.service holdoff time over, scheduling restart.
Apr :: localhost systemd: Stopping OpenStack Nova Compute Server...
Apr :: localhost systemd: Starting OpenStack Nova Compute Server...
Apr :: localhost systemd: openstack-nova-compute.service start request repeated too quickly, refusing to start.
Apr :: localhost systemd: Failed to start OpenStack Nova Compute Server.
Apr :: localhost systemd: Unit openstack-nova-compute.service entered failed state.
解决方法:关闭nova.conf中如下选项
$vim /etc/nova/nova.conf
#firewall_driver = nova.virt.libvirt.firewall.IptablesFirewallDriver
问题3:计算节点Nova-compute启动报错
Apr :: localhost systemd: Starting OpenStack Nova Compute Server...
Apr :: localhost nova-compute: -- ::42.245 DEBUG nova.servicegroup.api [-] ServiceGroup driver defined as an instance of db __new__ /usr/lib/python2./site-packages/nova/servicegroup/api.py:
Apr :: localhost nova-compute: -- ::42.446 INFO nova.virt.driver [-] Loading compute driver 'novadocker.virt.docker.DockerDriver'
Apr :: localhost nova-compute: -- ::42.501 INFO nova.openstack.common.periodic_task [-] Skipping periodic task _periodic_update_dns because its interval is negative
Apr :: localhost nova-compute: -- ::42.505 INFO oslo.messaging._drivers.impl_rabbit [req-31fa628a-dbcc-41b2--ecb9b30d3dee ] Connecting to AMQP server on controller:
Apr :: localhost nova-compute: -- ::42.543 INFO oslo.messaging._drivers.impl_rabbit [req-31fa628a-dbcc-41b2--ecb9b30d3dee ] Connected to AMQP server on controller:
Apr :: localhost nova-compute: -- ::42.561 INFO oslo.messaging._drivers.impl_rabbit [req-31fa628a-dbcc-41b2--ecb9b30d3dee ] Connecting to AMQP server on controller:
Apr :: localhost nova-compute: -- ::42.594 INFO oslo.messaging._drivers.impl_rabbit [req-31fa628a-dbcc-41b2--ecb9b30d3dee ] Connected to AMQP server on controller:
Apr :: localhost nova-compute: -- ::42.609 DEBUG nova.openstack.common.service [-] Full set of CONF: _wait_for_exit_or_signal /usr/lib/python2./site-packages/nova/openstack/common/service.py:
Apr :: localhost nova-compute: -- ::42.610 DEBUG nova.openstack.common.service [-] ******************************************************************************** log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.610 DEBUG nova.openstack.common.service [-] Configuration options gathered from: log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.610 DEBUG nova.openstack.common.service [-] command line args: [] log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.610 DEBUG nova.openstack.common.service [-] config files: ['/etc/nova/nova.conf'] log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.610 DEBUG nova.openstack.common.service [-] ================================================================================ log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.610 DEBUG nova.openstack.common.service [-] allow_instance_snapshots = True log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.611 DEBUG nova.openstack.common.service [-] allow_migrate_to_same_host = False log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.611 DEBUG nova.openstack.common.service [-] allow_resize_to_same_host = False log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.611 DEBUG nova.openstack.common.service [-] allow_same_net_traffic = False log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.611 DEBUG nova.openstack.common.service [-] amqp_auto_delete = False log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.611 DEBUG nova.openstack.common.service [-] amqp_durable_queues = False log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.611 DEBUG nova.openstack.common.service [-] api_paste_config = api-paste.ini log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.612 DEBUG nova.openstack.common.service [-] api_rate_limit = False log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.612 DEBUG nova.openstack.common.service [-] auth_strategy = keystone log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.612 DEBUG nova.openstack.common.service [-] auto_assign_floating_ip = False log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.612 DEBUG nova.openstack.common.service [-] backdoor_port = None log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.613 DEBUG nova.openstack.common.service [-] bandwidth_poll_interval = log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.613 DEBUG nova.openstack.common.service [-] bindir = /usr/local/bin log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.613 DEBUG nova.openstack.common.service [-] block_device_allocate_retries = log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.614 DEBUG nova.openstack.common.service [-] block_device_allocate_retries_interval = log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost systemd: Started OpenStack Nova Compute Server.
Apr :: localhost nova-compute: -- ::42.614 DEBUG nova.openstack.common.service [-] boot_script_template = /usr/lib/python2./site-packages/nova/cloudpipe/bootscript.template log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.614 DEBUG nova.openstack.common.service [-] ca_file = cacert.pem log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.615 DEBUG nova.openstack.common.service [-] ca_path = /usr/lib/python2./site-packages/CA log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.615 DEBUG nova.openstack.common.service [-] cert_manager = nova.cert.manager.CertManager log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.615 DEBUG nova.openstack.common.service [-] client_socket_timeout = log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.615 DEBUG nova.openstack.common.service [-] cnt_vpn_clients = log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.615 DEBUG nova.openstack.common.service [-] compute_available_monitors = ['nova.compute.monitors.all_monitors'] log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.616 DEBUG nova.openstack.common.service [-] compute_driver = novadocker.virt.docker.DockerDriver log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.616 DEBUG nova.openstack.common.service [-] compute_manager = nova.compute.manager.ComputeManager log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.616 DEBUG nova.openstack.common.service [-] compute_monitors = [] log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.616 DEBUG nova.openstack.common.service [-] compute_resources = ['vcpu'] log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.617 DEBUG nova.openstack.common.service [-] compute_stats_class = nova.compute.stats.Stats log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.617 DEBUG nova.openstack.common.service [-] compute_topic = compute log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.619 DEBUG nova.openstack.common.service [-] config_dir = None log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.619 DEBUG nova.openstack.common.service [-] config_file = ['/etc/nova/nova.conf'] log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.619 DEBUG nova.openstack.common.service [-] console_host = compute1 log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.619 DEBUG nova.openstack.common.service [-] console_manager = nova.console.manager.ConsoleProxyManager log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.620 DEBUG nova.openstack.common.service [-] console_topic = console log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.620 DEBUG nova.openstack.common.service [-] consoleauth_manager = nova.consoleauth.manager.ConsoleAuthManager log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.620 DEBUG nova.openstack.common.service [-] consoleauth_topic = consoleauth log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.621 DEBUG nova.openstack.common.service [-] control_exchange = nova log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.621 DEBUG nova.openstack.common.service [-] create_unique_mac_address_attempts = log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.621 DEBUG nova.openstack.common.service [-] crl_file = crl.pem log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.622 DEBUG nova.openstack.common.service [-] db_driver = nova.db log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.622 DEBUG nova.openstack.common.service [-] debug = True log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.622 DEBUG nova.openstack.common.service [-] default_access_ip_network_name = None log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.622 DEBUG nova.openstack.common.service [-] default_availability_zone = nova log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.623 DEBUG nova.openstack.common.service [-] default_ephemeral_format = None log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.623 DEBUG nova.openstack.common.service [-] default_flavor = m1.small log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.623 DEBUG nova.openstack.common.service [-] default_floating_pool = nova log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.623 DEBUG nova.openstack.common.service [-] default_log_levels = ['amqp=WARN', 'amqplib=WARN', 'boto=WARN', 'qpid=WARN', 'sqlalchemy=WARN', 'suds=INFO', 'oslo.messaging=INFO', 'iso8601=WARN', 'requests.packages.urllib3.connectionpool=WARN', 'urllib3.connectionpool=WARN', 'websocket=WARN', 'keystonemiddleware=WARN', 'routes.middleware=WARN', 'stevedore=WARN'] log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.624 DEBUG nova.openstack.common.service [-] default_notification_level = INFO log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.624 DEBUG nova.openstack.common.service [-] default_publisher_id = None log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.624 DEBUG nova.openstack.common.service [-] default_schedule_zone = None log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.624 DEBUG nova.openstack.common.service [-] defer_iptables_apply = False log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.625 DEBUG nova.openstack.common.service [-] dhcp_domain = novalocal log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.625 DEBUG nova.openstack.common.service [-] dhcp_lease_time = log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.625 DEBUG nova.openstack.common.service [-] dhcpbridge = /usr/local/bin/nova-dhcpbridge log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost nova-compute: -- ::42.626 DEBUG nova.openstack.common.service [-] dhcpbridge_flagfile = ['/etc/nova/nova-dhcpbridge.conf'] log_opt_values /usr/lib/python2./site-packages/oslo_config/cfg.py:
Apr :: localhost systemd: openstack-nova-compute.service holdoff time over, scheduling restart.
Apr :: localhost systemd: Stopping OpenStack Nova Compute Server...
Apr :: localhost systemd: Starting OpenStack Nova Compute Server...
Apr :: localhost systemd: Started OpenStack Nova Compute Server.
Apr :: localhost systemd: openstack-nova-compute.service holdoff time over, scheduling restart.
Apr :: localhost systemd: Stopping OpenStack Nova Compute Server...
Apr :: localhost systemd: Starting OpenStack Nova Compute Server...
Apr :: localhost systemd: openstack-nova-compute.service start request repeated too quickly, refusing to start.
Apr :: localhost systemd: Failed to start OpenStack Nova Compute Server.
Apr :: localhost systemd: Unit openstack-nova-compute.service entered failed state.
This looks like that the owner of the nova-compute process does not have write permission to the docker socket:
解决方法:
$usermod -G root nova
问题4:计算节点Nova-compute启动报错
Apr :: localhost dbus-daemon: 'list' object has no attribute 'split'
Apr :: localhost systemd: Starting OpenStack Nova Network Server...
Apr :: localhost systemd: Started OpenStack Nova Network Server.
Apr :: localhost dbus-daemon: dbus[]: [system] Activating service name='org.fedoraproject.Setroubleshootd' (using servicehelper)
Apr :: localhost dbus[]: [system] Activating service name='org.fedoraproject.Setroubleshootd' (using servicehelper)
Apr :: localhost systemd: openstack-nova-network.service holdoff time over, scheduling restart.
Apr :: localhost systemd: Stopping OpenStack Nova Network Server...
Apr :: localhost systemd: Starting OpenStack Nova Network Server...
Apr :: localhost dbus-daemon: dbus[]: [system] Successfully activated service 'org.fedoraproject.Setroubleshootd'
Apr :: localhost dbus[]: [system] Successfully activated service 'org.fedoraproject.Setroubleshootd'
Apr :: localhost systemd: Started OpenStack Nova Network Server.
Apr :: localhost setroubleshoot: Plugin Exception restorecon_source
Apr :: localhost setroubleshoot: SELinux is preventing /usr/bin/sudo from search access on the directory /var/lib/sss. For complete SELinux messages. run sealert -l d5691bba--47e7-85d6-f1c6de6fca13
Apr :: localhost python: SELinux is preventing /usr/bin/sudo from search access on the directory /var/lib/sss.
解决方法:关闭selinux
1、临时关闭(不用重启机器):
$setenforce
2、修改配置文件需要重启机器:
$vim /etc/selinux/config
2 SELINUX=disabled
重启机器即可
问题5:计算节点Nova-network启动报错
Apr :: localhost systemd: openstack-nova-network.service holdoff time over, scheduling restart.
Apr :: localhost systemd: Stopping OpenStack Nova Network Server...
Apr :: localhost systemd: Starting OpenStack Nova Network Server...
Apr :: localhost nova-network: -- ::54.297 INFO nova.openstack.common.periodic_task [-] Skipping periodic task _periodic_update_dns because its interval is negative
Apr :: localhost nova-network: -- ::54.299 INFO nova.network.driver [-] Loading network driver 'nova.network.linux_net'
Apr :: localhost nova-network: -- ::54.302 INFO oslo.messaging._drivers.impl_rabbit [req-a893822c-a843-43cf-9be6-357f35810c05 ] Connecting to AMQP server on controller:
Apr :: localhost nova-network: -- ::54.338 INFO oslo.messaging._drivers.impl_rabbit [req-a893822c-a843-43cf-9be6-357f35810c05 ] Connected to AMQP server on controller:
Apr :: localhost nova-network: -- ::54.362 INFO oslo.messaging._drivers.impl_rabbit [req-a893822c-a843-43cf-9be6-357f35810c05 ] Connecting to AMQP server on controller:
Apr :: localhost nova-network: -- ::54.383 INFO oslo.messaging._drivers.impl_rabbit [req-a893822c-a843-43cf-9be6-357f35810c05 ] Connected to AMQP server on controller:
Apr :: localhost systemd: Started OpenStack Nova Network Server.
Apr :: localhost nova-network: -- ::54.429 AUDIT nova.service [-] Starting network node (version 2014.2.-.el7)
Apr :: localhost nova-network: Traceback (most recent call last):
Apr :: localhost nova-network: File "/usr/lib/python2.7/site-packages/eventlet/hubs/poll.py", line , in wait
Apr :: localhost nova-network: listener.cb(fileno)
Apr :: localhost nova-network: File "/usr/lib/python2.7/site-packages/eventlet/greenthread.py", line , in main
Apr :: localhost nova-network: result = function(*args, **kwargs)
Apr :: localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/openstack/common/service.py", line , in run_service
Apr :: localhost nova-network: service.start()
Apr :: localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/service.py", line , in start
Apr :: localhost nova-network: self.manager.init_host()
Apr :: localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line , in init_host
Apr :: localhost nova-network: self.driver.iptables_manager.defer_apply_off()
Apr :: localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line , in defer_apply_off
Apr :: localhost nova-network: self.apply()
Apr :: localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line , in apply
Apr :: localhost nova-network: self._apply()
Apr :: localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line , in inner
Apr :: localhost nova-network: with lock(name, lock_file_prefix, external, lock_path):
Apr :: localhost nova-network: File "/usr/lib64/python2.7/contextlib.py", line , in __enter__
Apr :: localhost nova-network: return self.gen.next()
Apr :: localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line , in lock
Apr :: localhost nova-network: ext_lock = external_lock(name, lock_file_prefix, lock_path)
Apr :: localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line , in external_lock
Apr :: localhost nova-network: lock_file_path = _get_lock_path(name, lock_file_prefix, lock_path)
Apr :: localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line , in _get_lock_path
Apr :: localhost nova-network: raise cfg.RequiredOptError('lock_path')
Apr :: localhost nova-network: RequiredOptError: value required for option: lock_path
Apr :: localhost nova-network: Removing descriptor:
Apr :: localhost nova-network: -- ::54.607 ERROR nova.openstack.common.threadgroup [-] value required for option: lock_path
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup Traceback (most recent call last):
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/site-packages/nova/openstack/common/threadgroup.py", line , in wait
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup x.wait()
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/site-packages/nova/openstack/common/threadgroup.py", line , in wait
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup return self.thread.wait()
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/site-packages/eventlet/greenthread.py", line , in wait
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup return self._exit_event.wait()
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/site-packages/eventlet/event.py", line , in wait
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup return hubs.get_hub().switch()
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/site-packages/eventlet/hubs/hub.py", line , in switch
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup return self.greenlet.switch()
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/site-packages/eventlet/greenthread.py", line , in main
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup result = function(*args, **kwargs)
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/site-packages/nova/openstack/common/service.py", line , in run_service
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup service.start()
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/site-packages/nova/service.py", line , in start
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup self.manager.init_host()
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line , in init_host
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup self.driver.iptables_manager.defer_apply_off()
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line , in defer_apply_off
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup self.apply()
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line , in apply
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup self._apply()
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line , in inner
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup with lock(name, lock_file_prefix, external, lock_path):
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup File "/usr/lib64/python2.7/contextlib.py", line , in __enter__
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup return self.gen.next()
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line , in lock
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup ext_lock = external_lock(name, lock_file_prefix, lock_path)
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line , in external_lock
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup lock_file_path = _get_lock_path(name, lock_file_prefix, lock_path)
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line , in _get_lock_path
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup raise cfg.RequiredOptError('lock_path')
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup RequiredOptError: value required for option: lock_path
Apr :: localhost nova-network: -- ::54.607 TRACE nova.openstack.common.threadgroup
Apr :: localhost systemd: openstack-nova-network.service holdoff time over, scheduling restart.
Apr :: localhost systemd: Stopping OpenStack Nova Network Server...
Apr :: localhost systemd: Starting OpenStack Nova Network Server...
Apr :: localhost systemd: openstack-nova-network.service start request repeated too quickly, refusing to start.
Apr :: localhost systemd: Failed to start OpenStack Nova Network Server.
Apr :: localhost systemd: Unit openstack-nova-network.service entered failed state.
Apr :: localhost nova-compute: -- ::46.123 AUDIT nova.compute.resource_tracker [-] Auditing locally available compute resources
Apr :: localhost docker: time="2015-04-24T11:42:46+08:00" level="info" msg="GET /v1.13/containers/json?all=1&limit=-1&trunc_cmd=1&size=0"
Apr :: localhost docker: time="2015-04-24T11:42:46+08:00" level="info" msg="+job containers()"
Apr :: localhost docker: time="2015-04-24T11:42:46+08:00" level="info" msg="-job containers() = OK (0)"
Apr :: localhost docker: time="2015-04-24T11:42:46+08:00" level="info" msg="GET /v1.13/containers/c0dc9faa6e04a64a3a4e6ac3a93adcd5cb478d972ac5afd07967b74609be975c/json"
Apr :: localhost docker: time="2015-04-24T11:42:46+08:00" level="info" msg="+job container_inspect(c0dc9faa6e04a64a3a4e6ac3a93adcd5cb478d972ac5afd07967b74609be975c)"
Apr :: localhost docker: time="2015-04-24T11:42:46+08:00" level="info" msg="-job container_inspect(c0dc9faa6e04a64a3a4e6ac3a93adcd5cb478d972ac5afd07967b74609be975c) = OK (0)"
Apr :: localhost nova-compute: -- ::46.223 AUDIT nova.compute.resource_tracker [-] Total physical ram (MB): , total allocated virtual ram (MB):
Apr :: localhost nova-compute: -- ::46.223 AUDIT nova.compute.resource_tracker [-] Free disk (GB):
Apr :: localhost nova-compute: -- ::46.223 AUDIT nova.compute.resource_tracker [-] Total usable vcpus: , total allocated vcpus:
Apr :: localhost nova-compute: -- ::46.223 AUDIT nova.compute.resource_tracker [-] PCI stats: []
Apr :: localhost nova-compute: -- ::46.224 INFO nova.compute.resource_tracker [-] Compute_service record updated for compute1:compute1
解决方法:
$mkdir -p /var/lib/nova/tmp
$chmod -R /var/lib/nova/tmp
$vim /etc/nova/nova.conf
lock_path=/var/lib/nova/tmp
问题6:计算节点Nova-network启动报错
[root@compute1 Desktop]# systemctl status libvirtd.service
libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
Active: active (running) since Tue -- :: CST; 21min ago
Docs: man:libvirtd()
http://libvirt.org
Main PID: (libvirtd)
CGroup: /system.slice/libvirtd.service
└─ /usr/sbin/libvirtd Apr :: compute1 libvirtd[]: libvirt version: 1.2., package: .el7_1. (CentOS BuildSystem <http://bugs.centos.org>, 2015-03-...tos.org)
Apr :: compute1 libvirtd[]: Module /usr/lib64/libvirt/connection-driver/libvirt_driver_lxc.so not accessible
Apr :: compute1 systemd[]: Started Virtualization daemon.
Apr :: compute1 libvirtd[]: internal error: referenced filter 'no-mac-spoofing' is missing
Hint: Some lines were ellipsized, use -l to show in full.
解决方法:需下载libvirtd的针对juno的补丁
yum install libvirt-daemon-config-nwfilter
问题7:计算节点Nova-network启动报错
-- ::04.373 ERROR nova.scheduler.utils [req-188f10fe---baeb-3704a9aabeee None] [instance: 3a26ef5b-aead-4dad--9f42a6cd3840] Error from last host: compute1 (node compute1): [u'Traceback (most recent call last):\n', u' File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2033, in _do_build_and_run_instance\n filter_properties)\n', u' File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2164, in _build_and_run_instance\n instance_uuid=instance.uuid, reason=six.text_type(e))\n', u'RescheduledException: Build of instance 3a26ef5b-aead-4dad-8519-9f42a6cd3840 was re-scheduled: [Errno 13] Permission denied\n'] Build of instance[Errno ] Permission denied
Build of instance was re-scheduled: [Errno ] Permission denied Apr :: compute1 nova-network[]: -- ::00.820 TRACE oslo.messaging.rpc.dispatcher fileutils.ensure_tree(CON...ks_path)
Apr :: compute1 nova-network[]: -- ::00.820 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.7/si...ure_tree
Apr :: compute1 nova-network[]: -- ::00.820 TRACE oslo.messaging.rpc.dispatcher os.makedirs(path)
Apr :: compute1 nova-network[]: -- ::00.820 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib64/python2.7/...makedirs
Apr :: compute1 nova-network[]: -- ::00.820 TRACE oslo.messaging.rpc.dispatcher mkdir(name, mode)
Apr :: compute1 nova-network[]: -- ::00.820 TRACE oslo.messaging.rpc.dispatcher OSError: [Errno ] Permissio...etworks'
Apr :: compute1 nova-network[]: -- ::00.820 TRACE oslo.messaging.rpc.dispatcher
Apr :: compute1 nova-network[]: -- ::00.822 ERROR oslo.messaging._drivers.common [req-d01b04d0-c9fa-45a1-a173...o caller
Apr :: compute1 nova-network[]: -- ::00.823 ERROR oslo.messaging._drivers.common [req-d01b04d0-c9fa-45a1-a173...n', ' F
Apr :: compute1 nova-network[]: e "/usr/lib64/python2.7/os.py", line , in makedirs\n mkdir(name, mode)\n', "OSError: [Er...rks'\n"]
Hint: Some lines were ellipsized, use -l to show in full.
解决方法:
$chmod -R /usr/lib/python2./site-packages
问题8:openstack启动docker容器失败——找不到flavor名字
docker Instance object has no attribute flavor
解决方法:该问题为驱动bug,昨天早晨六点解决的
https://review.openstack.org/#/c/165196/
git fetch https://review.openstack.org/stackforge/nova-docker refs/changes/96/165196/2 && git checkout FETCH_HEAD python setup.py install
问题9:openstack启动docker容器失败
ERROR oslo.messaging._drivers.common [req-f35e6205-cece--a394-00588cbada4f ] Returning exception Unexpected error while running command.
Apr :: compute1 nova-network[]: Command: sudo nova-rootwrap /etc/nova/rootwrap.conf env CONFIG_FILE=["/etc/nova/nova-dhcpbridge.conf"] NETWORK_ID= dnsmasq --strict-order --bind-interfaces --conf-file= --pid-file=/usr/lib/python2./site-packages/networks/nova-br100.pid --dhcp-optsfile=/usr/lib/python2./site-packages/networks/nova-br100.opts --listen-address=203.0.113.25 --except-interface=lo --dhcp-range=set:demo-net,203.0.113.26,static,255.255.255.248,86400s --dhcp-lease-max= --dhcp-hostsfile=/usr/lib/python2./site-packages/networks/nova-br100.conf --dhcp-script=/usr/local/bin/nova-dhcpbridge --no-hosts --leasefile-ro --domain=novalocal --addn-hosts=/usr/lib/python2./site-packages/networks/nova-br100.hosts
Apr :: compute1 nova-network[]: Exit code:
Apr :: compute1 nova-network[]: Stdout: u''
Apr :: compute1 nova-network[]: Stderr: u'sh: /usr/local/bin/nova-dhcpbridge: No such file or directory\n\ndnsmasq: cannot run lease-init script /usr/local/bin/nova-dhcpbridge: No such file or directory\n' to caller
Apr :: compute1 nova-network[]: -- ::08.149 ERROR oslo.messaging._drivers.common [req-f35e6205-cece--a394-00588cbada4f ] ['Traceback (most recent call last):\n', ' File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 134, in _dispatch_and_reply\n incoming.message))\n', ' File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 177, in _dispatch\n return self._do_dispatch(endpoint, method, ctxt, args)\n', ' File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 123, in _do_dispatch\n result = getattr(endpoint, method)(ctxt, **new_args)\n', ' File "/usr/lib/python2.7/site-packages/nova/network/floating_ips.py", line 114, in allocate_for_instance\n **kwargs)\n', ' File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 511, in allocate_for_instance\n requested_networks=requested_networks)\n', ' File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 192, in _allocate_fixed_ips\n vpn=vpn, address=address)\n', ' File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 967, in allocate_fixed_ip\n exc_info=True)\n', ' File "/usr/lib/python2.7/site-packages/nova/openstack/common/excutils.py", line 82, in __exit__\n six.reraise(self.type_, self.value, self.tb)\n', ' File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 943, in allocate_fixed_ip\n self._setup_network_on_host(context, network)\n', ' File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 1823, in _setup_network_on_host\n self.driver.update_dhcp(elevated, dev, network)\n', ' File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line 1012, in update_dhcp\n restart_dhcp(context, dev, network_ref, fixedips)\n', ' File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line 272, in inner\n return f(*args, **kwargs)\n', ' File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line 1127, in restart_dhcp\n _execute(*cmd, run_as_root=True)\
Apr :: compute1 nova-network[]: n', ' File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line , in _execute\n return utils.execute(*cmd, **kwargs)\n', ' File "/usr/lib/python2.7/site-packages/nova/utils.py", line , in execute\n return processutils.execute(*cmd, **kwargs)\n', ' File "/usr/lib/python2.7/site-packages/nova/openstack/common/processutils.py", line , in execute\n cmd=sanitized_cmd)\n', 'ProcessExecutionError: Unexpected error while running command.\nCommand: sudo nova-rootwrap /etc/nova/rootwrap.conf env CONFIG_FILE=["/etc/nova/nova-dhcpbridge.conf"] NETWORK_ID= dnsmasq --strict-order --bind-interfaces --conf-file= --pid-file=/usr/lib/python2./site-packages/networks/nova-br100.pid --dhcp-optsfile=/usr/lib/python2./site-packages/networks/nova-br100.opts --listen-address=203.0.113.25 --except-interface=lo --dhcp-range=set:demo-net,203.0.113.26,static,255.255.255.248,86400s --dhcp-lease-max= --dhcp-hostsfile=/usr/lib/python2./site-packages/networks/nova-br100.conf --dhcp-script=/usr/local/bin/nova-dhcpbridge --no-hosts --leasefile-ro --domain=novalocal --addn-hosts=/usr/lib/python2./site-packages/networks/nova-br100.hosts\nExit code: \nStdout: u\'\'\nStderr: u\'sh: /usr/local/bin/nova-dhcpbridge: No such file or directory\\n\\ndnsmasq: cannot run lease-init script /usr/local/bin/nova-dhcpbridge: No such file or directory\\n\'\n']
解决方法:
$vim /etc/nova/nova.conf dhcpbridge=/usr/bin/nova-dhcpbridge
问题10:openstack启动docker容器失败
Apr :: compute1 nova-network[]: -- ::20.040 ERROR oslo.messaging._drivers.common
[req-094f943e-e7c7-4b47-9a4b-0ba1049440dc ] Returning exception Unexpected error while running command.
Apr :: compute1 nova-network[]: Command: sudo nova-rootwrap /etc/nova/rootwrap.conf env CONFIG_FILE=["/etc/nova/nova-dhcpbridge.conf"]
NETWORK_ID= dnsmasq --strict-order --bind-interfaces --conf-file= --pid-file=/usr/lib/python2./site-packages/networks/nova-br100.pid
--dhcp-optsfile=/usr/lib/python2./site-packages/networks/nova-br100.opts --listen-address=203.0.113.25 --except-interface=lo
--dhcp-range=set:demo-net,203.0.113.26,static,255.255.255.248,86400s --dhcp-lease-max= --dhcp-hostsfile=/usr/lib/python2./site-packages/networks/nova-br100.conf
--dhcp-script=/usr/bin/nova-dhcpbridge --no-hosts --leasefile-ro --domain=novalocal --addn-hosts=/usr/lib/python2./site-packages/networks/nova-br100.hosts
Apr :: compute1 nova-network[]: Exit code:
Apr :: compute1 nova-network[]: Stdout: u''
Apr :: compute1 nova-network[]: Stderr: u'Traceback (most recent call last):\n File "/usr/bin/nova-dhcpbridge", line 10, in <module>\n
sys.exit(main())\n File "/usr/lib/python2.7/site-packages/nova/cmd/dhcpbridge.py", line , in main\n
default_config_files=jsonutils.loads(os.environ[\'CONFIG_FILE\']))\n File "/usr/lib/python2.7/site-packages/nova/config.py", line 40, in parse_args\n
default_config_files=default_config_files)\n File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line , in __call__\n
raise ConfigFilesNotFoundError(self._namespace._files_not_found)\noslo_config.cfg.ConfigFilesNotFoundError:
Failed to find some config files: /etc/nova/nova-dhcpbridge.conf\n\ndnsmasq: lease-init script returned exit code \n' to caller
Apr :: compute1 nova-network[]: -- ::20.041 ERROR oslo.messaging._drivers.common [req-094f943e-e7c7-4b47-9a4b-0ba1049440dc ] ['Traceback (most recent call last):\n', ' File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 134, in _dispatch_and_reply\n incoming.message))\n', ' File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 177, in _dispatch\n return self._do_dispatch(endpoint, method, ctxt, args)\n', ' File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 123, in _do_dispatch\n result = getattr(endpoint, method)(ctxt, **new_args)\n', ' File "/usr/lib/python2.7/site-packages/nova/network/floating_ips.py", line 114, in allocate_for_instance\n **kwargs)\n', ' File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 511, in allocate_for_instance\n requested_networks=requested_networks)\n', ' File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 192, in _allocate_fixed_ips\n vpn=vpn, address=address)\n', ' File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 967, in allocate_fixed_ip\n exc_info=True)\n', ' File "/usr/lib/python2.7/site-packages/nova/openstack/common/excutils.py", line 82, in __exit__\n six.reraise(self.type_, self.value, self.tb)\n', ' File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 943, in allocate_fixed_ip\n self._setup_network_on_host(context, network)\n', ' File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 1823, in _setup_network_on_host\n self.driver.update_dhcp(elevated, dev, network)\n', ' File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line 1012, in update_dhcp\n restart_dhcp(context, dev, network_ref, fixedips)\n', ' File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line 272, in inner\n return f(*args, **kwargs)\n', ' File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line 1127, in restart_dhcp\n _execute(*cmd, run_as_root=True)\
Apr :: compute1 nova-network[]: n', ' File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line , in _execute\n return utils.execute(*cmd, **kwargs)\n', ' File "/usr/lib/python2.7/site-packages/nova/utils.py", line , in execute\n return processutils.execute(*cmd, **kwargs)\n', ' File "/usr/lib/python2.7/site-packages/nova/openstack/common/processutils.py", line , in execute\n cmd=sanitized_cmd)\n', 'ProcessExecutionError: Unexpected error while running command.\nCommand: sudo nova-rootwrap /etc/nova/rootwrap.conf env CONFIG_FILE=["/etc/nova/nova-dhcpbridge.conf"] NETWORK_ID= dnsmasq --strict-order --bind-interfaces --conf-file= --pid-file=/usr/lib/python2./site-packages/networks/nova-br100.pid --dhcp-optsfile=/usr/lib/python2./site-packages/networks/nova-br100.opts --listen-address=203.0.113.25 --except-interface=lo --dhcp-range=set:demo-net,203.0.113.26,static,255.255.255.248,86400s --dhcp-lease-max= --dhcp-hostsfile=/usr/lib/python2./site-packages/networks/nova-br100.conf --dhcp-script=/usr/bin/nova-dhcpbridge --no-hosts --leasefile-ro --domain=novalocal --addn-hosts=/usr/lib/python2./site-packages/networks/nova-br100.hosts\nExit code: \nStdout: u\'\'\nStderr: u\'Traceback (most recent call last):\\n File "/usr/bin/nova-dhcpbridge", line 10, in <module>\\n sys.exit(main())\\n File "/usr/lib/python2.7/site-packages/nova/cmd/dhcpbridge.py", line 118, in main\\n default_config_files=jsonutils.loads(os.environ[\\\'CONFIG_FILE\\\']))\\n File "/usr/lib/python2.7/site-packages/nova/config.py", line 40, in parse_args\\n default_config_files=default_config_files)\\n File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 1853, in __call__\\n raise ConfigFilesNotFoundError(self._namespace._files_not_found)\\noslo_config.cfg.ConfigFilesNotFoundError: Failed to find some config files: /etc/nova/nova-dhcpbridge.conf\\n\\ndnsmasq: lease-init script returned exit code 1\\n\'\n']
解决方法:
1 $vim /etc/nova/nova.conf
2
3 dhcpbridge_flagfile=/etc/nova/nova.conf
问题11:openstack启动docker容器失败
ERROR nova.scheduler.utils [req-1acf2a88-cfd6--80b2-3fcce844a58d None] [instance: 49cbea5c-24fb-44f3-b0fa-99b53f08a505]
Error from last host: compute1 (node compute1): [u'Traceback (most recent call last):\n', u'
File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line , in _do_build_and_run_instance\n
filter_properties)\n', u' File "/usr/lib/python2.7/site-packages/nova/compute/manager.py",
line , in _build_and_run_instance\n instance_uuid=instance.uuid, reason=six.text_type(e))\n',
u'RescheduledException: Build of instance 49cbea5c-24fb-44f3-b0fa-99b53f08a505 was re-scheduled:
Cannot setup network: Cannot find any PID under container "4fd5e1ef22a49e4078c484fc7c530847d010d7fd573be008459c91a4509cd7fe"\n']
解决方法:
打这个补丁
https://review.openstack.org/#/c/84830/
问题12:openstack启动docker容器失败
ERROR nova.scheduler.utils [req-c5282979-da83-4d08-a97d-48a9aa5658bd None] [instance: 5c95ab9d-bc47-4bc6-ae95-d6a6ac19b5f0]
Error from last host: compute1 (node compute1): [u'Traceback (most recent call last):\n', u'
File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line , in _do_build_and_run_instance\n
filter_properties)\n', u' File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line , in _build_and_run_instance\n
instance_uuid=instance.uuid, reason=six.text_type(e))\n', u'RescheduledException: Build of instance 5c95ab9d-bc47-4bc6-ae95-d6a6ac19b5f0 was re-scheduled:
Cannot create container\n'] failed to load names nova-br100.hosts: No such file or directory
解决方法:在相应目录下建nova-br100.hosts空文件
问题13:openstack启动docker容器失败(找不到image)
Apr :: localhost nova-compute: -- ::29.610 AUDIT nova.compute.manager [req-f4550ddc-49a5-4d58-becc-81e811bef89f None] [instance: 3a71e9cd-3fff-47c8-b60c-1faf6da85b9d] Starting instance...
Apr :: localhost nova-compute: -- ::29.893 AUDIT nova.compute.claims [-] [instance: 3a71e9cd-3fff-47c8-b60c-1faf6da85b9d] Attempting claim: memory MB, disk GB
Apr :: localhost nova-compute: -- ::29.894 AUDIT nova.compute.claims [-] [instance: 3a71e9cd-3fff-47c8-b60c-1faf6da85b9d] Total memory: MB, used: 512.00 MB
Apr :: localhost nova-compute: -- ::29.894 AUDIT nova.compute.claims [-] [instance: 3a71e9cd-3fff-47c8-b60c-1faf6da85b9d] memory limit: 4210.50 MB, free: 3698.50 MB
Apr :: localhost nova-compute: -- ::29.894 AUDIT nova.compute.claims [-] [instance: 3a71e9cd-3fff-47c8-b60c-1faf6da85b9d] Total disk: GB, used: 0.00 GB
Apr :: localhost nova-compute: -- ::29.895 AUDIT nova.compute.claims [-] [instance: 3a71e9cd-3fff-47c8-b60c-1faf6da85b9d] disk limit not specified, defaulting to unlimited
Apr :: localhost nova-compute: -- ::29.942 AUDIT nova.compute.claims [-] [instance: 3a71e9cd-3fff-47c8-b60c-1faf6da85b9d] Claim successful
Apr :: localhost nova-compute: -- ::30.539 INFO nova.scheduler.client.report [-] Compute_service record updated for ('compute1', 'compute1')
Apr :: localhost nova-compute: -- ::30.735 INFO nova.scheduler.client.report [-] Compute_service record updated for ('compute1', 'compute1')
Apr :: localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="GET /v1.7/images/192.168.245.148:5042/centos/json"
Apr :: localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="+job image_inspect(192.168.245.148:5042/centos)"
Apr :: localhost docker: No such image: 192.168.245.148:/centos
Apr :: localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="-job image_inspect(192.168.245.148:5042/centos) = ERR (1)"
Apr :: localhost docker: time="2015-04-29T13:09:31+08:00" level="error" msg="Handler for GET /images/{name:.*}/json returned error: No such image: 192.168.245.148:5042/centos"
Apr :: localhost docker: time="2015-04-29T13:09:31+08:00" level="error" msg="HTTP Error: statusCode=404 No such image: 192.168.245.148:5042/centos"
Apr :: localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="POST /v1.7/containers/create?name=nova-3a71e9cd-3fff-47c8-b60c-1faf6da85b9d"
Apr :: localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="+job create(nova-3a71e9cd-3fff-47c8-b60c-1faf6da85b9d)"
Apr :: localhost docker: No such image: 192.168.245.148:/centos (tag: latest)
Apr :: localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="-job create(nova-3a71e9cd-3fff-47c8-b60c-1faf6da85b9d) = ERR (1)"
Apr :: localhost docker: time="2015-04-29T13:09:31+08:00" level="error" msg="Handler for POST /containers/create returned error: No such image: 192.168.245.148:5042/centos (tag: latest)"
Apr :: localhost docker: time="2015-04-29T13:09:31+08:00" level="error" msg="HTTP Error: statusCode=404 No such image: 192.168.245.148:5042/centos (tag: latest)"
Apr :: localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="POST /v1.7/images/create?fromImage=192.168.245.148&tag=5042/centos"
Apr :: localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="+job pull(192.168.245.148, 5042/centos)"
Apr :: localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="+job resolve_repository(docker.io/192.168.245.148)"
Apr :: localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="-job resolve_repository(docker.io/192.168.245.148) = OK (0)"
Apr :: localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="+job trust_update_base()"
Apr :: localhost nova-compute: -- ::31.570 INFO novadocker.virt.docker.driver [-] Image name "192.168.245.148:5042/centos" does not exist, fetching it...
Apr :: localhost avahi-daemon[]: Withdrawing address record for 192.168.245.148 on ens33.
Apr :: localhost avahi-daemon[]: Leaving mDNS multicast group on interface ens33.IPv4 with address 192.168.245.148.
Apr :: localhost avahi-daemon[]: Interface ens33.IPv4 no longer relevant for mDNS.
Apr :: localhost NetworkManager[]: <error> [1430284172.493407] [platform/nm-linux-platform.c:] add_object(): Netlink error adding 0.0.0.0/ via 192.168.245.2 dev ens33 metric mss src user: Unspecific failure
Apr :: localhost NetworkManager[]: <warn> default-route4: failed to add default route 0.0.0.0/ via 192.168.245.2 dev ens33 metric mss src user with effective metric
Apr :: localhost NetworkManager: inet default table main
Apr :: localhost NetworkManager: priority 0x6a protocol static
Apr :: localhost NetworkManager: nexthop via 192.168.245.2 dev
Apr :: localhost NetworkManager[]: <error> [1430284172.868563] [platform/nm-linux-platform.c:] add_object(): Netlink error adding 0.0.0.0/ via 192.168.245.2 dev ens33 metric mss src user: Unspecific failure
Apr :: localhost NetworkManager[]: <warn> default-route4: failed to add default route 0.0.0.0/ via 192.168.245.2 dev ens33 metric mss src user with effective metric
Apr :: localhost NetworkManager: inet default table main
Apr :: localhost NetworkManager: priority 0x6b protocol static
Apr :: localhost NetworkManager: nexthop via 192.168.245.2 dev
Apr :: localhost dnsmasq[]: read /usr/lib/python2./site-packages/networks/nova-br100.hosts - addresses
Apr :: localhost dnsmasq-dhcp[]: read /usr/lib/python2./site-packages/networks/nova-br100.conf
Apr :: localhost dnsmasq-dhcp[]: read /usr/lib/python2./site-packages/networks/nova-br100.opts
Apr :: localhost nova-compute: -- ::34.458 INFO nova.scheduler.client.report [-] Compute_service record updated for ('compute1', 'compute1')
Apr :: localhost nova-compute: -- ::43.162 AUDIT nova.compute.resource_tracker [-] Auditing locally available compute resources
Apr :: localhost nova-compute: -- ::43.277 AUDIT nova.compute.resource_tracker [-] Total physical ram (MB): , total allocated virtual ram (MB):
Apr :: localhost nova-compute: -- ::43.277 AUDIT nova.compute.resource_tracker [-] Free disk (GB):
Apr :: localhost nova-compute: -- ::43.277 AUDIT nova.compute.resource_tracker [-] Total usable vcpus: , total allocated vcpus:
Apr :: localhost nova-compute: -- ::43.278 AUDIT nova.compute.resource_tracker [-] PCI stats: []
Apr :: localhost nova-compute: -- ::43.308 INFO nova.scheduler.client.report [-] Compute_service record updated for ('compute1', 'compute1')
Apr :: localhost nova-compute: -- ::43.309 INFO nova.compute.resource_tracker [-] Compute_service record updated for compute1:compute1
Apr :: localhost docker: time="2015-04-29T13:09:50+08:00" level="info" msg="Trust graph fetch failed: Get https://dvjy3tqbc323p.cloudfront.net/trust/official.json: net/http: TLS handshake timeout"
Apr :: localhost docker: time="2015-04-29T13:09:50+08:00" level="info" msg="-job trust_update_base() = OK (0)"
Apr :: localhost systemd: Created slice user-.slice.
Apr :: localhost systemd: Starting Session of user root.
Apr :: localhost systemd: Started Session of user root.
Apr :: localhost docker: Get https://index.docker.io/v1/repositories/library/192.168.245.148/images: dial tcp 162.242.195.84:443: connection refused
Apr :: localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="-job pull(docker.io/192.168.245.148, 5042/centos) = ERR (1)"
Apr :: localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="POST /v1.7/containers/create?name=nova-3a71e9cd-3fff-47c8-b60c-1faf6da85b9d"
Apr :: localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="+job create(nova-3a71e9cd-3fff-47c8-b60c-1faf6da85b9d)"
Apr :: localhost docker: No such image: 192.168.245.148:/centos (tag: latest)
Apr :: localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="-job create(nova-3a71e9cd-3fff-47c8-b60c-1faf6da85b9d) = ERR (1)"
Apr :: localhost docker: time="2015-04-29T13:10:16+08:00" level="error" msg="Handler for POST /containers/create returned error: No such image: 192.168.245.148:5042/centos (tag: latest)"
Apr :: localhost docker: time="2015-04-29T13:10:16+08:00" level="error" msg="HTTP Error: statusCode=404 No such image: 192.168.245.148:5042/centos (tag: latest)"
Apr :: localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="GET /v1.7/containers/ps?all=1"
Apr :: localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="+job containers()"
Apr :: localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="-job containers() = OK (0)"
Apr :: localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="GET /v1.7/containers/12176cd27604886980e8a1c1651ba140a98e63c5f161603b9113ca5d988e6ee4/json"
Apr :: localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="+job container_inspect(12176cd27604886980e8a1c1651ba140a98e63c5f161603b9113ca5d988e6ee4)"
Apr :: localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="-job container_inspect(12176cd27604886980e8a1c1651ba140a98e63c5f161603b9113ca5d988e6ee4) = OK (0)"
Apr :: localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="GET /v1.7/containers/855123ad5274f9ea2ad4b66d6dffacda0f8788b7e4b62e6386cef119497325a5/json"
Apr :: localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="+job container_inspect(855123ad5274f9ea2ad4b66d6dffacda0f8788b7e4b62e6386cef119497325a5)"
解决方法:修改文件"/usr/lib/python2.7/site-packages/novadocker/virt/docker/driver.py":
def _get_image_name(self, context, instance, image):
fmt = image['container_format']
if fmt != 'docker':
msg = _('Image container format not supported ({0})')
raise exception.InstanceDeployFailure(msg.format(fmt),
instance_id=instance['name'])
return image['name'].lower();