我想在这里分享我的测试结果:
使用keystneauth会话API和Identity API v3:from novaclient import client as novaclient
from keystoneauth1.identity import v3
from keystoneauth1 import session
auth = v3.Password(URL,username="username",password="password", project_name="admin", user_domain_id="default", project_domain_id="default")
sess = session.Session(auth=auth)
nova_client = novaclient.Client(2, session=sess, region_name="RegionName")
很好。在
使用凭据和标识API v2:
从novaclient导入client作为novaclient
新星=novaclient.客户(版本、用户、密码、项目标识、身份验证URL_v2、region_name='RegionName')
很好。在
使用凭据和标识API v3:
^{pr2}$
它实际上不适用于错误消息:nova.hypervisors.list()
keystoneauth1.exceptions.http.BadRequest: Expecting to find domain in user - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error. (HTTP 400)
所以我的结论是novaclient不支持3)Identity API V3和凭证。我们可以使用1)Identity API v3与keystoneauth会话,2)使用带凭据的Identity API V2