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

 

另外一个方法获取admin tenant id:

-> # keystone tenant-list
+----------------------------------+----------+---------+
|                id                |   name   | enabled |
+----------------------------------+----------+---------+
| 74288c12eb5f47aeab9c5df2c1faf57e |  admin   |   True  |
| 4fd7c32848254b34be0b977e1bd1c2cc | services |   True  |
+----------------------------------+----------+---------+

如果上面命令执行不了,先执行:

export OS_SERVICE_TOKEN=165a1766c12a497b8fbb18867c212aaa    //见/etc/keystone/keystone中的admin_token

export OS_SERVICE_ENDPOINT=http://10.0.2.245:35357/v2.0

 

问题:

如果在导出时导出了

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.

转载于:https://www.cnblogs.com/longchang/p/10763539.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
>