Setting environment variables
The IBM® Cloud Infrastructure Center CLI needs several pieces of
information about the IBM® Cloud Infrastructure Center deployment
in order to work. You can provide this information by using CLI
arguments, but it is easier to set environment variables before you
use the CLI. IBM® Cloud Infrastructure Center includes the
/opt/ibm/icic/icicrc file to simplify this task.
The icicrc file comes configured with default
values that match your IBM® Cloud Infrastructure Cloud environment.
It does not set the administrator's username or password.
Follow these steps to edit the icicrc file:
-
Copy the file to your user's home directory and edit it as necessary. In particular, set these values:
- OS_USERNAME - Your username
- OS_PASSWORD - Your password
- OS_PROJECT_NAME - If you have multiple projects, specify the project that you want to access.
- OS_TENANT_NAME - If you have multiple projects, specify the project that you want to access.
Note: If you add your password to this file, restrict the file permission so that other users will not be able to read it. Alternatively, you can choose to not set
OS_PASSWORD. In this case, the IBM® Cloud Infrastructure Center CLI prompts you for the password when you run it.Example:
export OS_IDENTITY_API_VERSION=3 export OS_AUTH_URL=https://management_server_IP:5000/v3/ export OS_CACERT=/etc/pki/tls/certs/icic.crt export OS_REGION_NAME=RegionOne export OS_PROJECT_DOMAIN_NAME=Default export OS_PROJECT_NAME=ibm-default export OS_TENANT_NAME=$OS_PROJECT_NAME export OS_USER_DOMAIN_NAME=Default export OS_USERNAME=admin export OS_PASSWORD=password export OS_COMPUTE_API_VERSION=2.72 export OS_NETWORK_API_VERSION=2.0 export OS_IMAGE_API_VERSION=2 export OS_VOLUME_API_VERSION=3.60 -
Before you use the IBM® Cloud Infrastructure Center CLI, run
source icicrcto set the environment variables. -
If administrator runs
source icicrcdirectly without set OS_USERNAME and OS_PASSWORD, a console prompt will ask for username and password.Example:
[~]# source /opt/ibm/icic/icicrc Please input the username: admin Please input the password of admin: