首页 资讯 社群 我的社区 搜索

OpenStack集成Docker

yimo~
2019-07-19 16:57:30

最近在做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 0

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 23 16:05:23 localhost systemd: Starting OpenStack Nova Compute Server...
Apr 23 16:05:23 localhost nova-compute: 2015-04-23 16:05:23.701 6559 DEBUG nova.servicegroup.api [-] ServiceGroup driver defined as an instance of db __new__ /usr/lib/python2.7/site-packages/nova/servicegroup/api.py:65
Apr 23 16:05:23 localhost nova-compute: 2015-04-23 16:05:23.967 6559 INFO nova.virt.driver [-] Loading compute driver 'novadocker.virt.docker.DockerDriver'
Apr 23 16:05:23 localhost nova-compute: 2015-04-23 16:05:23.975 6559 ERROR nova.virt.driver [-] Unable to load the virtualization driver
Apr 23 16:05:23 localhost nova-compute: 2015-04-23 16:05:23.975 6559 TRACE nova.virt.driver Traceback (most recent call last):
Apr 23 16:05:23 localhost nova-compute: 2015-04-23 16:05:23.975 6559 TRACE nova.virt.driver   File "/usr/lib/python2.7/site-packages/nova/virt/driver.py", line 1402, in load_compute_driver
Apr 23 16:05:23 localhost nova-compute: 2015-04-23 16:05:23.975 6559 TRACE nova.virt.driver     virtapi)
Apr 23 16:05:23 localhost nova-compute: 2015-04-23 16:05:23.975 6559 TRACE nova.virt.driver   File "/usr/lib/python2.7/site-packages/nova/openstack/common/importutils.py", line 52, in import_object_ns
Apr 23 16:05:23 localhost nova-compute: 2015-04-23 16:05:23.975 6559 TRACE nova.virt.driver     return import_class(import_str)(*args, **kwargs)
Apr 23 16:05:23 localhost nova-compute: 2015-04-23 16:05:23.975 6559 TRACE nova.virt.driver   File "/usr/lib/python2.7/site-packages/nova/openstack/common/importutils.py", line 27, in import_class
Apr 23 16:05:23 localhost nova-compute: 2015-04-23 16:05:23.975 6559 TRACE nova.virt.driver     __import__(mod_str)
Apr 23 16:05:23 localhost nova-compute: 2015-04-23 16:05:23.975 6559 TRACE nova.virt.driver   File "/usr/lib/python2.7/site-packages/novadocker/virt/docker/__init__.py", line 20, in <module>
Apr 23 16:05:23 localhost nova-compute: 2015-04-23 16:05:23.975 6559 TRACE nova.virt.driver     from novadocker.virt.docker import driver
Apr 23 16:05:23 localhost nova-compute: 2015-04-23 16:05:23.975 6559 TRACE nova.virt.driver   File "/usr/lib/python2.7/site-packages/novadocker/virt/docker/driver.py", line 29, in <module>
Apr 23 16:05:23 localhost nova-compute: 2015-04-23 16:05:23.975 6559 TRACE nova.virt.driver     from oslo_log import log
Apr 23 16:05:23 localhost nova-compute: 2015-04-23 16:05:23.975 6559 TRACE nova.virt.driver ImportError: No module named oslo_log
Apr 23 16:05:23 localhost nova-compute: 2015-04-23 16:05:23.975 6559 TRACE nova.virt.driver
Apr 23 16:05:24 localhost systemd: openstack-nova-compute.service: main process exited, code=exited, status=1/FAILURE
Apr 23 16:05:24 localhost systemd: Failed to start OpenStack Nova Compute Server.
Apr 23 16:05:24 localhost systemd: Unit openstack-nova-compute.service entered failed state.
Apr 23 16:05:24 localhost systemd: openstack-nova-compute.service holdoff time over, scheduling restart.
Apr 23 16:05:24 localhost systemd: Stopping OpenStack Nova Compute Server...

解决方法:安装oslo.log,下载oslo.log-1.1.0.tar.gz,解压缩,python setup.py install

问题2:计算节点Nova-compute启动报错

Apr 23 16:40:11 localhost systemd: Starting OpenStack Nova Compute Server...
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.216 8158 DEBUG nova.servicegroup.api [-] ServiceGroup driver defined as an instance of db __new__ /usr/lib/python2.7/site-packages/nova/servicegroup/api.py:65
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.435 8158 INFO nova.virt.driver [-] Loading compute driver 'novadocker.virt.docker.DockerDriver'
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.497 8158 INFO nova.openstack.common.periodic_task [-] Skipping periodic task _periodic_update_dns because its interval is negative
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 CRITICAL nova [-] TypeError: __init__() takes at least 2 arguments (1 given)
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova Traceback (most recent call last):
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova   File "/usr/bin/nova-compute", line 10, in <module>
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova     sys.exit(main())
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/cmd/compute.py", line 72, in main
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova     db_allowed=CONF.conductor.use_local)
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/service.py", line 275, in create
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova     db_allowed=db_allowed)
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/service.py", line 148, in __init__
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova     self.manager = manager_class(host=self.host, *args, **kwargs)
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 631, in __init__
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova     self.driver = driver.load_compute_driver(self.virtapi, compute_driver)
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/virt/driver.py", line 1402, in load_compute_driver
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova     virtapi)
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/openstack/common/importutils.py", line 52, in import_object_ns
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova     return import_class(import_str)(*args, **kwargs)
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova   File "/usr/lib/python2.7/site-packages/novadocker/virt/docker/driver.py", line 102, in __init__
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova     default='nova.virt.firewall.NoopFirewallDriver')
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/virt/firewall.py", line 49, in load_driver
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova     return fw_class(*args, **kwargs)
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova TypeError: __init__() takes at least 2 arguments (1 given)
Apr 23 16:40:12 localhost nova-compute: 2015-04-23 16:40:12.545 8158 TRACE nova
Apr 23 16:40:12 localhost systemd: openstack-nova-compute.service: main process exited, code=exited, status=1/FAILURE
Apr 23 16:40:12 localhost systemd: Failed to start OpenStack Nova Compute Server.
Apr 23 16:40:12 localhost systemd: Unit openstack-nova-compute.service entered failed state.
Apr 23 16:40:12 localhost systemd: openstack-nova-compute.service holdoff time over, scheduling restart.
Apr 23 16:40:12 localhost systemd: Stopping OpenStack Nova Compute Server...
Apr 23 16:40:12 localhost systemd: Starting OpenStack Nova Compute Server...
Apr 23 16:40:12 localhost systemd: openstack-nova-compute.service start request repeated too quickly, refusing to start.
Apr 23 16:40:12 localhost systemd: Failed to start OpenStack Nova Compute Server.
Apr 23 16:40:12 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 23 16:59:41 localhost systemd: Starting OpenStack Nova Compute Server...
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.245 4381 DEBUG nova.servicegroup.api [-] ServiceGroup driver defined as an instance of db __new__ /usr/lib/python2.7/site-packages/nova/servicegroup/api.py:65
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.446 4381 INFO nova.virt.driver [-] Loading compute driver 'novadocker.virt.docker.DockerDriver'
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.501 4381 INFO nova.openstack.common.periodic_task [-] Skipping periodic task _periodic_update_dns because its interval is negative
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.505 4381 INFO oslo.messaging._drivers.impl_rabbit [req-31fa628a-dbcc-41b2-9622-ecb9b30d3dee ] Connecting to AMQP server on controller:5672
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.543 4381 INFO oslo.messaging._drivers.impl_rabbit [req-31fa628a-dbcc-41b2-9622-ecb9b30d3dee ] Connected to AMQP server on controller:5672
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.561 4381 INFO oslo.messaging._drivers.impl_rabbit [req-31fa628a-dbcc-41b2-9622-ecb9b30d3dee ] Connecting to AMQP server on controller:5672
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.594 4381 INFO oslo.messaging._drivers.impl_rabbit [req-31fa628a-dbcc-41b2-9622-ecb9b30d3dee ] Connected to AMQP server on controller:5672
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.609 4381 DEBUG nova.openstack.common.service [-] Full set of CONF: _wait_for_exit_or_signal /usr/lib/python2.7/site-packages/nova/openstack/common/service.py:167
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.610 4381 DEBUG nova.openstack.common.service [-] ******************************************************************************** log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2171
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.610 4381 DEBUG nova.openstack.common.service [-] Configuration options gathered from: log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2172
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.610 4381 DEBUG nova.openstack.common.service [-] command line args: [] log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2173
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.610 4381 DEBUG nova.openstack.common.service [-] config files: ['/etc/nova/nova.conf'] log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2174
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.610 4381 DEBUG nova.openstack.common.service [-] ================================================================================ log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2175
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.610 4381 DEBUG nova.openstack.common.service [-] allow_instance_snapshots       = True log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.611 4381 DEBUG nova.openstack.common.service [-] allow_migrate_to_same_host     = False log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.611 4381 DEBUG nova.openstack.common.service [-] allow_resize_to_same_host      = False log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.611 4381 DEBUG nova.openstack.common.service [-] allow_same_net_traffic         = False log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.611 4381 DEBUG nova.openstack.common.service [-] amqp_auto_delete               = False log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.611 4381 DEBUG nova.openstack.common.service [-] amqp_durable_queues            = False log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.611 4381 DEBUG nova.openstack.common.service [-] api_paste_config               = api-paste.ini log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.612 4381 DEBUG nova.openstack.common.service [-] api_rate_limit                 = False log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.612 4381 DEBUG nova.openstack.common.service [-] auth_strategy                  = keystone log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.612 4381 DEBUG nova.openstack.common.service [-] auto_assign_floating_ip        = False log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.612 4381 DEBUG nova.openstack.common.service [-] backdoor_port                  = None log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.613 4381 DEBUG nova.openstack.common.service [-] bandwidth_poll_interval        = 600 log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.613 4381 DEBUG nova.openstack.common.service [-] bindir                         = /usr/local/bin log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.613 4381 DEBUG nova.openstack.common.service [-] block_device_allocate_retries  = 60 log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.614 4381 DEBUG nova.openstack.common.service [-] block_device_allocate_retries_interval = 3 log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost systemd: Started OpenStack Nova Compute Server.
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.614 4381 DEBUG nova.openstack.common.service [-] boot_script_template           = /usr/lib/python2.7/site-packages/nova/cloudpipe/bootscript.template log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.614 4381 DEBUG nova.openstack.common.service [-] ca_file                        = cacert.pem log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.615 4381 DEBUG nova.openstack.common.service [-] ca_path                        = /usr/lib/python2.7/site-packages/CA log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.615 4381 DEBUG nova.openstack.common.service [-] cert_manager                   = nova.cert.manager.CertManager log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.615 4381 DEBUG nova.openstack.common.service [-] client_socket_timeout          = 0 log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.615 4381 DEBUG nova.openstack.common.service [-] cnt_vpn_clients                = 0 log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.615 4381 DEBUG nova.openstack.common.service [-] compute_available_monitors     = ['nova.compute.monitors.all_monitors'] log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.616 4381 DEBUG nova.openstack.common.service [-] compute_driver                 = novadocker.virt.docker.DockerDriver log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.616 4381 DEBUG nova.openstack.common.service [-] compute_manager                = nova.compute.manager.ComputeManager log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.616 4381 DEBUG nova.openstack.common.service [-] compute_monitors               = [] log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.616 4381 DEBUG nova.openstack.common.service [-] compute_resources              = ['vcpu'] log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.617 4381 DEBUG nova.openstack.common.service [-] compute_stats_class            = nova.compute.stats.Stats log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.617 4381 DEBUG nova.openstack.common.service [-] compute_topic                  = compute log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.619 4381 DEBUG nova.openstack.common.service [-] config_dir                     = None log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.619 4381 DEBUG nova.openstack.common.service [-] config_file                    = ['/etc/nova/nova.conf'] log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.619 4381 DEBUG nova.openstack.common.service [-] console_host                   = compute1 log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.619 4381 DEBUG nova.openstack.common.service [-] console_manager                = nova.console.manager.ConsoleProxyManager log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.620 4381 DEBUG nova.openstack.common.service [-] console_topic                  = console log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.620 4381 DEBUG nova.openstack.common.service [-] consoleauth_manager            = nova.consoleauth.manager.ConsoleAuthManager log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.620 4381 DEBUG nova.openstack.common.service [-] consoleauth_topic              = consoleauth log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.621 4381 DEBUG nova.openstack.common.service [-] control_exchange               = nova log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.621 4381 DEBUG nova.openstack.common.service [-] create_unique_mac_address_attempts = 5 log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.621 4381 DEBUG nova.openstack.common.service [-] crl_file                       = crl.pem log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.622 4381 DEBUG nova.openstack.common.service [-] db_driver                      = nova.db log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.622 4381 DEBUG nova.openstack.common.service [-] debug                          = True log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.622 4381 DEBUG nova.openstack.common.service [-] default_access_ip_network_name = None log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.622 4381 DEBUG nova.openstack.common.service [-] default_availability_zone      = nova log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.623 4381 DEBUG nova.openstack.common.service [-] default_ephemeral_format       = None log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.623 4381 DEBUG nova.openstack.common.service [-] default_flavor                 = m1.small log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.623 4381 DEBUG nova.openstack.common.service [-] default_floating_pool          = nova log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.623 4381 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.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.624 4381 DEBUG nova.openstack.common.service [-] default_notification_level     = INFO log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.624 4381 DEBUG nova.openstack.common.service [-] default_publisher_id           = None log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.624 4381 DEBUG nova.openstack.common.service [-] default_schedule_zone          = None log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.624 4381 DEBUG nova.openstack.common.service [-] defer_iptables_apply           = False log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.625 4381 DEBUG nova.openstack.common.service [-] dhcp_domain                    = novalocal log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.625 4381 DEBUG nova.openstack.common.service [-] dhcp_lease_time                = 86400 log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.625 4381 DEBUG nova.openstack.common.service [-] dhcpbridge                     = /usr/local/bin/nova-dhcpbridge log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost nova-compute: 2015-04-23 16:59:42.626 4381 DEBUG nova.openstack.common.service [-] dhcpbridge_flagfile            = ['/etc/nova/nova-dhcpbridge.conf'] log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2184
Apr 23 16:59:42 localhost systemd: openstack-nova-compute.service holdoff time over, scheduling restart.
Apr 23 16:59:42 localhost systemd: Stopping OpenStack Nova Compute Server...
Apr 23 16:59:42 localhost systemd: Starting OpenStack Nova Compute Server...
Apr 23 16:59:43 localhost systemd: Started OpenStack Nova Compute Server.
Apr 23 16:59:44 localhost systemd: openstack-nova-compute.service holdoff time over, scheduling restart.
Apr 23 16:59:44 localhost systemd: Stopping OpenStack Nova Compute Server...
Apr 23 16:59:44 localhost systemd: Starting OpenStack Nova Compute Server...
Apr 23 16:59:44 localhost systemd: openstack-nova-compute.service start request repeated too quickly, refusing to start.
Apr 23 16:59:44 localhost systemd: Failed to start OpenStack Nova Compute Server.
Apr 23 16:59:44 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 23 18:21:20 localhost dbus-daemon: 'list' object has no attribute 'split'
Apr 23 18:21:21 localhost systemd: Starting OpenStack Nova Network Server...
Apr 23 18:21:22 localhost systemd: Started OpenStack Nova Network Server.
Apr 23 18:21:22 localhost dbus-daemon: dbus[794]: [system] Activating service name='org.fedoraproject.Setroubleshootd' (using servicehelper)
Apr 23 18:21:22 localhost dbus[794]: [system] Activating service name='org.fedoraproject.Setroubleshootd' (using servicehelper)
Apr 23 18:21:22 localhost systemd: openstack-nova-network.service holdoff time over, scheduling restart.
Apr 23 18:21:22 localhost systemd: Stopping OpenStack Nova Network Server...
Apr 23 18:21:23 localhost systemd: Starting OpenStack Nova Network Server...
Apr 23 18:21:23 localhost dbus-daemon: dbus[794]: [system] Successfully activated service 'org.fedoraproject.Setroubleshootd'
Apr 23 18:21:23 localhost dbus[794]: [system] Successfully activated service 'org.fedoraproject.Setroubleshootd'
Apr 23 18:21:23 localhost systemd: Started OpenStack Nova Network Server.
Apr 23 18:21:24 localhost setroubleshoot: Plugin Exception restorecon_source
Apr 23 18:21:24 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-2631-47e7-85d6-f1c6de6fca13
Apr 23 18:21:24 localhost python: SELinux is preventing /usr/bin/sudo from search access on the directory /var/lib/sss.

解决方法:关闭selinux

1、临时关闭(不用重启机器):

$setenforce 0

2、修改配置文件需要重启机器:

$vim /etc/selinux/config
SELINUX=disabled

重启机器即可

问题5:计算节点Nova-network启动报错

Apr 24 11:41:53 localhost systemd: openstack-nova-network.service holdoff time over, scheduling restart.
Apr 24 11:41:53 localhost systemd: Stopping OpenStack Nova Network Server...
Apr 24 11:41:53 localhost systemd: Starting OpenStack Nova Network Server...
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.297 5473 INFO nova.openstack.common.periodic_task [-] Skipping periodic task _periodic_update_dns because its interval is negative
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.299 5473 INFO nova.network.driver [-] Loading network driver 'nova.network.linux_net'
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.302 5473 INFO oslo.messaging._drivers.impl_rabbit [req-a893822c-a843-43cf-9be6-357f35810c05 ] Connecting to AMQP server on controller:5672
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.338 5473 INFO oslo.messaging._drivers.impl_rabbit [req-a893822c-a843-43cf-9be6-357f35810c05 ] Connected to AMQP server on controller:5672
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.362 5473 INFO oslo.messaging._drivers.impl_rabbit [req-a893822c-a843-43cf-9be6-357f35810c05 ] Connecting to AMQP server on controller:5672
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.383 5473 INFO oslo.messaging._drivers.impl_rabbit [req-a893822c-a843-43cf-9be6-357f35810c05 ] Connected to AMQP server on controller:5672
Apr 24 11:41:54 localhost systemd: Started OpenStack Nova Network Server.
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.429 5473 AUDIT nova.service [-] Starting network node (version 2014.2.2-1.el7)
Apr 24 11:41:54 localhost nova-network: Traceback (most recent call last):
Apr 24 11:41:54 localhost nova-network: File "/usr/lib/python2.7/site-packages/eventlet/hubs/poll.py", line 115, in wait
Apr 24 11:41:54 localhost nova-network: listener.cb(fileno)
Apr 24 11:41:54 localhost nova-network: File "/usr/lib/python2.7/site-packages/eventlet/greenthread.py", line 212, in main
Apr 24 11:41:54 localhost nova-network: result = function(*args, **kwargs)
Apr 24 11:41:54 localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/openstack/common/service.py", line 492, in run_service
Apr 24 11:41:54 localhost nova-network: service.start()
Apr 24 11:41:54 localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/service.py", line 164, in start
Apr 24 11:41:54 localhost nova-network: self.manager.init_host()
Apr 24 11:41:54 localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 1810, in init_host
Apr 24 11:41:54 localhost nova-network: self.driver.iptables_manager.defer_apply_off()
Apr 24 11:41:54 localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line 418, in defer_apply_off
Apr 24 11:41:54 localhost nova-network: self.apply()
Apr 24 11:41:54 localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line 434, in apply
Apr 24 11:41:54 localhost nova-network: self._apply()
Apr 24 11:41:54 localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line 269, in inner
Apr 24 11:41:54 localhost nova-network: with lock(name, lock_file_prefix, external, lock_path):
Apr 24 11:41:54 localhost nova-network: File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__
Apr 24 11:41:54 localhost nova-network: return self.gen.next()
Apr 24 11:41:54 localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line 232, in lock
Apr 24 11:41:54 localhost nova-network: ext_lock = external_lock(name, lock_file_prefix, lock_path)
Apr 24 11:41:54 localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line 180, in external_lock
Apr 24 11:41:54 localhost nova-network: lock_file_path = _get_lock_path(name, lock_file_prefix, lock_path)
Apr 24 11:41:54 localhost nova-network: File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line 171, in _get_lock_path
Apr 24 11:41:54 localhost nova-network: raise cfg.RequiredOptError('lock_path')
Apr 24 11:41:54 localhost nova-network: RequiredOptError: value required for option: lock_path
Apr 24 11:41:54 localhost nova-network: Removing descriptor: 3
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 ERROR nova.openstack.common.threadgroup [-] value required for option: lock_path
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup Traceback (most recent call last):
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/openstack/common/threadgroup.py", line 125, in wait
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup     x.wait()
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/openstack/common/threadgroup.py", line 47, in wait
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup     return self.thread.wait()
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/eventlet/greenthread.py", line 173, in wait
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup     return self._exit_event.wait()
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/eventlet/event.py", line 121, in wait
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup     return hubs.get_hub().switch()
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 293, in switch
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup     return self.greenlet.switch()
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/eventlet/greenthread.py", line 212, in main
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup     result = function(*args, **kwargs)
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/openstack/common/service.py", line 492, in run_service
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup     service.start()
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/service.py", line 164, in start
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup     self.manager.init_host()
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 1810, in init_host
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup     self.driver.iptables_manager.defer_apply_off()
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line 418, in defer_apply_off
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup     self.apply()
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line 434, in apply
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup     self._apply()
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line 269, in inner
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup     with lock(name, lock_file_prefix, external, lock_path):
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup   File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup     return self.gen.next()
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line 232, in lock
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup     ext_lock = external_lock(name, lock_file_prefix, lock_path)
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line 180, in external_lock
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup     lock_file_path = _get_lock_path(name, lock_file_prefix, lock_path)
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line 171, in _get_lock_path
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup     raise cfg.RequiredOptError('lock_path')
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup RequiredOptError: value required for option: lock_path
Apr 24 11:41:54 localhost nova-network: 2015-04-24 11:41:54.607 5473 TRACE nova.openstack.common.threadgroup
Apr 24 11:41:54 localhost systemd: openstack-nova-network.service holdoff time over, scheduling restart.
Apr 24 11:41:54 localhost systemd: Stopping OpenStack Nova Network Server...
Apr 24 11:41:54 localhost systemd: Starting OpenStack Nova Network Server...
Apr 24 11:41:54 localhost systemd: openstack-nova-network.service start request repeated too quickly, refusing to start.
Apr 24 11:41:54 localhost systemd: Failed to start OpenStack Nova Network Server.
Apr 24 11:41:54 localhost systemd: Unit openstack-nova-network.service entered failed state.
Apr 24 11:42:46 localhost nova-compute: 2015-04-24 11:42:46.123 5299 AUDIT nova.compute.resource_tracker [-] Auditing locally available compute resources
Apr 24 11:42:46 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 24 11:42:46 localhost docker: time="2015-04-24T11:42:46+08:00" level="info" msg="+job containers()"
Apr 24 11:42:46 localhost docker: time="2015-04-24T11:42:46+08:00" level="info" msg="-job containers() = OK (0)"
Apr 24 11:42:46 localhost docker: time="2015-04-24T11:42:46+08:00" level="info" msg="GET /v1.13/containers/c0dc9faa6e04a64a3a4e6ac3a93adcd5cb478d972ac5afd07967b74609be975c/json"
Apr 24 11:42:46 localhost docker: time="2015-04-24T11:42:46+08:00" level="info" msg="+job container_inspect(c0dc9faa6e04a64a3a4e6ac3a93adcd5cb478d972ac5afd07967b74609be975c)"
Apr 24 11:42:46 localhost docker: time="2015-04-24T11:42:46+08:00" level="info" msg="-job container_inspect(c0dc9faa6e04a64a3a4e6ac3a93adcd5cb478d972ac5afd07967b74609be975c) = OK (0)"
Apr 24 11:42:46 localhost nova-compute: 2015-04-24 11:42:46.223 5299 AUDIT nova.compute.resource_tracker [-] Total physical ram (MB): 2807, total allocated virtual ram (MB): 512
Apr 24 11:42:46 localhost nova-compute: 2015-04-24 11:42:46.223 5299 AUDIT nova.compute.resource_tracker [-] Free disk (GB): 26
Apr 24 11:42:46 localhost nova-compute: 2015-04-24 11:42:46.223 5299 AUDIT nova.compute.resource_tracker [-] Total usable vcpus: 2, total allocated vcpus: 0
Apr 24 11:42:46 localhost nova-compute: 2015-04-24 11:42:46.223 5299 AUDIT nova.compute.resource_tracker [-] PCI stats: []
Apr 24 11:42:46 localhost nova-compute: 2015-04-24 11:42:46.224 5299 INFO nova.compute.resource_tracker [-] Compute_service record updated for compute1:compute1

解决方法:

$mkdir -p /var/lib/nova/tmp
$chmod -R 777 /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 2015-04-28 14:13:48 CST; 21min ago
     Docs: man:libvirtd(8)
           http://libvirt.org
 Main PID: 1447 (libvirtd)
   CGroup: /system.slice/libvirtd.service
           └─1447 /usr/sbin/libvirtd

Apr 28 14:13:47 compute1 libvirtd[1447]: libvirt version: 1.2.8, package: 16.el7_1.2 (CentOS BuildSystem <http://bugs.centos.org>, 2015-03-...tos.org)
Apr 28 14:13:47 compute1 libvirtd[1447]: Module /usr/lib64/libvirt/connection-driver/libvirt_driver_lxc.so not accessible
Apr 28 14:13:48 compute1 systemd[1]: Started Virtualization daemon.
Apr 28 14:19:51 compute1 libvirtd[1447]: 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启动报错

2015-04-28 17:22:04.373 3302 ERROR nova.scheduler.utils [req-188f10fe-7773-4637-baeb-3704a9aabeee None] [instance: 3a26ef5b-aead-4dad-8519-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_instancen    filter_properties)n', u'  File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2164, in _build_and_run_instancen    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 deniedn']

Build of instance[Errno 13] Permission denied
 Build of instance was re-scheduled: [Errno 13] Permission denied
 
 
 Apr 28 17:36:00 compute1 nova-network[1088]: 2015-04-28 17:36:00.820 1088 TRACE oslo.messaging.rpc.dispatcher     fileutils.ensure_tree(CON...ks_path)
Apr 28 17:36:00 compute1 nova-network[1088]: 2015-04-28 17:36:00.820 1088 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/si...ure_tree
Apr 28 17:36:00 compute1 nova-network[1088]: 2015-04-28 17:36:00.820 1088 TRACE oslo.messaging.rpc.dispatcher     os.makedirs(path)
Apr 28 17:36:00 compute1 nova-network[1088]: 2015-04-28 17:36:00.820 1088 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib64/python2.7/...makedirs
Apr 28 17:36:00 compute1 nova-network[1088]: 2015-04-28 17:36:00.820 1088 TRACE oslo.messaging.rpc.dispatcher     mkdir(name, mode)
Apr 28 17:36:00 compute1 nova-network[1088]: 2015-04-28 17:36:00.820 1088 TRACE oslo.messaging.rpc.dispatcher OSError: [Errno 13] Permissio...etworks'
Apr 28 17:36:00 compute1 nova-network[1088]: 2015-04-28 17:36:00.820 1088 TRACE oslo.messaging.rpc.dispatcher
Apr 28 17:36:00 compute1 nova-network[1088]: 2015-04-28 17:36:00.822 1088 ERROR oslo.messaging._drivers.common [req-d01b04d0-c9fa-45a1-a173...o caller
Apr 28 17:36:00 compute1 nova-network[1088]: 2015-04-28 17:36:00.823 1088 ERROR oslo.messaging._drivers.common [req-d01b04d0-c9fa-45a1-a173...n', '  F
Apr 28 17:36:00 compute1 nova-network[1088]: e "/usr/lib64/python2.7/os.py", line 157, in makedirsn    mkdir(name, mode)n', "OSError: [Er...rks'n"]
Hint: Some lines were ellipsized, use -l to show in full.

解决方法:

$chmod -R 777 /usr/lib/python2.7/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-4025-a394-00588cbada4f ] Returning exception Unexpected error while running command.
Apr 29 09:06:08 compute1 nova-network[23089]: Command: sudo nova-rootwrap /etc/nova/rootwrap.conf env CONFIG_FILE=["/etc/nova/nova-dhcpbridge.conf"] NETWORK_ID=2 dnsmasq --strict-order --bind-interfaces --conf-file= --pid-file=/usr/lib/python2.7/site-packages/networks/nova-br100.pid --dhcp-optsfile=/usr/lib/python2.7/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=8 --dhcp-hostsfile=/usr/lib/python2.7/site-packages/networks/nova-br100.conf --dhcp-script=/usr/local/bin/nova-dhcpbridge --no-hosts --leasefile-ro --domain=novalocal --addn-hosts=/usr/lib/python2.7/site-packages/networks/nova-br100.hosts
Apr 29 09:06:08 compute1 nova-network[23089]: Exit code: 3
Apr 29 09:06:08 compute1 nova-network[23089]: Stdout: u''
Apr 29 09:06:08 compute1 nova-network[23089]: Stderr: u'sh: /usr/local/bin/nova-dhcpbridge: No such file or directorynndnsmasq: cannot run lease-init script /usr/local/bin/nova-dhcpbridge: No such file or directoryn' to caller
Apr 29 09:06:08 compute1 nova-network[23089]: 2015-04-29 09:06:08.149 23089 ERROR oslo.messaging._drivers.common [req-f35e6205-cece-4025-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_replyn    incoming.message))n', '  File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 177, in _dispatchn    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_dispatchn    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_instancen    **kwargs)n', '  File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 511, in allocate_for_instancen    requested_networks=requested_networks)n', '  File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 192, in _allocate_fixed_ipsn    vpn=vpn, address=address)n', '  File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 967, in allocate_fixed_ipn    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_ipn    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_hostn    self.driver.update_dhcp(elevated, dev, network)n', '  File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line 1012, in update_dhcpn    restart_dhcp(context, dev, network_ref, fixedips)n', '  File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line 272, in innern    return f(*args, **kwargs)n', '  File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line 1127, in restart_dhcpn    _execute(*cmd, run_as_root=True)
Apr 29 09:06:08 compute1 nova-network[23089]: n', '  File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line 1228, in _executen    return utils.execute(*cmd, **kwargs)n', '  File "/usr/lib/python2.7/site-packages/nova/utils.py", line 163, in executen    return processutils.execute(*cmd, **kwargs)n', '  File "/usr/lib/python2.7/site-packages/nova/openstack/common/processutils.py", line 203, in executen    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=2 dnsmasq --strict-order --bind-interfaces --conf-file= --pid-file=/usr/lib/python2.7/site-packages/networks/nova-br100.pid --dhcp-optsfile=/usr/lib/python2.7/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=8 --dhcp-hostsfile=/usr/lib/python2.7/site-packages/networks/nova-br100.conf --dhcp-script=/usr/local/bin/nova-dhcpbridge --no-hosts --leasefile-ro --domain=novalocal --addn-hosts=/usr/lib/python2.7/site-packages/networks/nova-br100.hostsnExit code: 3nStdout: 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 29 09:58:20 compute1 nova-network[24902]: 2015-04-29 09:58:20.040 24902 ERROR oslo.messaging._drivers.common 
[req-094f943e-e7c7-4b47-9a4b-0ba1049440dc ] Returning exception Unexpected error while running command.
Apr 29 09:58:20 compute1 nova-network[24902]: Command: sudo nova-rootwrap /etc/nova/rootwrap.conf env CONFIG_FILE=["/etc/nova/nova-dhcpbridge.conf"] 
NETWORK_ID=2 dnsmasq --strict-order --bind-interfaces --conf-file= --pid-file=/usr/lib/python2.7/site-packages/networks/nova-br100.pid 
--dhcp-optsfile=/usr/lib/python2.7/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=8 --dhcp-hostsfile=/usr/lib/python2.7/site-packages/networks/nova-br100.conf
 --dhcp-script=/usr/bin/nova-dhcpbridge --no-hosts --leasefile-ro --domain=novalocal --addn-hosts=/usr/lib/python2.7/site-packages/networks/nova-br100.hosts
Apr 29 09:58:20 compute1 nova-network[24902]: Exit code: 11
Apr 29 09:58:20 compute1 nova-network[24902]: Stdout: u''
Apr 29 09:58:20 compute1 nova-network[24902]: 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 118, in mainn    
default_config_files=jsonutils.loads(os.environ['CONFIG_FILE']))n  File "/usr/lib/python2.7/site-packages/nova/config.py", line 40, in parse_argsn   
 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.confnndnsmasq: lease-init script returned exit code 1n' to caller
Apr 29 09:58:20 compute1 nova-network[24902]: 2015-04-29 09:58:20.041 24902 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_replyn    incoming.message))n', '  File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 177, in _dispatchn    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_dispatchn    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_instancen    **kwargs)n', '  File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 511, in allocate_for_instancen    requested_networks=requested_networks)n', '  File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 192, in _allocate_fixed_ipsn    vpn=vpn, address=address)n', '  File "/usr/lib/python2.7/site-packages/nova/network/manager.py", line 967, in allocate_fixed_ipn    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_ipn    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_hostn    self.driver.update_dhcp(elevated, dev, network)n', '  File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line 1012, in update_dhcpn    restart_dhcp(context, dev, network_ref, fixedips)n', '  File "/usr/lib/python2.7/site-packages/nova/openstack/common/lockutils.py", line 272, in innern    return f(*args, **kwargs)n', '  File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line 1127, in restart_dhcpn    _execute(*cmd, run_as_root=True)
Apr 29 09:58:20 compute1 nova-network[24902]: n', '  File "/usr/lib/python2.7/site-packages/nova/network/linux_net.py", line 1228, in _executen    return utils.execute(*cmd, **kwargs)n', '  File "/usr/lib/python2.7/site-packages/nova/utils.py", line 163, in executen    return processutils.execute(*cmd, **kwargs)n', '  File "/usr/lib/python2.7/site-packages/nova/openstack/common/processutils.py", line 203, in executen    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=2 dnsmasq --strict-order --bind-interfaces --conf-file= --pid-file=/usr/lib/python2.7/site-packages/networks/nova-br100.pid --dhcp-optsfile=/usr/lib/python2.7/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=8 --dhcp-hostsfile=/usr/lib/python2.7/site-packages/networks/nova-br100.conf --dhcp-script=/usr/bin/nova-dhcpbridge --no-hosts --leasefile-ro --domain=novalocal --addn-hosts=/usr/lib/python2.7/site-packages/networks/nova-br100.hostsnExit code: 11nStdout: 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']

解决方法:

$vim /etc/nova/nova.conf
 
dhcpbridge_flagfile=/etc/nova/nova.conf

问题11:openstack启动docker容器失败

ERROR nova.scheduler.utils [req-1acf2a88-cfd6-4018-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 2033, in _do_build_and_run_instancen    
 filter_properties)n', u'  File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", 
 line 2164, in _build_and_run_instancen    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 2033, in _do_build_and_run_instancen    
 filter_properties)n', u'  File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2164, in _build_and_run_instancen    
 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 containern']

 failed to load names nova-br100.hosts: No such file or directory

解决方法:在相应目录下建nova-br100.hosts空文件

 

问题13:openstack启动docker容器失败(找不到image)

Apr 29 13:09:29 localhost nova-compute: 2015-04-29 13:09:29.610 1080 AUDIT nova.compute.manager [req-f4550ddc-49a5-4d58-becc-81e811bef89f None] [instance: 3a71e9cd-3fff-47c8-b60c-1faf6da85b9d] Starting instance...
Apr 29 13:09:29 localhost nova-compute: 2015-04-29 13:09:29.893 1080 AUDIT nova.compute.claims [-] [instance: 3a71e9cd-3fff-47c8-b60c-1faf6da85b9d] Attempting claim: memory 512 MB, disk 1 GB
Apr 29 13:09:29 localhost nova-compute: 2015-04-29 13:09:29.894 1080 AUDIT nova.compute.claims [-] [instance: 3a71e9cd-3fff-47c8-b60c-1faf6da85b9d] Total memory: 2807 MB, used: 512.00 MB
Apr 29 13:09:29 localhost nova-compute: 2015-04-29 13:09:29.894 1080 AUDIT nova.compute.claims [-] [instance: 3a71e9cd-3fff-47c8-b60c-1faf6da85b9d] memory limit: 4210.50 MB, free: 3698.50 MB
Apr 29 13:09:29 localhost nova-compute: 2015-04-29 13:09:29.894 1080 AUDIT nova.compute.claims [-] [instance: 3a71e9cd-3fff-47c8-b60c-1faf6da85b9d] Total disk: 26 GB, used: 0.00 GB
Apr 29 13:09:29 localhost nova-compute: 2015-04-29 13:09:29.895 1080 AUDIT nova.compute.claims [-] [instance: 3a71e9cd-3fff-47c8-b60c-1faf6da85b9d] disk limit not specified, defaulting to unlimited
Apr 29 13:09:29 localhost nova-compute: 2015-04-29 13:09:29.942 1080 AUDIT nova.compute.claims [-] [instance: 3a71e9cd-3fff-47c8-b60c-1faf6da85b9d] Claim successful
Apr 29 13:09:30 localhost nova-compute: 2015-04-29 13:09:30.539 1080 INFO nova.scheduler.client.report [-] Compute_service record updated for ('compute1', 'compute1')
Apr 29 13:09:30 localhost nova-compute: 2015-04-29 13:09:30.735 1080 INFO nova.scheduler.client.report [-] Compute_service record updated for ('compute1', 'compute1')
Apr 29 13:09:31 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 29 13:09:31 localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="+job image_inspect(192.168.245.148:5042/centos)"
Apr 29 13:09:31 localhost docker: No such image: 192.168.245.148:5042/centos
Apr 29 13:09:31 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 29 13:09:31 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 29 13:09:31 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 29 13:09:31 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 29 13:09:31 localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="+job create(nova-3a71e9cd-3fff-47c8-b60c-1faf6da85b9d)"
Apr 29 13:09:31 localhost docker: No such image: 192.168.245.148:5042/centos (tag: latest)
Apr 29 13:09:31 localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="-job create(nova-3a71e9cd-3fff-47c8-b60c-1faf6da85b9d) = ERR (1)"
Apr 29 13:09:31 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 29 13:09:31 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 29 13:09:31 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 29 13:09:31 localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="+job pull(192.168.245.148, 5042/centos)"
Apr 29 13:09:31 localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="+job resolve_repository(docker.io/192.168.245.148)"
Apr 29 13:09:31 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 29 13:09:31 localhost docker: time="2015-04-29T13:09:31+08:00" level="info" msg="+job trust_update_base()"
Apr 29 13:09:31 localhost nova-compute: 2015-04-29 13:09:31.570 1080 INFO novadocker.virt.docker.driver [-] Image name "192.168.245.148:5042/centos" does not exist, fetching it...
Apr 29 13:09:32 localhost avahi-daemon[740]: Withdrawing address record for 192.168.245.148 on ens33.
Apr 29 13:09:32 localhost avahi-daemon[740]: Leaving mDNS multicast group on interface ens33.IPv4 with address 192.168.245.148.
Apr 29 13:09:32 localhost avahi-daemon[740]: Interface ens33.IPv4 no longer relevant for mDNS.
Apr 29 13:09:32 localhost NetworkManager[787]: <error> [1430284172.493407] [platform/nm-linux-platform.c:1796] add_object(): Netlink error adding 0.0.0.0/0 via 192.168.245.2 dev ens33 metric 106 mss 0 src user: Unspecific failure
Apr 29 13:09:32 localhost NetworkManager[787]: <warn>  default-route4: failed to add default route 0.0.0.0/0 via 192.168.245.2 dev ens33 metric 100 mss 0 src user with effective metric 106
Apr 29 13:09:32 localhost NetworkManager: inet default table main
Apr 29 13:09:32 localhost NetworkManager: priority 0x6a protocol static
Apr 29 13:09:32 localhost NetworkManager: nexthop via 192.168.245.2 dev 2
Apr 29 13:09:32 localhost NetworkManager[787]: <error> [1430284172.868563] [platform/nm-linux-platform.c:1796] add_object(): Netlink error adding 0.0.0.0/0 via 192.168.245.2 dev ens33 metric 107 mss 0 src user: Unspecific failure
Apr 29 13:09:32 localhost NetworkManager[787]: <warn>  default-route4: failed to add default route 0.0.0.0/0 via 192.168.245.2 dev ens33 metric 100 mss 0 src user with effective metric 107
Apr 29 13:09:32 localhost NetworkManager: inet default table main
Apr 29 13:09:32 localhost NetworkManager: priority 0x6b protocol static
Apr 29 13:09:32 localhost NetworkManager: nexthop via 192.168.245.2 dev 2
Apr 29 13:09:33 localhost dnsmasq[3727]: read /usr/lib/python2.7/site-packages/networks/nova-br100.hosts - 0 addresses
Apr 29 13:09:33 localhost dnsmasq-dhcp[3727]: read /usr/lib/python2.7/site-packages/networks/nova-br100.conf
Apr 29 13:09:33 localhost dnsmasq-dhcp[3727]: read /usr/lib/python2.7/site-packages/networks/nova-br100.opts
Apr 29 13:09:34 localhost nova-compute: 2015-04-29 13:09:34.458 1080 INFO nova.scheduler.client.report [-] Compute_service record updated for ('compute1', 'compute1')
Apr 29 13:09:43 localhost nova-compute: 2015-04-29 13:09:43.162 1080 AUDIT nova.compute.resource_tracker [-] Auditing locally available compute resources
Apr 29 13:09:43 localhost nova-compute: 2015-04-29 13:09:43.277 1080 AUDIT nova.compute.resource_tracker [-] Total physical ram (MB): 2807, total allocated virtual ram (MB): 1024
Apr 29 13:09:43 localhost nova-compute: 2015-04-29 13:09:43.277 1080 AUDIT nova.compute.resource_tracker [-] Free disk (GB): 25
Apr 29 13:09:43 localhost nova-compute: 2015-04-29 13:09:43.277 1080 AUDIT nova.compute.resource_tracker [-] Total usable vcpus: 1, total allocated vcpus: 0
Apr 29 13:09:43 localhost nova-compute: 2015-04-29 13:09:43.278 1080 AUDIT nova.compute.resource_tracker [-] PCI stats: []
Apr 29 13:09:43 localhost nova-compute: 2015-04-29 13:09:43.308 1080 INFO nova.scheduler.client.report [-] Compute_service record updated for ('compute1', 'compute1')
Apr 29 13:09:43 localhost nova-compute: 2015-04-29 13:09:43.309 1080 INFO nova.compute.resource_tracker [-] Compute_service record updated for compute1:compute1
Apr 29 13:09:50 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 29 13:09:50 localhost docker: time="2015-04-29T13:09:50+08:00" level="info" msg="-job trust_update_base() = OK (0)"
Apr 29 13:10:01 localhost systemd: Created slice user-0.slice.
Apr 29 13:10:01 localhost systemd: Starting Session 19 of user root.
Apr 29 13:10:01 localhost systemd: Started Session 19 of user root.
Apr 29 13:10:16 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 29 13:10:16 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 29 13:10:16 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 29 13:10:16 localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="+job create(nova-3a71e9cd-3fff-47c8-b60c-1faf6da85b9d)"
Apr 29 13:10:16 localhost docker: No such image: 192.168.245.148:5042/centos (tag: latest)
Apr 29 13:10:16 localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="-job create(nova-3a71e9cd-3fff-47c8-b60c-1faf6da85b9d) = ERR (1)"
Apr 29 13:10:16 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 29 13:10:16 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 29 13:10:16 localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="GET /v1.7/containers/ps?all=1"
Apr 29 13:10:16 localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="+job containers()"
Apr 29 13:10:16 localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="-job containers() = OK (0)"
Apr 29 13:10:16 localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="GET /v1.7/containers/12176cd27604886980e8a1c1651ba140a98e63c5f161603b9113ca5d988e6ee4/json"
Apr 29 13:10:16 localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="+job container_inspect(12176cd27604886980e8a1c1651ba140a98e63c5f161603b9113ca5d988e6ee4)"
Apr 29 13:10:16 localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="-job container_inspect(12176cd27604886980e8a1c1651ba140a98e63c5f161603b9113ca5d988e6ee4) = OK (0)"
Apr 29 13:10:16 localhost docker: time="2015-04-29T13:10:16+08:00" level="info" msg="GET /v1.7/containers/855123ad5274f9ea2ad4b66d6dffacda0f8788b7e4b62e6386cef119497325a5/json"
Apr 29 13:10:16 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();
用户评论