昊漫玉 发表于 2015-4-11 13:50:17

Openstack Troubleshooting

  Openstack 还处于快速发展阶段,虽然有众多公司及开发人员的参与,但其文档速度仍然远远跟不上代码更新速度。




本文记录我在实践过程中遇到的问题及解决方法。





1.今天遇到的。Horizon 出现http 500 错误,调试发现nova-api无法启动,查看日志

nova-api.log发现:



2013-03-20 10:23:50 15287 TRACE nova PasteAppNotFound: Could not load paste app 'osapi_volume' from /etc/nova/api-paste.ini



在nova.conf 中加上



enabled_apis=ec2,osapi_compute,metadata



启动nova-api解决.





2. Folsom +Quantum+Openvswitch 配置网络,当计算节点意外关机,重启后,所有虚拟机无法通过dhcp获得地址

造成所有虚拟机网络不通。

目前测试在Single Flat Network 模式下,计算节点重启后,再次重启quantum-plugin-openvswitch-agent 即可修复.

service quantum-plugin-openvswitch-agent restart



估计为物理计算节点服务启动顺问题,导致quantum-plugin-openvswitch-agent启动时,其依赖的openvswitch,或者mysql并没有启动成功所致.



3.Folsom +Quantum+Openvswitch 配置网络,当网络节点关机,重启后,所有虚拟机无法通过dhcp获得地址

造成所有虚拟机网络不通。

ovs-vsctl del-br br-int

ovs-vsctl add-br br-int

service quantum-dhcp-agent restart

service quantum-plugin-openvswitch-agent restart



有一种情况是安装系统时自带的dnsmasq优先启动,调用的是默认的dnsmasq配置文件,而调用quantum配置文件的dnsmasq进程因为端口被占用而启动失败。

ps -ef |grep dnsmasq

找到相关的进程,kill 以后,

再重启quantum-dhcp-agent 即可。



3. Windows 2003 镜像启动出现服务错误解决方法:

开机弹出一个错误窗口,让查看事件查看器。找到一个红叉的记录:由于下列错误,Parallel port driver 服务启动失败: 无法启动服务,原因可能是已被禁用或与其相关联的设备没有启动。”

其实服务中根本不存在这样一个服务,所以去服务禁用的方法无效

解决这个问题,只需要在注册表HKEY_LOCAL_MACHINESYSTEMControlSet001ServicesParport中,将“start=3”改为“start=0”就可以了。



4. Openstack Grizzly 版本安装完nova,keystone,glance后dashboard登录,其它服务正常,但总是出现“error:unable to get quotas ...” 等好像是获取quota失败的信息,一直在找quota的配置错误,其实最后发现是quantum没有配置导致这个错误。



5.在命令行下source novarc环境变量之后仍不能使用nova 命令做一些操作,可能是因为你的环境变量中没有设置OS_TENANT_ID,在F版本和G版本中,这是必须的。



6. 卷和快照创建时明明没有到限额,然而总是提示创建失败,超过限额。

检查数据库发现在,卷和快照的使用确实是限额数,可能是cinder的bug,当你删除卷时没有在数据库中将已使用的卷数据减除。

提交bug: https://bugs.launchpad.net/cinder/+bug/1180629

临时解决办法:

user cinder;
UPDATE `quota_usages` SET `deleted_at` = NULL ,
`in_use` = '0',
`until_refresh` = NULL WHERE `quota_usages`.`id` =5 LIMIT 1



  7./var/log/quantum/dhcp-agent.log中出现sudoip ns 等权限问题:


这些权限问题是因为openstack 组件执行操作有时候需要sudo 到root权限 .openstack 为此已经创建了相关的权限文件在/etc/sudoer.d/下,但其实ubuntu下其默认并不生效.

因为/etc/sudoers文件中的includedir默认是注释掉的。将其打开即可。

或者编辑 /etc/sudoers 直接加上相应用户权限 :



cinder   ALL = NOPASSWD: ALL

nova   ALL = NOPASSWD: ALL

quantumALL = NOPASSWD: ALL



8. migrate 和live-migarate ,时nova-compute中出现的ssh 问题,此问题的权限原因在于nova用户无法登录到其它物理机,或者登录了,在其它物理机上权限不一致。终极解决办法是:

在所有物理机上创建具备同样UID,和GID的用户nova,并且为nova用户创建ssh key,放置在所有物理机中.

如果你已经创建好了用户,也有办法。修改其uid,和gid (usermod,groupmod):

先修改/etc/passwd文件中的uid和gid ,然后在查找本地所有文件的uid 和gid,修改正确即可。

find / -user OLDID -exec chown NEWID {} ;

ibm有个教程http://www.ibm.com/developerworks/cn/aix/library/au-satuidgid/



9. openstack-dashboard 访问出现 connection refused .

   可能为几个关键服务没启动,keystone,nova,cinder,glance



10. RHEL+Openstack Grizzly ,安装正常后,过了几天dashboard突然登录验证失败,keystone没有日志信息,apache日志出现:


Apache/2.2.15 (Unix) DAV/2 mod_wsgi/3.2 Python/2.6.6 configured -- resuming normal operations
DeprecationWarning: Translations in the project directory aren't supported anymore. Use the LOCALE_PATHS setting instead.DeprecationWarning: The syntax for the url template tag is changing. Load the `url` tag from the `future` tag library to start using the new behavior.DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in .DEBUG:openstack_auth.backend:Beginning user authentication for user "admin".
DeprecationWarning: BaseException.message has been deprecated as of Python 2.6DEBUG:openstack_auth.backend:Authorization Failed: Permission denied
DEBUG:openstack_auth.backend:Beginning user authentication for user "admin".
DEBUG:openstack_auth.backend:Authorization Failed: Permission denied
DEBUG:openstack_auth.backend:Beginning user authentication for user "admin".
  各种偿试,都无效果,最后终于发现是SELINUX的问题(RHEL排查问题首先应该关这个。。好久没用,忘记了|_|)。



# getenforce
Enforcing
# setenforce 0
# getenforce
Permissive
# service httpd restart
Stopping httpd:                                          
Starting httpd: httpd: apr_sockaddr_info_get() failed for osee
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

  10. LockFailed: failed to create /usr/share/openstack-dashboard/openstack_dashboard/local/.Dummy-1-3096



Set the LOCAL_PATH='/tmp' in /etc/openstack-dashboard/local_settings, restart HTTP and then try to access the dashboard.
  11. VM创建失败,换个镜像成功。icehouse



ICEHouse的dashboard上在上传镜像时,增加了一下Architecture 选项,此项不能随便填,否则会造成schedurle失败,提示no valid host
  
页: [1]
查看完整版本: Openstack Troubleshooting