我想使用 Apache jclouds 1.8.0(通过 Apache Brooklyn 项目)访问 HP Helion 云,而我之前使用的配置不再有效。文档建议我使用与控制台相同的用户名和密码,但这给了我一个 HTTP 401 身份验证错误。
正在发送的 POST 数据记录在日志中,如下所示(格式化并编辑用户名/密码):
{
"auth":{
"apiAccessKeyCredentials":{"accessKey":"user@example.org","secretKey":"XXXXXXXX"},
"tenantName":"user@example.org.com-tenant1"
}
}
我对 jclouds 的配置包括如下设置身份和凭证:
identity = user@example.org-tenant1:user@example.org
credential = XXXXXXXX
异常跟踪如下:
java.lang.IllegalStateException: Not authorized to access cloud JcloudsLocation[HP Helion (US East):user@example.org-tenant1:user@example.org] to resolve PortableTemplateBuilder[ports=[22], os=ubuntu, locationId=region-b.geo-1, osVersionRegex=12.04, is64bit=true, imageChooserFunction=brooklyn.location.jclouds.BrooklynImageChooser$3@5ec6379b, minRam=2048]
at brooklyn.location.jclouds.JcloudsLocation.buildTemplate(JcloudsLocation.java:1052) ~[brooklyn-locations-jclouds-0.7.0-20140817.024657-169.jar:0.7.0-SNAPSHOT]
Caused by: org.jclouds.rest.AuthorizationException: POST https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens HTTP/1.1 -> HTTP/1.1 401 Unauthorized
at org.jclouds.openstack.nova.v2_0.handlers.NovaErrorHandler.handleError(NovaErrorHandler.java:93) ~[openstack-nova-1.8.0.jar:1.8.0]
Caused by: org.jclouds.http.HttpResponseException: request: POST https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens HTTP/1.1 [{"auth":{"apiAccessKeyCredentials":{"accessKey":"user@example.org","secretKey":"XXXXXXXX"},"tenantName":"user@example.org-tenant1"}}] failed with response: HTTP/1.1 401 Unauthorized
at org.jclouds.openstack.nova.v2_0.handlers.NovaErrorHandler.handleError(NovaErrorHandler.java:78) ~[openstack-nova-1.8.0.jar:1.8.0]