Set environment variables using the OpenStack RC file

本文介绍了如何通过OpenStack Dashboard下载OpenStack RC文件,并在本地环境中配置使用该文件的方法。此外,还提供了从零创建RC文件的步骤,帮助用户顺利执行OpenStack命令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Download and source the OpenStack RC file

Log in to the OpenStack dashboard, choose the project for which you want to download the OpenStack RC file, on theProject tab, open theCompute tab and clickAccess & Security.

登录Openstack dashboard,选择希望下载的Openstack RC文件,在Project标签下,点击Compute标签下的Access & Security

On the API Access tab, clickDownload OpenStack RC File and save the file. The filename will be of the formPROJECT-openrc.sh wherePROJECT is the name of the project for which you downloaded the file.

在访问API标签下,点击下载 OpenStack RC 文件。文件名会以 PROJECT-openrc.sh的形式保存,文件中的PROJECT是工程名。

Copy the PROJECT-openrc.sh file to the computer from which you want to run OpenStack commands.

For example, copy the file to the computer from which you want to upload an image with aglance client command.

On any shell from which you want to run OpenStack commands, source the PROJECT-openrc.sh file for the respective project.

In the following example, the demo-openrc.sh file is sourced forthe demo project:

$ source demo-openrc.sh

When you are prompted for an OpenStack password, enter the password for the user who downloaded thePROJECT-openrc.sh file.

运行命令后,会被提示输入密码,输入下载工程名的用户的密码即可。


Create and source the OpenStack RC file

Alternatively, you can create the PROJECT-openrc.sh file from scratch, if you cannot download the file from the dashboard.

除了下载RC文件外,还可以从零开始创建 PROJECT-openrc.sh 文件,如果不能从dashboaed中下载的话。

In a text editor, create a file named PROJECT-openrc.sh and add the following authentication information:

PROJECT-openrc.sh为名,创建一个文件,添加以下验证信息。

export OS_USERNAME=username
export OS_PASSWORD=password
export OS_TENANT_NAME=projectName
export OS_AUTH_URL=https://identityHost:portNumber/v2.0
# The following lines can be omitted
export OS_TENANT_ID=tenantIDString
export OS_REGION_NAME=regionName
export OS_CACERT=/path/to/cacertFile
On any shell from which you want to run OpenStack commands, source the PROJECT-openrc.sh file for the respective project. In this example, you source theadmin-openrc.sh file for the admin project:

例如:读取 admin-openrc.sh 文件为admin工程,添加环境变量。

详细见:

http://docs.openstack.org/user-guide/common/cli_set_environment_variables_using_openstack_rc.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值