立即注册 登录
About云-梭伦科技 返回首页

pig2的个人空间 https://www.aboutyun.com/?61 [收藏] [复制] [分享] [RSS]

日志

openstack nova命令及命令使用错误总结(HTTP 401)

已有 1453 次阅读2014-4-4 19:08 |个人分类:云技术| nova, HTTP, 401

openstack使用过程中,使用了如下命令:
nova list
出现如下错误
DEBUG (shell:768) Unauthorized (HTTP 401)
然后尝试其它命令
1:列出当前用户的虚拟机 nova list
2:列出镜像 nova image-list
3:查看当前的配置类型 nova flavor-list
4:查看当前安全组nova secgroup-list
5:查看安全组的规则nova secgroup-list-rules default
6:查看某个虚拟机信息 (可以通过虚拟机名字或者id,这些可以通过 nova list获得)nova show superfrobnicator
7:列出keystone 用户keystone user-list
8:列出全部镜像,这个命令获得的信息,比nova image-list更加详细。glance index
9:查看服务运行情况nova-manage service list
10:查看floating IP   nova-manage floating list
11:查看keystone 服务 keystone service-list
报同样的错误:
DEBUG (shell:768) Unauthorized (HTTP 401)
这里就用到了前面所用的openstack的两种
openstack排除查找错误的两种方法
http://www.aboutyun.com/thread-7241-1-1.html
使用 nova --debug list,发现如下错误:
This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.

 Authentication required  

DEBUG (shell:768) Unauthorized (HTTP 401)
上面大意是说你提供的认证不正确,或则提供了错误的密码。从上面可以上面的现象可以判断,肯定又是环境变量或则配置文件的问题。所以我们需要重新从查找环境变量和配置文件。可以肯定的是环境变量不涉及nova,所以需要从配置文件,首先看一下/etc/nova/api-paste.ini 

然后从安装文档中
openstack零基础入门:OpenStack Grizzly安装指导(1)
http://www.aboutyun.com/thread-7212-1-1.html
,我们找到与之相关的内容:
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = 10.10.10.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = service_pass
signing_dirname = /tmp/keystone-signing-nova
# Workaround for https://bugs.launchpad.net/nova/+bug/1154809
auth_version = v2.0
从上面可以看出,admin_user一个为admin,一个为nova。很显然是用户名错误。所以造成认证失败。其实也就是我们所说的用户名和密码不正确。




路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 立即注册

关闭

推荐上一条 /2 下一条