<p>解决了这个问题:不知道为什么,openstack抱怨auth中缺少用户域(不记得确切的消息错误)。在nova中找不到如何通知用户域,但我在keystone上找到了!在</p>
<pre><code>from keystoneclient.auth.identity import v3
from keystoneclient import session
from keystoneclient.v3 import client
auth_url = 'http://10.37.135.89:5000/v3/'
username = 'admin'
user_domain_name = 'Default'
project_name = 'admin'
project_domain_name = 'Default'
password = '123456'
auth = v3.Password(auth_url=auth_url,
username=username,
password=password,
project_id='d5eef1aae54742e787d0653eea57254b',
user_domain_name=user_domain_name)
sess = session.Session(auth=auth)
keystone = client.Client(session=sess)
keystone.projects.list()
</code></pre>
<p>在那之后,我用keystone在nova进行了认证:</p>
^{pr2}$
<p>我在回答这个问题时使用了一些有用的链接:</p>
<p><a href="http://docs.openstack.org/developer/python-keystoneclient/authentication-plugins.html" rel="nofollow">http://docs.openstack.org/developer/python-keystoneclient/authentication-plugins.html</a>
<a href="http://docs.openstack.org/developer/python-keystoneclient/using-api-v3.html" rel="nofollow">http://docs.openstack.org/developer/python-keystoneclient/using-api-v3.html</a>
<a href="http://docs.openstack.org/developer/python-novaclient/api.html" rel="nofollow">http://docs.openstack.org/developer/python-novaclient/api.html</a></p>