Setting environment variables

The openstack CLI needs several pieces of information about the PowerVC deployment in order to work. You can provide this information by using CLI arguments, but it is easier to set environment variables before using the CLI. PowerVC includes the /opt/ibm/powervc/powervcrc file to simplify this task.

The powervcrc file comes configured with default values that match your PowerVC environment. It does not set the administrator's user name or password. Follow these steps to use powervcrc:
  1. Copy the file to your user's home directory and edit it as necessary. In particular, set these values:
    • OS_USERNAME - Your user name
    • OS_PASSWORD - Your password
    • OS_PROJECT_NAME - If you have multiple projects, specify the project you want to access.
    • OS_TENANT_NAME - If you have multiple projects, specify the project you want to access.
    Note: If you add your password to this file, restrict the file permissions so that other users will not be able to read it. Alternatively, you can choose to not set OS_PASSWORD. In this case, the openstack CLI prompts you for the password when run.
    Example file after editing:
    export OS_IDENTITY_API_VERSION=3
    export OS_REGION_NAME=RegionOne
    export OS_AUTH_URL=https://ip192-0-2-0.city.building.domain.com:5000/v3/
    export OS_CACERT=/etc/pki/tls/certs/powervc.crt
    export OS_PROJECT_DOMAIN_NAME=Default
    export OS_PROJECT_NAME=ibm-default
    export OS_TENANT_NAME=ibm-default
    export OS_USER_DOMAIN_NAME=Default
    export OS_USERNAME=admin
    export OS_PASSWORD=passw0rd
    export OS_COMPUTE_API_VERSION=2.25
    export OS_NETWORK_API_VERSION=2.0
    export OS_IMAGE_API_VERSION=2
    export OS_VOLUME_API_VERSION=2
  2. Before using the openstack CLI run source powervcrc to set the environment variables.