打赏
Fork me on GitHub

[原]openstack-kilo--issue(六):Authorization Failed: The resource could not be found. (HTTP 404)

本博客已经添加"打赏"功能,"打赏"位置位于右边栏红色框中,感谢您赞助的咖啡.

=======1.问题点:======

在安装调试openstack-kilo版本的时候,使用keystone endpoint-list的时候出现了问题。

如下:

[root@controller ~]# keystone --debug endpoint-list
/usr/lib/python2.7/site-packages/keystoneclient/shell.py:65: DeprecationWarning: The keystone CLI is deprecated
  'python-keystoneclient.', DeprecationWarning)
DEBUG:keystoneclient.auth.identity.v2:Making authentication request to http://controller:35357/v3/tokens
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): controller
DEBUG:requests.packages.urllib3.connectionpool:"POST /v3/tokens HTTP/1.1" 404 93
DEBUG:keystoneclient.session:Request returned failure status: 404
Authorization Failed: The resource could not be found. (HTTP 404) (Request-ID: req-79664a21-5f68-4ece-86a0-322

  

======2.在google上看到一篇文章,最后发现是命令的格式问题=========

原文如此说:

To move to the new python-openstackclient, simply install it. On RHEL7.1:
yum install -y python-openstackclient.noarch

After that it will be available as the command “openstack”. It can be invoked in interactive mode just by typing “openstack” or directly from 
the command line to get information. For example, to list users: Old Keystone CLI: “keystone user-list” New Openstack CLI: “openstack user list” To be more similar to the output of the old command issue “openstack user list --long” to get the extra fields.

如果使用New Openstack CLI 就能正常显示:

使用旧命令:会报错(如下)

[root@controller ~]# keystone endpoint-list
/usr/lib/python2.7/site-packages/keystoneclient/shell.py:65: DeprecationWarning: The keystone CLI is deprecated 
in favor of python-openstackclient. For a Python library, continue using python-keystoneclient. 'python-keystoneclient.', DeprecationWarning) Authorization Failed: The resource could not be found. (HTTP 404) (Request-ID: req-2959b997-b7bb-4387-b8e9-aeb6fa5b0c63)

使用新命令:(正常显示)

[root@controller ~]# openstack endpoint list
+----------------------------------+-----------+--------------+--------------+
| ID                               | Region    | Service Name | Service Type |
+----------------------------------+-----------+--------------+--------------+
| 204d0abf4a39402e8f0c0f49fdb07772 | RegionOne | glance       | image        |
| 0f54b94c8a084e0baeb5655091c411ae | RegionOne | neutron      | network      |
| 0259f8b1d4784e3fba653c2bd89e5638 | RegionOne | keystone     | identity     |
| efa64e47b3c04b6c952c55bd0c95403f | RegionOne | cinder       | volume       |
| 6e596cf3369e4ee7b295c064a0080ba6 | RegionOne | nova         | compute      |
| 1aedfe9471504fb2b9aafa28f8651ca8 | RegionOne | cinderv2     | volumev2     |
+----------------------------------+-----------+--------------+--------------+

 或者查看详细的信息,在后面加上--long

 

[root@controller ~]# openstack endpoint list --long
+----------------------------------+-----------+--------------+--------------+-----------------------------------------+-----------------------------------------+-----------------------------------------+
| ID                               | Region    | Service Name | Service Type | PublicURL                               | AdminURL                                | InternalURL                             |
+----------------------------------+-----------+--------------+--------------+-----------------------------------------+-----------------------------------------+-----------------------------------------+
| 204d0abf4a39402e8f0c0f49fdb07772 | RegionOne | glance       | image        | http://controller:9292                  | http://controller:9292                  | http://controller:9292                  |
| 0f54b94c8a084e0baeb5655091c411ae | RegionOne | neutron      | network      | http://controller:9696                  | http://controller:9696                  | http://controller:9696                  |
| 0259f8b1d4784e3fba653c2bd89e5638 | RegionOne | keystone     | identity     | http://controller:5000/v2.0             | http://controller:35357/v2.0            | http://controller:5000/v2.0             |
| efa64e47b3c04b6c952c55bd0c95403f | RegionOne | cinder       | volume       | http://controller:8776/v2/%(tenant_id)s | http://controller:8776/v2/%(tenant_id)s | http://controller:8776/v2/%(tenant_id)s |
| 6e596cf3369e4ee7b295c064a0080ba6 | RegionOne | nova         | compute      | http://controller:8774/v2/%(tenant_id)s | http://controller:8774/v2/%(tenant_id)s | http://controller:8774/v2/%(tenant_id)s |
| 1aedfe9471504fb2b9aafa28f8651ca8 | RegionOne | cinderv2     | volumev2     | http://controller:8776/v2/%(tenant_id)s | http://controller:8776/v2/%(tenant_id)s | http://controller:8776/v2/%(tenant_id)s |
+----------------------------------+-----------+--------------+--------------+-----------------------------------------+-----------------------------------------+-----------------------------------------+

  进一步查看openstack状态:使用openstack-status的时候发现也有错误:

[root@controller ~]# openstack-status
。。。
。。。
== Keystone users ==
/usr/lib/python2.7/site-packages/keystoneclient/shell.py:65: DeprecationWarning: The keystone CLI is deprecated 
in favor of python-openstackclient. For a Python library, continue using python-keystoneclient. 'python-keystoneclient.', DeprecationWarning) Authorization Failed: The resource could not be found. (HTTP 404) (Request-ID: req-0b2eaa04-ba6b-435d-bafd-1674b919fa24) 。。。 。。。

 解决方法是修改/usr/bin/openstack-status文件 在line  227的地方修改为:

 

#    keystone user-list
    openstack user list

 再测试

 

[root@controller ~]# openstack-status
。。。
。。。
== Keystone users ==
+----------------------------------+---------+
| ID                               | Name    |
+----------------------------------+---------+
| 0ac3a46f50014e318b050003e869b574 | cinder  |
| 349ba9e056ca47859faa1008d7c9c608 | neutron |
| 5e95a6f269e54a50bfd5d988eb518a77 | glance  |
| 9bae0df144814717a3065921eebe24b6 | admin   |
| aa9f69fdedfc4269bfa56330afc5adfe | nova    |
| fe649df8cd0048928a93cca7bda3e4b9 | demo    |
+----------------------------------+---------+

。。。
。。。

  

 总结:openstack版本更新较快,有些命令已经改变。多google一下,也许就能解决。

在kilo版本中还有一些命令也是通过openstack来查看的,如下:

aggregate add host      ip fixed remove               server rescue
aggregate create        ip floating add               server resize
aggregate delete        ip floating create            server resume
aggregate list          ip floating delete            server set
aggregate remove host   ip floating list              server show
aggregate set           ip floating pool list         server ssh
aggregate show          ip floating remove            server suspend
availability zone list  keypair create                server unlock
backup create           keypair delete                server unpause
backup delete           keypair list                  server unrescue
backup list             keypair show                  server unset
backup restore          limits show                   service create
backup show             module list                   service delete
catalog list            network create                service list
catalog show            network delete                service show
command list            network list                  snapshot create
complete                network set                   snapshot delete
compute agent create    network show                  snapshot list
compute agent delete    object create                 snapshot set
compute agent list      object delete                 snapshot show
compute agent set       object list                   snapshot unset
compute service list    object save                   token issue
compute service set     object show                   token revoke
console log show        project create                usage list
console url show        project delete                usage show
container create        project list                  user create
container delete        project set                   user delete
container list          project show                  user list
container save          project usage list            user role list
container show          quota set                     user set
ec2 credentials create  quota show                    user show
ec2 credentials delete  role add                      volume create
ec2 credentials list    role create                   volume delete
ec2 credentials show    role delete                   volume list
endpoint create         role list                     volume set
endpoint delete         role remove                   volume show
endpoint list           role show                     volume type create
endpoint show           security group create         volume type delete
extension list          security group delete         volume type list
flavor create           security group list           volume type set
flavor delete           security group rule create    volume type unset
flavor list             security group rule delete    volume unset
flavor set              security group rule list
flavor show             security group set
flavor unset            security group show
help                    server add security group
host list               server add volume
host show               server create
hypervisor list         server delete
hypervisor show         server image create
hypervisor stats show   server list
image create            server lock
image delete            server migrate
image list              server pause
image save              server reboot
image set               server rebuild
image show              server remove security group
ip fixed add            server remove volume

  

 

参考文章:http://jonamiki.com/2015/11/20/the-keystone-cli-is-deprecated-in-favor-of-python-openstackclient/

posted @ 2016-11-07 18:15  my_cool2007  阅读(7484)  评论(0编辑  收藏  举报