创建Openstack的客户端脚本

Create OpenStack client environment scripts

使用OpenStack命令行需要输入很多的参数,所以设置环境变量脚本可以提高效率, 将一些操作的环境变量和命令放在一个脚本里

  1. Edit the admin-openrc file and add the following content:

    export OS_PROJECT_DOMAIN_NAME=default
    export OS_USER_DOMAIN_NAME=default
    export OS_PROJECT_NAME=admin
    export OS_USERNAME=admin
    export OS_PASSWORD=ADMIN_PASS
    export OS_AUTH_URL=http://controller:35357/v3
    export OS_IDENTITY_API_VERSION=3
    export OS_IMAGE_API_VERSION=2
    

    Replace ADMIN_PASS with the password you chose for the admin user in the Identity service.

  2. Edit the demo-openrc file and add the following content:

    export OS_PROJECT_DOMAIN_NAME=default
    export OS_USER_DOMAIN_NAME=default
    export OS_PROJECT_NAME=demo
    export OS_USERNAME=demo
    export OS_PASSWORD=DEMO_PASS
    export OS_AUTH_URL=http://controller:5000/v3
    export OS_IDENTITY_API_VERSION=3
    export OS_IMAGE_API_VERSION=2
    

    Replace DEMO_PASS with the password you chose for the demo user in the Identity service.


[root@controller ~]# . admin-openrc
[root@controller ~]# openstack token issue
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field      | Value                                                                                                                                                                                   |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| expires    | 2016-06-22T11:01:22.109463Z                                                                                                                                                             |
| id         | gAAAAABXamHyM7uWc0VgHVbklPWnJ88FJO2SSB2yHEWPPO8Lqd2-4DTNTQ_mRbfqjUe5BGe_AIqVO2N3ORuOGXjjndGO_1-ZLBm5seYcPdsX4FwmPmWPHZ9eBntOIT57GFXbxw_Ao4gN3qnvjJA7YcYS4K2cV3D6uQxpMMMnrMrCMsA4o_MbrMw |
| project_id | ca40d9866453412985861840c77ee9a4                                                                                                                                                        |
| user_id    | 7235098c7dcc4132afa921bad195d9bd                                                                                                                                                        |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+




  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值