ERROR (ClientException)

 nova image-list
ERROR (ClientException): Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class ‘glanceclient.exc.HTTPInternalServerError‘> (HTTP 500) (Request-ID: req-5c463162-0e93-4114-93e0-19134f77439e)

How to change keystone API V2 to V3
Posted on November 26, 2014 by Gopalakrishnan S    0 Comments

The Keystone Identity Service allows clients to obtain tokens that can be used to access OpenStack cloud services. This document is intended for software developers interested in developing applications that utilize the Keystone Identity Service API for authentication. The OpenStack Identity API is implemented using a RESTful web service interface. All requests to authenticate and operate against the OpenStack Identity API should be performed using SSL over HTTP (HTTPS) on TCP port 443.
keystone V3 Advantages

1) Authentication is totally pluggable. You can write our own custom auth method. Beause of this extensible auth method, now keystone supports oauth1, federation ( federation is not fully done)

2) Authorization : V2 is either “admin” or none. In v3 you can control who can call each method. ( Provided you define your own policy file )

3) Separate drivers for assignments and identity

4) Rich set of APIs. There are lot more API available than v2.0. Also there are no vendor specic extension. If you check v2.0, most of the role apis are Rackspace extensions
Before proceed to migrate keystone v2 to v3, you must check previous services are working fine. Use the following commands to verify the list of services works.

How to change keystone API V2 to V3?

[[email protected] ~(keystone_admin)]# keystone user-list
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
+———————————-+————+———+———————-+
| id | name | enabled | email |
+———————————-+————+———+———————-+
| ed03407c56054729bee58be7f7710786 | admin | True | [email protected] |
| 3b52f88a70f149a791e295b1859ae8f4 | ceilometer | True | [email protected] |

[[email protected] ~(keystone_admin)]# nova service-list
+——————+———–+———-+———+——-+—————————-+—————–+
| Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+——————+———–+———-+———+——-+—————————-+—————–+
| nova-consoleauth | packstack | internal | enabled | up | 2014-12-13T10:45:52.000000 | – |
| nova-scheduler | packstack | internal | enabled | up | 2014-12-13T10:45:50.000000 | – |
| nova-conductor | packstack | internal | enabled | up | 2014-12-13T10:45:54.000000 | – |
| nova-compute | packstack | nova | enabled | up | 2014-12-13T10:45:51.000000 | – |
| nova-cert | packstack | internal | enabled | up | 2014-12-13T10:45:52.000000 | – |
| nova-console | packstack | internal | enabled | up | 2014-12-13T10:45:51.000000 | – |
+——————+———–+———-+———+——-+—————————-+—————–+
[[email protected] ~(keystone_admin)]# glance image-list
+————————————–+——–+————-+——————+———-+——–+
| ID | Name | Disk Format | Container Format | Size | Status |
+————————————–+——–+————-+——————+———-+——–+
| f4c137ca-8dd8-47f3-be70-106eac2f241f | cirros | qcow2 | bare | 13147648 | active |
+————————————–+——–+————-+——————+———-+——–+

If all the services are working fine then proceed to migrate endpoint urls to V3 in your keystone databases.  Login your mysql server and change endpoint URLs.
mysql> use keystone;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> select interface, url from endpoint e, service s where s.id=e.service_id and s.type=”identity”;
+———–+———————————-+
| interface | url |
+———–+———————————-+
| admin | http://192.168.1.133:35357/v2.0 |
| internal | http://192.168.1.133:5000/v2.0 |
| public | http://192.168.1.133:5000/v2.0 |
+———–+———————————-+
3 rows in set (0.01 sec)

Get the identity service ID

mysql> select id from service where type=”identity”;
+———————————-+
| id |
+———————————-+
| e32101fdfe4145d1a6a22351b41d88e5 |
+———————————-+
1 row in set (0.00 sec)
Use this query to replace URLs as per service id where 5000 ports
mysql> update endpoint set url=”http://192.168.1.196:5000/v3″ where url=”http://192.168.1.196:5000/v2.0″ and service_id=”76e23f322c2a48d18293db89dbca9e70″;
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0

Use this query to replace 35357 ports

mysql> update endpoint set url=”http://192.168.1.196:35357/v3″ where url=”http://192.168.1.196:35357/v2.0″ and service_id=”76e23f322c2a48d18293db89dbca9e70″;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

Thats all, you can verify the changed URLs.

mysql> select interface, url from endpoint e, service s where s.id=e.service_id and s.type=”identity”;
+———–+——————————–+
| interface | url |
+———–+——————————–+
| admin | http://192.168.1.133:35357/v3 |
| internal | http://192.168.1.133:5000/v3 |
| public | http://192.168.1.133:5000/v3 |
+———–+——————————–+
3 rows in set (0.00 sec)

mysql>

upgrade Keystone Policy File

Policy is just a set of rules combined by or/and logic. It should become more readable in future releases, The Openstack Identity v3 API, provided by Keystone, offers features that were lacking in the previous version. Among these features, it introduces the concept of domains, allowing isolation of projects and users. For instance, an administrator allowed to create projects and users in a given domain, may not have any right in another one. While these features look very exciting, some configuration needs to be done to have a working identity v3 service with domains properly set.

Download policy.v3cloudsample.json file

wget https://github.com/openstack/keystone/blob/master/etc/policy.v3cloudsample.json
mv /etc/keystone/policy.json /etc/keystone/policy.json.V2

mv policy.v3cloudsample.json /etc/keystone/policy.json

chown keystone.keystone policy.json

Update Keystone Endpoint Environment.

export OS_USERNAME=admin
export OS_TENANT_NAME=admin
export OS_PASSWORD=<password>
export OS_AUTH_URL=http://192.168.1.133:5000/v3
export SERVICE_ENDPOINT=http://192.168.1.133:35357/v3

export SERVICE_TOKEN=c50f58a02dde43f286517af102786be0

Restart OpenStack Services

/etc/init.d/openstack-keystone restart
Troubleshooting

If you received “horizon unauthorized (http 401)” errors, you can revert back policy.json v2 file and try to restart services.

How to Enable Multi Domains on openstack horizon

Horizon supports multi domains as well. You need to add only a few changes to local_setting. Apply the correct policy.json file for keystone.
vi /etc/openstack-dashboard/local_settings

uncommand the following settings.

OPENSTACK_API_VERSIONS = {
“identity”: 3
}
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
OPENSTACK_KEYSTONE_URL = “http://192.168.1.133:5000/v3”
Save local_settings and restart openstack-dashboard.

/etc/init.d/httpd restart
时间: 2024-11-06 10:16:39

ERROR (ClientException)的相关文章

nova ERROR (ClientException): 解决方法

报错信息 ClientException: Unknown Error (HTTP 503) (Request-ID: req-c9ec29c6-cca5-4edc-9828-cd6494d2d36b) ERROR (ClientException): Unknown Error (HTTP 503) (Request-ID: req-c9ec29c6-cca5-4edc-9828-cd6494d2d36b) 使用debug调试查看报错信息: nova --debug list DEBUG (e

ERROR (ClientException): Unexpected API Error

禁用glance api v1 引起nova image-list 报错

在部署glance时禁用了v1 api,使用nova image-list出现了报错 nova image-list ERROR (ClientException): The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-70664768-3d60-434b-b812-e0251029a9df) 从nova-api日志上看到有下面

关于SpringCloud配置网关转发时出现一下啊错误:“com.netflix.zuul.exception.ZuulException: Forwarding error at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.handleException”

com.netflix.zuul.exception.ZuulException: Forwarding error at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.handleException Caused by: com.netflix.client.ClientException: Load balancer does not have available server for cli

C++工程编译之“error LNK2001: 无法解析的外部符号”

今天一整天都在折腾“error LNK2001: 无法解析的外部符号”,就在头疼不已的时候,总算是找到问题原因了:各个动态链接库的编译方式必须统一才行,要不然很容易对库函数的引用产生冲突.简单来说就是,如果使用的第三方函数库编译方式采用/MD,那么主工程也应该使用/MD.我使用了libevent,而主工程默认采用/MT,所以需要忽略一大堆的函数库,我还纳闷呢,怎么会这么奇怪!!今天总算是解决了长久以来的困惑了. 下面引用一篇文章的描述:[Z]VC运行库版本不同导致链接.LIB静态库时发生重复定义

【转】Windows Error Code(windows错误代码详解)

本文来自: http://blog.sina.com.cn/s/blog_5e45d1be0100i0dr.html http://blog.sina.com.cn/s/blog_5e45d1be0100i0dt.html http://blog.sina.com.cn/s/blog_5e45d1be0100i0dv.html 这三篇,因为格式实在太乱,因此拿来整理了一下.找这个的原因是今天在改程序的时候蹦出来个WindowsError: [Error 2],也没有说这个东西是什么错误.于是百度

SpringBoot接口服务处理Whitelabel Error Page

转载请注明来源:http://blog.csdn.net/loongshawn/article/details/50915979 <SpringBoot接口服务处理Whitelabel Error Page> <Maven依赖载入错误的情况分析> <Java Webproject转换为基于Maven的Webproject> <Maven Webproject执行异常:Maven.multiModuleProjectDirectory system propery

Android 编译错误——布局 Error parsing XML: not well-formed (invalid token)

在修改了Android布局文件后,编译出现Error parsing XML: not well-formed (invalid token). 首先先排查xml文件的编码格式是否为UTF-8, <?xml version="1.0" encoding="utf-8"?> ,注意,从别处copy的要留意编码格式! 还有各个标签是否有遗漏,把鼠标箭头移到出错误的layout上 点击鼠标右键选择Source然后再选Format. 都没有问题,结果发现报错处(

error C2143: syntax error : missing &#39;;&#39; before &#39;{&#39;

这是我在实现哈夫曼树的时候,遇到的错误,具体为什么我也不清楚!!!因为这是我用学校实验室的电脑编译出现的错误(用的软件是VC6.0,贼老的版本!!!),我自己的是Code Blocks(没有出错)??? 代码如下: for ( i = 1; i <= n; i++ ) { huffNode HT[i](w[i],0,0,0);//初始化前n个节点(构造哈夫曼树的原始节点) } 然后,就有错了(-_-!) error C2057: expected constant expression erro