您的位置:首页 > 运维架构

Set environment variables using the OpenStack RC file

2015-11-18 09:27 330 查看

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: