用Crowbar安装OpenStack,operating systeme: SLES 11SP3.
由于之前安装cisco插件出现的BUG (bug 问题以后再写),在终端登陆时,有的时候需要用不同的身份(role)来进行测试.
方法一 还没有验证
1. 用所需用户名登陆到openstack 的dashboard, 在相应project下面,点击进入access&security
2. 在API Access的标签栏里面,点击 Download OpenStack RC File。文件名字的格式为 PROJECT-openrc.sh, 其中PROJECT是下载文件所属的项目名字
3. 复制该文件到需要运行openstack命令的电脑上
4. source demo-openrc.sh
方法二 验证成功
个人喜欢这个方法,简单粗暴
直接建立一个文件,叫什么名字随便,方便自己记住就可以了。名字.sh
export OS_AUTH_URL=https:
//identityHost
:portNumber
/v2
.0
export OS_TENANT_ID=demo
export OS_TENANT_NAME="demo"
export OS_USERNAME="demo"
export OS_PASSWORD="demo"
保存,直接运行文件就好了。
也可以要求每次操作都输入密码:
export OS_AUTH_URL=https:
//identityHost
:portNumber
/v2
.0
export OS_TENANT_ID=demo
export OS_TENANT_NAME="demo"
export OS_USERNAME="demo"echo "Please enter your OpenStack Password: "
read -sr OS_PASSWORD_INPUT
export OS_PASSWORD=$OS_PASSWORD_INPUT
$ keystone --os-password PASSWORD
service-list
该命令用来修改替代文件中的密码 (即时一次性的)
附上官方文档
-
Log in to the OpenStack dashboard, choose the project for which you want to download the OpenStack RC file, and click
. -
On the API Access tab, click
and save the file. The filename will be of the form
wherePROJECT
-openrc.shPROJECT
is the name of the project for which you downloaded the file. -
Copy the
file to the computer from which you want to run OpenStack commands.PROJECT
-openrc.shFor example, copy the file to the computer from which you want to upload an image with a glance client command.
-
On any shell from which you want to run OpenStack commands, source the
PROJECT
-openrc.shIn the following example, the
demo-openrc.sh
file is sourced for the demo project:$ source demo-openrc.sh
-
When you are prompted for an OpenStack password, enter the password for the user who downloaded the
file.PROJECT
-openrc.sh
Alternatively, you can create the
file from scratch, if for some reason you cannot download the file from the dashboard.PROJECT
-openrc.sh
-
In a text editor, create a file named
file and add the following authentication information:PROJECT
-openrc.sh1234567export
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
The following example shows the information for a project called
admin
, where the OS username is alsoadmin
, and the identity host is located atcontroller
. -
On any shell from which you want to run OpenStack commands, source the
PROJECT
-openrc.shadmin-openrc.sh
file for theadmin
project:$ source admin-openrc.sh
![]() | Note |
---|---|
You are not prompted for the password with this method. The password lives in clear text format in the |
When you run OpenStack client commands, you can override some environment variable settings by using the options that are listed at the end of the help output of the various client commands. For example, you can override the OS_PASSWORD
setting in the
file by specifying a password on a keystone command, as follows:PROJECT
-openrc.sh
$ keystone --os-password PASSWORD
service-list
Where PASSWORD
is your password.