分享

nova image-list报错:ERROR: Unauthorized (HTTP 401)

string2020 发表于 2014-2-20 23:59:31 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 7 66458
提示: 作者被禁止或删除 内容自动屏蔽

已有(7)人评论

跳转到指定楼层
howtodown 发表于 2014-2-21 02:26:28
你可以参考这个配置
http://docs.openstack.org/trunk/install-guide/install/apt/content/nova-controller.html

/etc/nova/nova.conf添加下面试一下。
  1. [keystone_authtoken]
  2. auth_host = controller
  3. auth_port = 35357
  4. auth_protocol = http
  5. admin_tenant_name = service
  6. admin_user = nova
  7. admin_password = NOVA_PASS
复制代码
然后确保下面的服务都安装了



  1. apt-get install nova-novncproxy novnc nova-api \
  2. nova-ajax-console-proxy nova-cert nova-conductor \
  3. nova-consoleauth nova-doc nova-scheduler \
  4. python-novaclient
复制代码
使用

  1. netstat -an
复制代码
确保监听正确的端口


  1. chown -R nova:nova on /etc/nova
复制代码
确保 nova services都运行






回复

使用道具 举报

string2020 发表于 2014-2-21 09:12:51
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

string2020 发表于 2014-2-21 09:24:07
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

wonitazansa 发表于 2015-3-18 17:31:26
我也遇到这个问题,用你的方法解决了
但是
我看了许多文档,都是安装没改之前的用户名和密码,这里会不会只是表象呀
这里改成admin,会不会其他地方有问题
回复

使用道具 举报

pig2 发表于 2015-3-18 18:13:53
wonitazansa 发表于 2015-3-18 17:31
我也遇到这个问题,用你的方法解决了
但是
我看了许多文档,都是安装没改之前的用户名和密码,这里会不会 ...

可以尝试验证其它租户登录
回复

使用道具 举报

jixianqiuxue 发表于 2015-3-18 18:22:45
wonitazansa 发表于 2015-3-18 17:31
我也遇到这个问题,用你的方法解决了
但是
我看了许多文档,都是安装没改之前的用户名和密码,这里会不会 ...



把你的配置改成这样在尝试下,你的可能缺少identity_uri = http://controller:35357
  1. [keystone_authtoken]
  2. auth_uri = http://controller:5000/v2.0
  3. identity_uri = http://controller:35357
  4. admin_tenant_name = service
  5. admin_user = nova
  6. admin_password = NOVA_PASS
复制代码


回复

使用道具 举报

wonitazansa 发表于 2015-3-19 09:47:04
root@controller ~]# vi /etc/nova/nova.conf
……
[keystone_authtoken]
auth_uri = http://controller:5000
auth_host = controller
auth_protocol = http
auth_port = 35357
identity_uri = http://controller:35357
admin_user = nova
admin_tenant_name = service
admin_password = NOVA_PASS

安装上面设置后
tail /var/log/nova/api.log
2015-03-19 09:33:37.514 570 WARNING keystoneclient.middleware.auth_token [-] Unexpected response from keystone service: {u'error': {u'message': u'The resource could not be found.', u'code': 404, u'title': u'Not Found'}}
2015-03-19 09:33:37.515 570 WARNING keystoneclient.middleware.auth_token [-] Authorization failed for token
2015-03-19 09:33:37.519 563 WARNING keystoneclient.middleware.auth_token [-] Unable to find authentication token in headers


[root@controller ~]# nova --debug list
......
REQ: curl -i 'http://controller:8774/v2/9b807b0dd7de4bba87c3e4704d9fa5e9/servers/detail' -X GET -H "X-Auth-Project-Id: admin" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: e0b3b0758a854bdc853cad4469cc31ce"

INFO (connectionpool:203) Starting new HTTP connection (1): controller
DEBUG (connectionpool:295) "GET /v2/9b807b0dd7de4bba87c3e4704d9fa5e9/servers/detail HTTP/1.1" 401 23
RESP: [401] {'date': 'Thu, 19 Mar 2015 01:36:43 GMT', 'content-length': '23', 'content-type': 'text/plain', 'www-authenticate': "Keystone uri='http://controller:5000'"}
RESP BODY: Authentication required

DEBUG (shell:783) Unauthorized (HTTP 401)
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/novaclient/shell.py", line 780, in main
    OpenStackComputeShell().main(map(strutils.safe_decode, sys.argv[1:]))
  File "/usr/lib/python2.6/site-packages/novaclient/shell.py", line 716, in main
    args.func(self.cs, args)
  File "/usr/lib/python2.6/site-packages/novaclient/v1_1/shell.py", line 1138, in do_list
    search_opts=search_opts)
  File "/usr/lib/python2.6/site-packages/novaclient/v1_1/servers.py", line 583, in list
    return self._list("/servers%s%s" % (detail, query_string), "servers")
  File "/usr/lib/python2.6/site-packages/novaclient/base.py", line 64, in _list
    _resp, body = self.api.client.get(url)
  File "/usr/lib/python2.6/site-packages/novaclient/client.py", line 309, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/usr/lib/python2.6/site-packages/novaclient/client.py", line 301, in _cs_request
    raise e
Unauthorized: Unauthorized (HTTP 401)
ERROR: Unauthorized (HTTP 401)


为什么这个nova这个用户不行呀,是不是过期了,如何检查这个用户
大家帮帮忙,自己是新手,实在着急
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条