Configure Usage Instructions

Next step is to configure the credentials to access CLI

Note: Set terminal to the directory where virtual environment was created.

1. Create openrc file within virtual environment

(.venv)$ vi openrc

Note: The openrc file can be placed anywhere within the virtual environment

2. Add Credentials into openrc file

In the openrc file place the below content and specify appropriate values for <endpoint>, <username>, <password> and <tenant_id>. Save the openrc file.
export CORESTACK_ENDPOINT=<endpoint>
export CORESTACK_USERNAME=<username>
export CORESTACK_PASSWORD=<password>
export CORESTACK_TENANT_ID=<tenant_id>

Description of the keys in openrc file and expected values are mentioned in the table below:

Key Value
  • Tenant under which the commands are to be executed
  • Need to call “corestack tenants-list” call to get the prefered tenant id from the list of tenants.
  • If you are unaware of the tenant id to be used, leave the tenant id as it is and save the openrc file. Continue with section 2.4.3 and 2.4.4 which covers the steps to get the tenant id and update it in openrc file

3. Add openrc as a source

Now add openrc file created as a source to the session
(.venv)$ source openrc

Note: Any edits in the openrc file like modifying the tenant, will be reflected in CLI commands only after executing “source openrc” command again.

4. How to get Tenant ID?

Execute tenants-list command to get the list of tenants for the user specified in the openrc file. ID, Tenant Name & Status of the tenants will be displayed as output. From the list select the appropriate ID.

(.venv)$ corestack tenants-list


Attributes Description
limit Optional. Limits the number of tenants that can be retrieved
page_number Optional. Page number of the tenants list to be retrieved

Sample Output

When the Tenant ID is available, need to

  • Open the openrc file again
  • Update the openrc file with the Tenant ID
  • Save the openrc file
  • Run “source openrc” command to refresh the openrc content