openstack kilo 命令行

Posted longchang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了openstack kilo 命令行相关的知识,希望对你有一定的参考价值。

把下面内容放到.bashrc中,或者直接执行也行。

export OS_USERNAME=admin
export OS_PASSWORD=admin              #根据实际密码来设   
export OS_PROJECT_NAME=admin
export OS_AUTH_URL=http://localhost:35357/v2.0
export OS_IDENTITY_API_VERSION=2
export OS_TENANT_ID=06bb27f1c72d46b38fabd62cb1ee6d5c   #这个获取方法见下文

 

通过查询数据库可获得auth_url 与 tenant_id

mysql -u root
show databases;
use keystone;
show tables;
select * from endpoint;

会看到http://10.0.3.41:35357/v2.0

select * from token;

会看到tenant,找到id, 这里是06bb27f1c72d46b38fabd62cb1ee6d5c

 

问题:

如果在导出时导出了

export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default

执行nova命令会出现下面错误:

ERROR (DiscoveryFailure): Could not determine a suitable URL for the plugin

详细解释及参考链接:https://ask.openstack.org/en/question/80400/using-nova-client-in-windows-error-discoveryfailure-could-not-determine-a-suitable-url-for-the-plugin/

This error is related to the version of Keystone API you‘re using. As noted in https://bugs.launchpad.net/python-openstackclient/+bug/1447704 (this open bug report), it does not work when using an OS_AUTH_URL ending in "v2.0" and the variables OS_PROJECT_DOMAIN_ID and OS_USER_DOMAIN_ID are set.

The workaround is to remove the variables OS_PROJECT_DOMAIN_ID and OS_USER_DOMAIN_ID if you wish to use v2 of the Keystone API.

以上是关于openstack kilo 命令行的主要内容,如果未能解决你的问题,请参考以下文章

如何开始使用OpenStack命令行和API

openstack命令行 CLI

转载如何开始使用OpenStack命令行和API

OpenStack 命令行速查表(转载)

openstack的命令行管理#私藏项目实操分享#

openstack-keystone外组件命令行