openstack 问题一览(持续总结中)

★名词

Qemu:它也是一种虚拟化技术,主要提供对IO,网络等外设的虚拟化管理。结合KVM(对CPU和内存管理),提供较为完整的虚拟化管理功能。

 Libvirt:提供了针对各种虚拟机技术的接口,来管理机器上的虚拟机。包括各种虚拟机技术,kvm、xen与lxc等,都可以调用libvirt提供的api对虚拟机进行管理。

【1】置换版本:git clone https://git.openstack.org/openstack-dev/devstack -b stable/liberty
修改为:git clone https://git.openstack.org/openstack-dev/devstack -b stable/newton

【2】创建的stack账户,可以手动设置密码:sudo passwd stack。否则不能切换。su stack.
【3】root账户打开virt-manager报错:

Error starting Virtual Machine Manager: No D-BUS daemon running

方法1,使用以下命令可以正常打开:

root@ubuntu:/# dbus-launch virt-manager

方法2,输入以下命令,然后输入:virt-manager即可打开。

root@ubuntu:/# dbus-uuidgen > /var/lib/dbus/machine-id

root@ubuntu:/# virt-manager

【4】ubuntu14.04 打开KVM出错

error: failed to connect to the hypervisor
error: no valid connection
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory

第一步:可能是由于libvirt-bin服务没有启动
sudo service libvirt-bin start 发现不能启动

第二步:
查看日志 tail /var/log/libvirt/libvirtd.log
发现error : virNetTLSContextCheckCertFile:117 : Cannot read CA certificate '/etc/pki/CA/cacert.pem': No such file or directory
※暂未解决。

【5】ubuntu设置固定IP地址

【6】openstack octca 缺少 placement Service 解决办法

根据官方文档安装,当启动nova-compute时会报错

PlacementNotConfigured: This compute is not configured to talk to the placement service

原因:官方文档中遗漏了-nova-placement-api的安装。

解决步骤:

①控制节点

yum install openstack-nova-placement-api

openstack service create --name placement --description "OpenStack Placement" placement

openstack endpoint create --region RegionOne placement public http://<ip>:8778
openstack endpoint create --region RegionOne placement admin http://<ip>:8778
openstack endpoint create --region RegionOne placement intenal http://<ip>:8778

systemctl restart httpd

②计算节点

编辑 /etc/nova/nova.conf,增加

[placement]

auth_uri = http://controller:5000

auth_url = http://controller:35357

memcached_servers = controller:11211

auth_type = password

project_domain_name = default

user_domain_name = default

project_name = service

username = nova

password = ******

os_region_name = RegionOne

重启 systemctl restart openstack-nova-compute.service

 【7】问题:

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

解决办法:
1,apt-get命令安装软件是不允许同时开启两个apt-get 的。
用ps -ef | grep apt-get命令找到相关进程,然后使用Kill -9 进程号
2,确定没开两个APT-GET ,可以强行解锁。
sudo rm /var/lib/dpkg/lock

【8】Juno版配置错误

1,keystone tenant-create --name admin --description "Admin Tenant"
Unable to establish connection to http://controller:35357/v2.0/tenants

解决方法:
删除 vi /etc/keystone/keystone.conf ->[token] 中,
driver = keystone.token.persistence.backends.sql.Token

2, CRITICAL keystone [-] OperationalError: (OperationalError) (1045, "Access
denied for user 'keystone'@'localhost' (using password: YES)") None None
解决方法:
Grant命令中的密码部分有空格导致的。


3,service keystone restart 重启服务时,出错:
stop: Unknown instance:
解决方法:
删除sqlite文件:
rm -f /var/lib/keystone/keystone.db
因为keystone安装会默认生成一个SQLite文件,但我们这里用的是mysql数据库,
所以用不到此文件,将其删除。

4, 查看 /var/log/keystone/keystone.log
ImportError: No module named persistence.backends.sql
解决方法:
删除 /etc/keystone/keystone.conf
driver = keystone.token.persistence.backends.sql.Token


5, keystone --os-tenant-name admin --os-username admin --ospassword abcd1234!
--os-auth-url http://controller:35357/v2.0 token-get
解决方法:
把--ospassword改为:--os-password

6,上传镜像时,
glance image-create --name "cirros-0.3.3-x86_64" --file /tmp/images/
cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-format bare
--is-public True --progress

出现错误:
Request returned failure status.
Invalid OpenStack Identity credentials.

解决方法:
1,查看日志 cat /var/log/glance/api.log

日志内容:
2015-03-27 10:22:43.856 18493 ERROR keystoneclient.middleware.auth_token [-]
HTTP connection exception: [Errno 1] _ssl.c:510: error:140770FC:SSL
routines:SSL23_GET_SERVER_HELLO:unknown protoc

修改源码:
vi /usr/local/lib/python2.7/dist-packages/keystoneclient/middleware/auth_token.py

cfg.StrOpt('auth_protocol',
default='https', #修改为http
help='Protocol of the admin Identity API endpoint'
'(http or https)'),
将上面的https修改为http

2,上述方法1不行,继续:
修改配置文件
vi /etc/glance/glance-api.conf

[DEFAULT]

notification_driver = noop

verbose = True

[database]

connection = mysql://glance:abcd1234!@controller1/glance

[keystone_authtoken]

auth_uri = http://controller1:5000/v2.0

identity_uri = http://controller1:35357
最后这两句,应该按配置文件中的格式配置,否则会导致上面的错误。

7,出错:
Unable to locate package python-keystonemiddleware
解决方法:
从官网上下载https://pypi.python.org/pypi/keystonemiddleware/
.whl文件。
用命令:
pip install keystonemiddleware-1.5.0-py2.py3-none-any.whl
service swift-proxy restart

【9】问题:openstack: No valid host was found.

解决方法:
查看log:/var/log/nova/compute.log
看到CommunicationError: Error communicating with http://10.20.0.30:9292 [Errno 111] ECONNREFUSED
发现是glance server配置出错了。修改了/etc/nova/nova.conf中glance_host的配置,问题解决。

【10】实例控制台:Error response
Error code 4.4.
Message: File not found.
Error code explanation:4.4 = Nothing matches the given URI.
这是由于vnc的修正,原来的 vnc_auto.html改名为vnc_lite.html 的原因。
解决方法:
cd /opt/stack/novnc/
cp vnc_lite.html vnc_auto.html

[11] Queen版时出现的问题

1,错误: 实例 "centos6401" 执行所请求操作失败,实例处于错误状态。: 请稍后再试 [错误: Build of instance 346d33a1-2695-4977-a44f-4fa690e16f62 aborted: Volume a01b67d3-4891-4dc8-bd16-d05b19fcf459 did not finish being created even after we waited 3 seconds or 2 attempts. And its status is error

★可能原因1:
由于卷创建时间比较长,引起nova组件等待超时,造成创建失败,提前修改计算节点/etc/nova/nova.conf文件中的控制卷设备重试的参数:block_device_allocate_retries,延长等待时间(例如由60->180)。修改生效需要重启nova组件各个服务。

★可能原因2:
有可能是镜像大小的问题,利用该镜像做成的虚拟机,分配的磁盘不够大。可以尝试测试,本次测试中我的环境是这个问题。
镜像位置:计算节点的/var/lib/libvirt/images。
查看计算节点log:/var/log/nova/nova-compute.log

2,错误:openstack Failed to connect to server (code: 1006)

解决方法:打开etc/nova/nova.conf配制文件,查找“vncserver_proxyclient_address”的值不是计算节点的正确主机名。多了域名后缀。

3,创建实例时出现:无法绑定网络接口。
PortBindingFailed: Binding failed for port xxxxxx-xxxxx-xxxxx-xxxxxxxxxxxxxx,please check neutron logs for more information.
解决方法:
在控制节点,执行环境变量。
然后查看:neutron agent-list
确认计算节点的open vSwitch agent 和网络节点的 L3 agent是否启动了。

posted @ 2018-01-09 22:27  山的那一边  阅读(1556)  评论(0编辑  收藏  举报